OCLOperators oclSingleton
(Created page with "oclSingleton is an operator to help you to implement the Singleton pattern (the pattern states that there is exactly one instance of this class - never more - never less). If...")
 
No edit summary
Line 9: Line 9:
Common expression: SysSingleton.oclSingleton.CurrentUser.IsAdmin  -- this expression looks up the only SysSingleton instance that acts as a Global variable that points out the CurrentUser
Common expression: SysSingleton.oclSingleton.CurrentUser.IsAdmin  -- this expression looks up the only SysSingleton instance that acts as a Global variable that points out the CurrentUser
[[File:2017-08-07 21h31 37.png|none|thumb]]
[[File:2017-08-07 21h31 37.png|none|thumb]]
[[Category:OCLOperators]]

Revision as of 19:30, 28 May 2018

oclSingleton is an operator to help you to implement the Singleton pattern (the pattern states that there is exactly one instance of this class - never more - never less).

If you mark a class with IsSingleton=true you can use this oclSingleton operator to get access to the only object instance of this class.

Example:

Class : SysSingleton

Common expression: SysSingleton.oclSingleton.CurrentUser.IsAdmin -- this expression looks up the only SysSingleton instance that acts as a Global variable that points out the CurrentUser

2017-08-07 21h31 37.png
This page was edited 81 days ago on 02/10/2024. What links here