Re: Pattern: Static Properties Return Objects

Per Bolmstedt <[email protected]> Wed, 30 Jan 2008 05:50:24 -0500
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <LISTSERV%[email protected]>
On Wed, 30 Jan 2008 12:52:23 +0200, Brady Kelly <[email protected]>
wrote:

>I often have a situation where my info needs progress beyond a simple enum.
>I then create a class, with a private constructor that takes an enum, and
>returns an object representing one of the enum items, but with more data.  I
>expose static getters to construct and return each type of object, so that
>using the class appears as if using an enum.

You mean something like "Encoding.UTF8"? The "Encoding" type has methods,
but in a sense encodings can be thought of as "enums with more data". Do
your objects have state? Can you give an example of what "data" is contained
within your types?

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com