Factories

One of the things that is conspicuously absent from IDL is a constructor declaration (other than the factory init method for value types). With CORBA, you usually create a special object called a factory that creates object instances. You register the factory with the naming service, and clients only need to perform a naming lookup on the factory. After a client has located a factory, it can invoke methods to create the actual objects.

Figure 17.2 shows the relationship between a factory, a client, and the object the factory creates.

Figure 17.2. The client uses the factory to create specific objects.

Listing 17.10 shows an IDL file ...

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.