Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Talk:Implementing a Singleton using Symbian CCoeStatic class
A very helpful code-snippet on usage of a very powerful feature of symbian. Shows how we can initialize a singleton class just once and then later use the same instance throughout the project. Data members of a singleton class
are maintained globally and any changes made to them are reflected across the project. The code is well commented and describes the concept and its usage briefly.
Singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. It is powerful concept of software engineering. Since singleton class have only one instance at a time, it can also be used as a just like global variable in application. The DLL in EKA1 can not support writable static data and so singleton class can not be usable in DLL of EKA1.
The article describes how to create singleton class in symbian. Proper comment on will enable beginners to understand important of each method. Each singleton class must have a unique TUid, so do not forgot to use separate TUid if you have more than one singleton class.