Re: Child objects inheriting property values
Phil Sayers <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
Do Ambient Properties help here? I'm not sure, but it's a good google keyword for you. :-D -----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 5:10 AM To: [email protected] Subject: [DOTNET-CLR] Child objects inheriting property values 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. 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