(I've had a problem with this mail list and this is the third time I've posted 
this - apologies if you got them all)
I'm thinking about the idea of 'static' in Java and C++ (just in the per-class 
sense), and the idea from Eleanor Rosch of the typicality of concepts. Is 
static an all-or-nothing idea, or are some examples of static more typical than 
others? Especially for students.
Is there any source code repository analysis which could be used to say what 
'typical' uses of static are?
Or is it just used all over the place whenever needed?
Any 'non-typical' uses of static?
What about the use of a class with static members and no public constructor as 
a way of implementing the singleton design class? Would that be non-typical? 
Why, exactly?
I have a partial answer - yes. This is that the typical use is to make class 
members per-class and not per-object. One non-typical use is in classes which 
only have static members and which do not instantiate objects - such as the 
Math class. This is a kludge which re-uses the class concept (modelling 
real-world objects) to make a module. having a Math object doesn't make sense, 
but having a module where all math-related stuff goes does make sense.

And another non-typical use is to implement the singleton pattern, where you 
want one, and only one, object. But because this does still relate to the 
class/object idea, it is more typical than the module version.

Any more non-typical uses of static? 

Reply via email to