2006-03-13

What type data members for a static instance?

In Poggle, I am using static for all data members in the Singleton opbject. In other program, the only static data member is the instance variable.

About the only advantage I can think of for all data variable to be declared static is to allow the calling classes to access them, directly or throught accessor functions, without going through the Singleton instance. The disadvantage is this will break the expected behavior of the Singleton as well as having potential syncronization issues.

No comments: