The preferred access pattern for CORBA clients (using Java example code) is:
Manager manager = ManagerHelper.narrow(orb.string_to_object(url)); Session session = manager.createSession(username, password); Factory factory = FactoryHelper.narrow(session.lookup("MyPackage/MyComp")); MyComp comp = MyCompHelper.narrow(factory.create());
The last two lines can alternatively be replaced with:
MyCompHome home = MyCompHomeHelper.narrow(session.loookup("MyPackage/MyComp")); MyComp come = home.create();
The second style is recommended because it allows you to pass one or more parameters to the called EJB stateful session’s home.create(...) method. This is why the factory.create(username, password) API was deprecated, since it conflicts with the home.create methods for stateful session beans with initialization parameters.
Explicit use of CosNaming APIs in CORBA clients is not recommended, because it might lead you to use the deprecated (or in the non-Java case, unsupported) factory.create(username, password) API.
For inter-component calls, you can use the shortcut:
MyComp comp = MyCompHelper.narrow(orb.string_to_object("MyPackage/MyComp"))
Or you can use an URL of “iiop://0:0” with the full style using explicit Manager, Session, and so on.
PowerBuilder clients can use the “Connection.CreateInstance” method, and can also use the explicit CORBA style shown above.
PowerBuilder components doing intercomponent calls can use the “TransactionServer.CreateInstance” method, and can also use the explicit CORBA style shown above.