[omniORB] IDL Advice
jiwils - Jimmy Wilson
jiwils@acxiom.com
Thu, 10 Aug 2000 16:01:51 -0500
We are implementing a project that will have a Factory object. The factory
object will have two methods. One of those will be create, and the other
will be destroy. Create will (based on the type passed to it) create on of
several objects. To my knowledge, there are two ways of doing this, could
anyone give me their advice as to which is the better method?
Method One (base interface):
----------------------------
interface A
{
// empty
}
interface B : A
{
// lots of methods
}
interface C : A
{
// lots of methods
}
interface ObjectFactory
{
// create method
A Create(in string Type);
// destroy method
void Destroy(in A Obj);
}
Method Two (use an IOR):
------------------------
interface B
{
// lots of methods
}
interface C
{
// lots of methods
}
interface ObjectFactory
{
// create method
string Create(in string Type);
// destroy method
void Destroy(in string ObjRef);
}
It seems to me that Method One is the most object oriented and can get
around a couple of Obj->Str/Str->Obj function calls. For those reasons I
prefer it, but I would like to see if there are any other reasons that
Method One is better and/or if there are reasons that Method Two is
preferable.
Thanks for your help.
Jimmy
--
James "Jimmy" Wilson
Software Developer, Acxiom Corporation
E-Mail: jiwils@acxiom.com