Sep 21, 2010
I think (?) this is about object design, and perhaps about structural and/or creational patterns. But a bit hard to say when I only know a couple of patterns yet.[code]But... what if we INSTEAD want each Product instance only to (in some way) refer to one instance of a specific list of Components. So we wan't to save the products list to one file, and the components list to another file. Then would I build the objects the same way, or different? So let's then say we have now Class B as below. [code]
View 4 Replies
1. Will not need to update each component variable of the products list when the components list changes.
2. If the Product object shall be shown in a DataGridView, for editing properties, it seems easier to implement the selection of the component property.
Is this wrong approach? Is it suitable in some cases, and if so, when? Are there other solutions I perhaps am not aware of that would be appropriate? Is this about structural design patterns? and if so, can the alternatives above be catagorized to some pattern type? I don't really know exactly what I'm looking for.. But I think probably I'm looking to understand whether the object design will be determined by the way the objects are saved.. And if i shall save the objects by serializing to file, vs saving to a database, would I create the business objects differently?