Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

re: CORBA Object Factory & Object Adapters

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with CORBA.
Can any one tell me what are Object Factories?
How the Object Factory is applied in the CORBA environment?
What are Object Adapters?
What type of Object Adapters if any will be suitable for an e-Music database system?
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sid -
I'm not big on CORBA, but after a little research I'm persuaded that Object Factories and Adapters aren't really CORBA-specific. They refer instead to two design patterns that come in handy all the time.
A Factory is a method (or class, I guess) that generates objects of one kind. It's useful when you have to chunk out tons of the same object type, where each instance varies by a few details. Here's a contrived example, minus condition testing:

For my money, that's shorter than writing four lines for each button, and cleaner than a loop.
An Adapter is a class (or suite of methods) that binds classes with dissimilar public interfaces. Let's we have a juggling animation Juggle with a stopJuggling() method. We have a button PushMe that fires actionPerformed() calls when clicked. We want to make a button click stop the juggling, but there's no clear way....unless we write a class that bridges the gap! Here's an example:

Adapters aren't rocket science, but when you're starting out with OOP, it may not always occur to you to build a class that just acts as an intermediary. Sure makes life easier though.
These are such popular patterns that the CORBA team probably just appropriates them for their own vocabulary.
[ January 04, 2002: Message edited by: Michael Ernest ]
 
sid alam
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with Object Factories in CORBA and studying some code in this area and want to know why the line of code below is given in the Server side.
Note Michael Ernest was absolutely correct in that Object Factory is not really CORBA Specific and this is actually term given to how objects are created.
//why???
Thread.currentThread().join
normally
most of my CORBA applications that I write use the standard "shell structure" on server to listen and wait for new clients i.e
//wait for invocations from clients
java.lang.Object sync = new java.lang.Object();
synchronized(sync);
{ sync.wait(); }
 
Michael Ernest
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've written a piece of code that has a join() call in the main method. Run it that way; then run it with the join() commented out. Then come back and tell us what you think.
 
Normally trees don't drive trucks. Does this tiny ad have a license?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic