Doing so creates an instance of the Singleton Pattern in the Model Explorer.
执行此操作将会在模型浏览器中生成一个Singleton模式的实例。
Create a private attribute for the Singleton Pattern called _instance.
为Singleton模式创建私有属性,称为_ instance。
Drag and drop the Singleton Pattern instance from the Pattern Explorer into the UML Class Diagram view.
将Singleton模式实例从模式浏览器中拖拽到UM l类图视图中。
Singleton Pattern Ensure a class has one instance, and provide a global point of access to it.
确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。
As its name suggests, the Singleton Pattern is typically used when you want only one instance of a particular class.
如其名称所暗示的,当您想要特别类的仅仅一个实例时,才使用Singleton模式。