1
vote
Vote UpVote

Oxygene by Example – Singleton

RemObjects Blogs – This is the first item in my series “Oxygene by Example”, this time about singletons. Singleton classes are used when there’s only ever one instance of a class needed. They differ from Static Classes in that they have an actual instance, can implement an interface and you can use them as parameters to a method. There are different ways of writing singletons, but the easiest way is by using a readonly class variable: type IObjectCache = interface method GetOrCreate(aName: string; aNeedNewValue: Func): T; end; GlobalObjectCache = class(IObjectCache) ...
Favorite? Off-Topic? Carlo Kok @ 2011-12-16 20:15

Statistics

Visits: 475
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

jamiei
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)