FROM : Sam Colombo
DATE : Sun Apr 29 05:09:46 2007
This question relates to bindings and a hierarchy of lists, each level
of which may have different properties. We have done all this once before,
the hard way in C++, and are trying to see what we could do in Cocoa. We
have been looking at MailDemo, available on the web, and wondered if the
following would make sense. We have a hierarchy of objects, each having a
list of lower-level objects, i.e.:
Course -> Session -> Segment -> Scene -> Shot -> Layer -> Shape ->
ContentProperties
Does it make sense, a la MailDemo, to subclass these from a common class
having only two instance variables, i.e., an (NSMutableArray*)sublist and an
(NSMutableDictionary*)properties, the latter of which would be individually
initialized with all the keyed properties associated with the particular
subclass? Or maybe even just use one class with individual initializers?
This would be in lieu of defining individual instance variables and
accessors. Is there a downside to this approach?
We also have a set of tabbed views, each containing a table that
displays properties corresponding to one of the above levels. In addition,
we would like to have an alternative tree view of the full structure. Each
individual level would have its own NSArrayController subclass and I assume
there would be one NSTreeController subclass.
DATE : Sun Apr 29 05:09:46 2007
This question relates to bindings and a hierarchy of lists, each level
of which may have different properties. We have done all this once before,
the hard way in C++, and are trying to see what we could do in Cocoa. We
have been looking at MailDemo, available on the web, and wondered if the
following would make sense. We have a hierarchy of objects, each having a
list of lower-level objects, i.e.:
Course -> Session -> Segment -> Scene -> Shot -> Layer -> Shape ->
ContentProperties
Does it make sense, a la MailDemo, to subclass these from a common class
having only two instance variables, i.e., an (NSMutableArray*)sublist and an
(NSMutableDictionary*)properties, the latter of which would be individually
initialized with all the keyed properties associated with the particular
subclass? Or maybe even just use one class with individual initializers?
This would be in lieu of defining individual instance variables and
accessors. Is there a downside to this approach?
We also have a set of tabbed views, each containing a table that
displays properties corresponding to one of the above levels. In addition,
we would like to have an alternative tree view of the full structure. Each
individual level would have its own NSArrayController subclass and I assume
there would be one NSTreeController subclass.
| Related mails | Author | Date |
|---|---|---|
| Sam Colombo | Apr 29, 05:09 | |
| Matt Neuburg | Apr 30, 01:58 | |
| Sam Colombo | Apr 30, 03:39 | |
| Lars von Wedel | Apr 30, 08:59 |






Cocoa mail archive

