[Seaside] Re: SU - insert, remove, hide, show
smalltalk at fixinsbar.com
smalltalk at fixinsbar.com
Thu Dec 6 19:58:45 UTC 2007
>> > XComponent>>
>> > addXAndRenderOn: r on: selector of: obj
>> > "make change by adding one X to domain model, re-paint just the new X"
>>
>> In particular, this appears to work but feels very unclean - combining
>> domain model change with UI change.
>
I don't know 100% what you are doing, but here are some ideas:
If you want to abstract things a little bit, you could always do
something like raise an event that another class is listening for.
This is generally what I did when I used MVP in other languages,
albeit I don't do that in seaside so far.
For example, user clicks a button to add an X. From the view class, I
might raise an add event with x as the data in the event args. The
presenter would update the model with the data from the event without
any knowledge of how the view was dealing with the x. Meanwhile, I
could raise an event back to the view to update itself, or depending
on whether or not you are using passive MVP, I could call a method
instead.
The observer pattern can also be used in these situations.
More information about the seaside
mailing list