Re: Pattern: Static Properties Return Objects
Mike Andrews <[email protected]> Thu, 31 Jan 2008 07:20:53 -0600
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
I tend to the side of inheritance simply because your requirements may change and DetailLines may need some new functionality or new feature that HeaderLines does not or vise versa. It makes sense then to now, even if it's nothing more than an empty class declaration, create those classes and utilize a DetailLines and HeaderLines instead of a LineList so that lots of time needs to be spent later refactoring your code. If you don't foresee that or think it would happen then I see no reason to do so. On Jan 31, 2008 2:32 AM, Brady Kelly <[email protected]> wrote: > My design has morphed a bit, and I now use a sort of factory pattern to > build 'shaped' objects, where I have several LineList objects, 'shaped' > for > different purposes, such as > > LineList headerLines; > LineList detailLines; > > etc. I realise there is an opportunity for extending LineList into > HeaderLineList and DetailLineList, but I believe the differences don't > warrant introducing inheritance. What are your opinions on this approach > vs. inheritance? > > > If you mean something like an extended version behavior implemented by > > Color.Red this is sometimes refered to as the "descriptor pattern". > > > > regards, > > Daniel > > =================================== > This list is hosted by DevelopMentor(R) http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com