P
peter.moss
Need some help!
I have a nested collection like so:
Grandparent
.Parent
.Child
Which is going to be bound to a datagrid in a flat view:
Grandparent1 | Parent1 | Child1
Grandparent1 | Parent1 | Child2
Grandparent1 | Parent2 | Child3
Grandparent1 | Parent2 | Child4
Grandparent2 | Parent3 | Child5
Grandparent2 | Parent4 | Child6
I was going to make a facade collection which takes grandparent
collection and generates a set of flat objects. These objects would
expose properties which would pass values to the appropriate wrapped
object (GrandParentName = GrandParent.Name, ParentName = Parent.Name
etc.). The facade/manager would have Add(), Remove() methods with
behaviour to ensure the integrity of the underlying collection.
Does this make sense or does anyone else have a better pattern? How
does one handle the persistance of the object (ActiveRecord type
thing)?
Advice welcomed very much!
I have a nested collection like so:
Grandparent
.Parent
.Child
Which is going to be bound to a datagrid in a flat view:
Grandparent1 | Parent1 | Child1
Grandparent1 | Parent1 | Child2
Grandparent1 | Parent2 | Child3
Grandparent1 | Parent2 | Child4
Grandparent2 | Parent3 | Child5
Grandparent2 | Parent4 | Child6
I was going to make a facade collection which takes grandparent
collection and generates a set of flat objects. These objects would
expose properties which would pass values to the appropriate wrapped
object (GrandParentName = GrandParent.Name, ParentName = Parent.Name
etc.). The facade/manager would have Add(), Remove() methods with
behaviour to ensure the integrity of the underlying collection.
Does this make sense or does anyone else have a better pattern? How
does one handle the persistance of the object (ActiveRecord type
thing)?
Advice welcomed very much!