Ir ao conteúdo

Um exemplo da utilização de CORBA

Olá,

CORBA (Common Object Request Broker Architecture) é um padrão definido pelo grupo OMG (Object Management Group), este permite a interação entre Objetos Distribuídos, em diferentes linguagens e sistemas. Ele também proporciona total transparência na comunicação entre os objetos distribuídos. A localização de objetos é feito via suas referências, que são resolvidas pelo ORB. A linguagem IDL (Interface Definition Language) é a tecnologia utilizada para descrever as interfaces dos objetos. Esta é uma linguagem puramente declarativa. Ela possui seus próprios tipos de dados, que são mapeados para tipos de dados nas linguagens suportadas. Existe o Compilador IDL que gera os códigos responsáveis pela comunicação entre objetos, mapeia os tipos de dados, se encarrega de fazer a serialização dos dados.

Mas na prática como funciona? Bom, possuimos as definições em um arquivo .idl, neste caso o arquivo Bank-idl (lembre-se de renomea-lo para bank.idl).

Acessando esse arquivo vocês verão diversas definições como:

Definição do modulo

module banco {

Definição do tipo valor

typedef double valor;

Definição da estrutura de dados Transação

struct transacao {
unsigned long data; // Formato: ddmmyyyy
string<12> descricao;
valor quantia;
};

Definição da interface, seus métodos, variaveis, excessões

interface auto_atendimento {
readonly attribute string boas_vindas;
valor saldo ( in conta c )
raises ( conta_inval );
void extrato ( in conta c,
out transacoes t, out valor saldo )
raises ( conta_inval );
void transferencia ( in conta origem,
in conta destino, in valor v )
raises ( conta_inval, saldo_insuf );
void investimento ( in conta c,
in aplicacao apl, in valor v )
raises ( conta_inval, saldo_insuf );
};

Com este arquivo, você pode criar as diversas interfaces com diferentes compiladores para diferentes linguagens. Para gerar as interfaces utilize

idlj -fall bank.idl

O mesmo irá gerar diversos arquivos dentro da pasta banco, com arquivos .java, com interfaces, métodos e exceções. Os mesmos devem ser ainda implementados para funcionar como você desejar.

Um exemplo de implementação de um Servidor de Banco e um Cliente em Java, utilizando CORBA com IDL

Matheus

PS: Isto foi apenas uma breve introdução. O CORBA utiliza diversas outras definições como o OMA e outras.

Publicado emjava

2.403 Comentários

  1. يقدم الموقع تصميمًا عربيًا واضحًا وقائمة تدعم أكثر من خمسين لغة.
    تضم غرف اللعب المباشر ما يزيد عن 250 طاولة يديرها موزعون فعليون.
    تتغير الأودز في الوقت الفعلي مع إمكانية الرهان الحي ومتابعة النتائج.
    تُضاف إلى ذلك عروض منتظمة من كاش باك ورهانات مجانية وبطولات دورية.
    يمكن فتح حساب جديد عبر الهاتف أو البريد الإلكتروني في دقائق.
    888 stars 888 starz

  2. I will right away seize your rss as I can’t in finding your email subscription hyperlink or newsletter service. Do you’ve any? Kindly let me recognize in order that I could subscribe. Thanks.

  3. juegos gratis tragamonedas casino europa

    Feel free to surf to my web-site; casinos con bonos de cumpleaños (Zack)

  4. May I simply say what a relief to discover someone that actually understands what they are talking about online. You actually understand how to bring a problem to light and make it important. More and more people ought to check this out and understand this side of the story. It’s surprising you’re not more popular given that you most certainly possess the gift.

  5. Alberttwits Alberttwits

    звоните круглосуточно по телефону горячей линии клиники: наши специалисты готовы оказать необходимую помощь в решении проблемы алкогольной зависимости.
    Исследовать вопрос подробнее – https://vyvod-is-zapoya-sochi22.ru/

  6. best real money casino united kingdom, new zealand poker players and best australian isle of capri casino
    lake charles broke loose – Lynne – sign up bonus, or online
    slots no deposit bonus usa

  7. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  8. At this time it appears like BlogEngine is the top blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?

  9. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  10. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *