When you work with Nucleus components, it is essential to remember the difference between class names and component names. In the previous section, for example, a component of class Person was constructed into a component called /services/Person. This is probably not very confusing - a component in Nucleus has both a component name and a class name. It should also be clear that two components in Nucleus cannot have the same absolute name, but they may have the same class.

The confusion usually arises when a developer starts writing all of the Java source files and properties files required to build an application. For both types of files, the file’s position in the namespace also determines its position in the file directory. For example, a Java file for the class atg.nucleus.Nucleus is supposed to live at {SOURCEDIRECTORY}/atg/nucleus/Nucleus.java, while the properties file for component /services/log/fileLogger is supposed to live at {CONFIGDIR}/services/log/fileLogger.properties. This confusion becomes even more pronounced when the component name is the same as the class name, as often happens when there is a single instance of certain components in an application. For example, the class atg.service.scheduler.Scheduler might be instantiated as a component called /services/Scheduler.

Maintaining good package structures and clean development environments right from the start always helps avoid such problems. The Components window can also help you limit this confusion. When you select a component in the Components window of the ATG Control Center, the class name is displayed in the Bean Information panel at the bottom of the ACC window. When you edit a component, the class name and pathname are both displayed, in the basic information at the top of the Components editor window and in the Basics tab.

 
loading table of contents...