Re: Child objects inheriting property values
Phil Sayers <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
have you used rotor or refelctor on the "DataTable" classes... I'm pretty sure that a DataColumn/DataTable support the concept of a "Default Value" for a column, that is then "picked up" when a new DataRow is added to the datatable. -----Original Message----- From: Discussion of development on the .NET platform using any managed language [mailto:[email protected]]On Behalf Of Brady Kelly Sent: Tuesday, November 20, 2007 10:06 AM To: [email protected] Subject: Re: [DOTNET-CLR] Child objects inheriting property values So I initially only store a parent reference and a null local value, and if the local value is set, I use that, and if not I use the parent reference to access the 'default' value. Seems doable. > -----Original Message----- > From: Discussion of development on the .NET platform using any managed > language [mailto:[email protected]] On Behalf Of Richard > Blewett > Sent: 20 November 2007 04:06 PM > To: [email protected] > Subject: Re: [DOTNET-CLR] Child objects inheriting property values > > I guess you really want 2) here as you stated you wanted the column to > have > the same value as the record unless it was set specifically which means > it > should reflect the record value even if the record has been changed. > > Regards > > Richard Blewett - DevelopMentor > > > -----Original Message----- > > From: Discussion of development on the .NET platform using any > managed > > language [mailto:[email protected]] On Behalf Of Mike > > Andrews > > Sent: 20 November 2007 13:51 > > To: [email protected] > > Subject: Re: [DOTNET-CLR] Child objects inheriting property values > > > > I've done either one of two things in that instance: > > > > 1) Have the value set as a constructor parameter on the Column > object. > > 2) Have the Record object passed as a constructor parameter and a > > reference > > stored. > > > > It just depends on the design goal and what you want to achieve. > > > > On Nov 20, 2007 4:09 AM, Brady Kelly <[email protected]> > wrote: > > > > > I have a hierarchy of objects that share some attributes, e.g. both > > my > > > parent Record and Column objects have a columnDelimiter property. > I > > want > > > this property on the Column object to default to the same property > on > > the > > > Record object, until specified on the Column object. What is the > > best way > > > to go about this? I could give each Column a reference to the > Record > > it > > > belongs to, but this seems not quite right to me. My other option > is > > to > > > have the Record act as a ColumnFactory, setting the columnDelimiter > > value > > > on > > > each Column it creates, until a set accessor on Column optionally > > > overrides > > > that default value. > > > > > > > > > =================================== > > > 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 DevelopMentorR 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 =================================== This list is hosted by DevelopMentor. 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