|
Singleton Pattern
[Previous]  [Next] 
|
![]() |
User Manual [Previous]  [Next] Singleton PatternUse the Singleton keyword to mark a class as a singleton class. The code ensures that only one object of the class is instantiated at runtime. For more details on the Singleton pattern, see this Wikipedia page. Example
class Airline
{
singleton;
}
Load the above code into UmpleOnline SyntaxsoftwarePattern- : [[isA]] | [[singleton]] | [[immutable]] | [[keyDefinition]] | [[codeInjection]] // A class that can have only one instance SingletonPattern singleton- : [=singleton] ; |