Re: Singleton
- From: "Chris Rolliston" <spam@xxxxxxxxx>
- Date: 17 Jan 2008 15:33:34 -0700
2. A class var is a clean OOP mechanism and it's not .NET specific
either. C++ has had class vars for ages now and I always missed them
in Delphi 7.
Hey, I'm not saying class vars themselves are illegitimate. Whether
they make for 'a clean OOP mechanism' is another matter however (see my
reply to your other post)!
You could even live without ever creating an instance of the class,
since the class itself can have data (using class vars).
Well, if that were possible, using a records-with-methods approach
rather than a class would be more appropriate IMO, since otherwise, you
would be 'misusing' Delphi's 'class' idiom in a manner almost as much
as writeable typed consts 'misuse' the word 'const' - for, isn't the
first thing a person learns about objects in Delphi is that they are
always created on the heap, and so, have to be explicitly instantiated
before being used?
.
- Follow-Ups:
- Re: Singleton
- From: Jens Mühlenhoff
- Re: Singleton
- References:
- Singleton
- From: Alan T
- Re: Singleton
- From: Chris Rolliston
- Re: Singleton
- From: Chris Morgan
- Re: Singleton
- From: Craig Stuntz [TeamB]
- Re: Singleton
- From: Chris Rolliston
- Re: Singleton
- From: Jens Mühlenhoff
- Singleton
- Prev by Date: Re: Why I use (object) Pascal
- Next by Date: Re: Garbage Collection
- Previous by thread: Re: Singleton
- Next by thread: Re: Singleton
- Index(es):
Relevant Pages
|