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.499 Comentários

  1. real money united statesn online casino, slots ironman lausaarote and good morning united states time slot, or united statesn heritage poker
    table

    my web-site – craps don’t pass payouts (Rory)

  2. hello there and thank you for your info – I have definitely picked up anything new from
    right here. I did however expertise a few technical points using this website, as I experienced to reload the site
    lots of times previous to I could get it to load properly.

    I had been wondering if your hosting is OK? Not that
    I’m complaining, but sluggish loading instances times will very frequently affect your placement in google and could damage your quality
    score if advertising and marketing with Adwords.
    Well I’m adding this RSS to my e-mail and could look out for much more of your respective intriguing content.
    Ensure that you update this again very soon.

  3. Right now it looks like BlogEngine is the best blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

  4. May I simply say what a relief to find somebody that actually understands what they’re discussing on the web. You definitely realize how to bring an issue to light and make it important. More people really need to check this out and understand this side of the story. I was surprised you’re not more popular because you most certainly have the gift.

  5. 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.

  6. I’m impressed, I need to say. Really rarely do I encounter a blog that’s both educational and entertaining, and let me tell you, you have hit the nail on the head.

  7. A good web site with interesting content, that’s what I need. Thank you for making this web site, and I will be visiting again. Do you do newsletters? I Can’t find it.

  8. Surprisingly good post. I really found your primary webpage and additionally wanted to suggest that have essentially enjoyed searching your website blog posts. Whatever the case I’ll always be subscribing to your entire supply and I hope you jot down ever again soon!

  9. Aw, this was a really good post. Taking a few minutes and actual effort to make a top notch article… but what can I say… I hesitate a whole lot and don’t seem to get anything done.

  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.

  11. joker online casino canada, online san ysabel casino (Margie) no deposit bonus free spins
    usa and free bingo australia, or top online pokies and casinos canadian free games

  12. At this time it appears like Drupal is the best blogging platform out there right now. (from what I’ve read) Is that what you are using on your blog?

  13. Currently it seems like Drupal is the preferred blogging platform available right now. (from what I’ve read) Is that what you’re using on your blog?

  14. Aw, this was a really good post. Taking the time and actual effort to make a really good article… but what can I say… I hesitate a whole lot and don’t seem to get nearly anything done.

  15. Wow that was unusual. I just wrote an extremely long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyways, just wanted to say superb blog!

  16. Hi there, You’ve performed a fantastic job. I’ll certainly digg it and in my opinion recommend to my friends. I am sure they’ll be benefited from this site.

Deixe um comentário

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