Tutorials to .com

Tutorials to .com » Dotnet » Oop » Words: one-piece model

Words: one-piece model

Print View , by: iSee ,Total views: 21 ,Word Count: 183 ,Date: Wed, 22 Apr 2009 Time: 12:50 AM

Single mode, such as by epower Chiloscyllium to write messages in it, is used to create a globally unique example of the need to model. Just need to correct that. singleton pattern, the constructor should be protected. so we can expand this type of constructor.
The main application of a single model in the following occasions:
For a class, occupy a lot of system resources. And the overall situation of these resources can be shared, the singleton pattern can be designed to force the overall situation there is only one example of a class, need to count examples. Can be carried out in the createInstance and can limit the number of examples.
For a class, need to conduct case-specific control, for example, expect to return to the example is actually an example of its own subclass. Singleton pattern can do for the client to maintain a transparent code.

.Net Object Oriented Programming Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.