You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Option 1 – Accessor-based, never assign model anywhere else.
BaseControllersubclass:#AccessorControllerslots: { #model }
AccessorController>>model: aModel
model ifNotNil: [ selfunsubscribeFrom: model ].
model := aModel.
model ifNotNil: [ selfsubscribeTo: model ]
Option 2 – Slot-based, model can be assigned anywhere
BaseControllersubclass:#SlotControllerslots: { #model=>SubscribedSlot }
SlotController>>model: aModel
model := aModel
InstanceVariableSlotsubclass:#SubscribedSlotSubscribedSlot>>write: aNewModel to: aController
(selfread: aController) ifNotNil: [ :m | aController unsubscribeFrom: m ].
superwrite: aNewModel to: aController.
(selfread: aController) ifNotNil: [ :m | aController subscribeTo: m ].