« Return to Thread: Singleton Pattern in ATG

Re: Singleton Pattern in ATG

by george_o :: Rate this Message:

Reply to Author | View in Thread

Mani,
  Your understanding of session and global scopes appears to be incorrect. Global scoped components are shared by all sessions, and definitely not "maintains single instance over the session" as you stated.

When you define a global scoped component, there will only be one instance of that object in the entire JVM (unless you create the actual object via Java code, i.e. new CustomComponentClass() since that bypasses the ATG Nucleus framework). As long as you are using component references, Nucleus will ensure that only a single instance of that global scoped component will exist at any one time.

- George

 « Return to Thread: Singleton Pattern in ATG