Hi Helene,
Right, an instance variable holding the model is definitely needed.
Like this you can change the model to whatever model instance you
like.
For example, if you want to let your user manage multiple todo-lists
or if you support multiple users with different todo-lists you can
instantiate the component with the right model. In both of these
use-cases you would need additional components that handle the login
or todo-list selection. And these components would then set the right
model of ToDoListView.
To make ToDoListView also work if it is used as the root component (as
in the book) you might want to use lazy initialization of the model
while also allowing the advance use-case (for later):
ToDoListView>>model: aTodoList
model := aTodoList
ToDoListView>>model
^ model ifNil: [ model := ToDoList default ]
Hope this makes sense?
Cheers,
Lukas
On 19 December 2011 12:31, Helene Bilbo
<
[hidden email]> wrote:
--
Lukas Renggli
www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside