Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

re: CORBA Object Factory & Object Adapters  RSS feed

 
sid alam
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?
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
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
Sheriff
Posts: 7292
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!