Sean,
Perhaps I am misunderstanding and solving a different problem.. but it sounds like... **if** all of these instances actually store the date...
Seems to me the Parent instance #date methods should be accessed using simple method accessors of a Magritte Date description. The tricky part of model integrity should be logic of the instances of Parent and not dependent on the Magritte description -- with myriad good reasons to make exceptions. e.g. "I just need to meet the deadline or else i am fired!"
The tricky part, can be solved by either having the parent always push data down (with direct wiring) or registering self as a dependent, or the children as dependents; or the other major option is that of having the children pull it on demand (e.g. ifNil: [ date := parent date]).
-
You probably want simple methods for your parent object that push the date to children.
e.g. define something like...
#updateChildrenStates
self children do: [:child | child date: self date. ... ]
Whether you use #changed/#update/dependency-management or announcements, or "direct wiring" with this approach is up to you.
If using #changed you would do something like this (as well as register self as a dependent):
Parent >>date: aDate
date := aDate asDate.
self changed: #date.
and Parent >>
#update: aSymbol
self updateChildrenStates
*if* the child is registered as a dependent but has no handle to the parent, implement:
Parent >>
update: aSymbol with: anObject
aSymbol == #date ifTrue: [ self date: anObject date ].
-
Or, if using "direct wiring"
Parent >> date: aDate
date := aDate asDate.
self updateChildrenStates. "or more specifically self updateChildrenDates"
--
If on the other hand, the children are pulling, then they need a handle on the parent to query lazily.
Good luck!
Cam