Nucleus

Nucleus

  • Nucleus is the Oracle Commerce Platform’s component model for building applications from JavaBeans. 
  • Nucleus helps us assemble applications through simple configuration files
  • Nucleus is the mechanism that gives JavaBean components a place to live, Resolve path.
  • Nucleus organizes application components into a hierarchy . Example, a component named /services/logs/FileLogger represents :
                 root container (Necules) for the services component.
                 services container for the logs component.
                 logs container for the FileLogger component.
  • Nucleus also create and initialize components.

Component

Any Java object with an empty constructor can act as a component in Nucleus.

Component Scopes

Global: Component is shared among all users.
Session: Separate instances of the component are provided to each user.
Request: Separate instances of the component are provided to each active request.
Window: Separate instances of the component are provided to each browser window.
Prototype: Separate instances of the component are provided each time the component is resolved.

Property

To define a configurable property, a class defines
  • a getX method that takes no arguments and returns a value, and 
  • a setX method that takes one argument and returns void. 
The type returned by the getX method must be the exact same type as the type taken as an argument by the setX method, and can be any Java type.

Both the getX and setX methods must be declared public.

The property name is formed by removing get or set from the method name and changing the first letter of the remaining string to lower case.

For example, the method getFirstName() defines a property called firstName.


Note:
If the first two letters of the remaining string are both capitalized, no letters are changed to lower case. For example, the method getURL() defines a property called URL.
The getX method for a Boolean property can be replaced by isX. For example, the Boolean property running can be defined by the method getRunning() or isRunning().

Property names are case-sensitive. Thus, the entry Age=20 does not set the property Person.age.

Post a Comment