Problem

Can I pass around directly a Component Reference from one Component to another?

Solution

In short: NO! 

There are cases where Component A needs to tell Component B about another Component C.

Component A has done a getComponent() on C and now it needs to tell B about C so that also B can use it.

At a first look it might seem that A can simply pass to B the plain CORBA reference to C, but in ACS this is not allowed

This is actually a strong violation of basic ACS principles.

One has to pass around the NAME (CURL) of the Component and the client has to do a getComponent() with that name.

The reason is that this is the only way the Manager has to keep track of who is using Components.

If you pass around directly the reference, the Manager cannot handle properly the reference counts and will possibly release the Component when there are still other clients.

The alternative would be that the application implement themselves reference handling, duplicating the job done by the Manager.

In some special cases, OFFSHOOT object can be used to pass around CORBA Objects (that are not components) whose lifecycle will be managed by the creator and not by the Manager (Architecture 3.4.3, 3.10.14, http://www.eso.org/projects/alma/develop/acs/OtherDocs/ACSPapersAndSlides/ACS-Course/ACSCourse-OffshootClass.ppt).

Instead of having IDL interfaces that takes a parameters CORBA references to components, you have simply to replace the reference with the name (CURL) and do a getComponent in the client.

Notice that this works perfectly also with dynamic components: once you have activated a dynamic component, you can pass its name around and just use getComponent. You do not need to use getDynamicComponent any more.

The component will then be released when all clients will be gone.

For more details, see the ACS architecture, section 3.10.14