[22] FACTORIES AND FACTORY FINDERS ![UPDATED!](updated.gif)
(Part of the CORBA FAQ, Copyright © 1996)
[22.1] WHAT IS A FACTORY? ![NEW!](new.gif)
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
A factory is a CORBA Object that returns another CORBA object via one of its
CORBA operations. There are many different types of factories with many
different purposes. In fact, the OMG has defined several services that are
actually factories.
[ Top | Bottom | Previous section | Next section ]
[22.2] WHAT ARE SOME TYPICAL TYPES OF FACTORIES? ![NEW!](new.gif)
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
There are several types of factories:
- Generic: A generic factory is a factory (CORBA Object) that is capable of
returning other CORBA Objects. These CORBA Objects are generic. This means
that they can be of any type, rather than a specific type. The
SomeFactory::GenericCreate() operation causes the SomeFactory interface to
be a generic factory. The NamingContext object defined as part of the CORBA
Naming Service is a classic example of a generic factory.
- Specific: A specific factory is a factory (CORBA Object) that is capable
of returning a specific type of pre-defined CORBA Object.
The SomeFactory::SpecificCreate() operation causes the SomeFactory interface
to be a specific (or typed) factory.
- In-process: An in-process factory is a factory which is implemented in the
same
process as the object which is created or managed by it.
- Out-process: An out-process factory is a factory which is implemented in a
process different from the one of the object which is created or managed by it.
//IDL
interface AnObject {
boolean ping();
};
interface SomeFactory {
CORBA::Object GenericCreate();
AnObject SpecificCreate();
};
[ Top | Bottom | Previous section | Next section ]
[22.3] DOES THE CORBA SPECIFICATION DEFINE ANY SPECIFIC CAPABILITIES FOR A FACTORY OBJECT? ![NEW!](new.gif)
[Recently created (7/1997).
Click here to go to the next FAQ in the chain of recent changes]
The CORBA Lifecycle specification defines a GenericFactory interface from
which all factories should inherit, but this is not required. The CORBA
specification also defines a factory for factories, known as a factory
finder. The factory finder is a just a CORBA factory which act as a factory
for other factory interfaces.
[ Top | Bottom | Previous section | Next section ]
E-mail us
[ CORBA FAQ
| Table of Contents; Exhaustive; Alphabetical
| Subject index
| About the authors
| ©
| TM
| Download your own copy ]
Revised Sep 8, 1997