Oracle ATG Component Scopes

Oracle ATG Component Scopes

Oracle ATG has 5 different scopes that can be used to application components:

  1. Global – Global scope in Oracle ATG is used when we want to share the component with all users.
  2. Session: Session scope in Oracle ATG is used when we want each user visiting the site has to be provided with separate instances.
  3. Request: Request scope in Oracle ATG is used when we want each active request coming to site should be provided with a separate instance.
  4. Window: Window scope in Oracle ATG is used when we want each browser window should be provided with separate instance of teh component.
  5. Prototype: Window scope in Oracle ATG is used when we want each resolve of a atg component needs to provided with separate instances of the component.

Oracle ATG Component Scopes

How to define the Component Scopes in Oracle ATG?

$scope property is the convention used to define the components scope. This property can be set to – global, session, request, or window.
For example, to set the NewStudent component to session scope we need to define as shown below:

 config/com/technostixs/student/NewStudent.properties
 $class=com.technostixs.student.Student
 $scope=session
 fname=Eric Menon
 lname=Menon
 age=25
 email=emenon@technostixs.com

We need to specify the scope of the that we want the behavior to be. If $scope property is not set explicitly, thenit is by default the scope of such component is considered to be global
If a component?s $scope property is not explicitly set, it automatically has global scope

Few rules to be followed while defining scope of a component:

A component can have properties pointing to objects/components whose scope is equal to or greater than its own.
Example: request scoped component can have properties pointing to objects of scope (any scope) request, session or global.

session scoped component can have properties pointing to objects of scope session and global.
global scoped component can have properties pointing to objects of scope global.

You may also like this

seperator

About TechnoStixs.com

Personalization related tables in Oracle ATG

ORACLE ATG ENDECA & JAVA TECHNOLOGY XCHANGE SYSTEM. TechnoStixs.com is a dedicated weblog for Oracle ATG, Oracle Endeca, Java/J2EE and web developers. We take pride in our work. Every publication is carefully analyzed, written and tested to ease the understanding of the topic or subject.

We cover Oracle ATG, Oracle Endeca, Java Core Technologies, eCommerce, J2EE Frameworks, Web Service, Build Tools, Unit Test Frameworks and Others.

2,499 total views, 2 views today

Add comment