Wednesday, December 28, 2011

ATG Nucleus An Overview


Nucleus - The heart of the (dark) matter

Nucleus is what lies at the heart of ATG. It’s essentially an object container that manages the lifecycle of POJOs using reflection and dependency injection. It's responsible for instantiating objects and setting their properties based on a very flexible but well defined configuration layering hierarchy using simple properties text files. In ATG world, these objects are called components (basically named JavaBeans and Servlets) that can be linked together via these configuration files by a developer to create an ATG application. Nucleus also maintains a name hierarchy and is responsible for resolving these names to components, which can be request, session or globally scoped.
Configuration layering is quite a useful feature of Dynamo. It lets you easily override settings in different application modules you are using, by e.g. creating a component properties file with the same path and name as that component in the corresponding folder in your own module, or in a corresponding folder in a localconfig folder. You can also use thislocalconfig folder to specify environment specific settings, allowing for the creation of environment agnostic builds without having to store all environment specific information in e.g. some database, or doing different builds for different environments. Another nice feature of Nucleus is that it comes with several web based tools that let you browse components in a running application and inspect properties or change their values on the fly, or invoke methods on those components (somewhat similar to a JMX console).
The following diagram gives an example of setting (and overriding) component properties at different layers on the configuration path. The first two files would be part of the application build, but the third file would be placed directly on the production file system to over-write some prebuilt settings.


No comments:

Popular Posts