[Seaside] Announcement or simple method call (Command Pattern)
stephane.ducasse at free.fr
Mon Jan 14 18:59:04 UTC 2008
On Jan 14, 2008, at 5:03 PM, Sebastian Sastre wrote:
> Hi Oleg,
> I think it depends on who wants to communicate to whom and the
> coupling level you want/need. I'll evade the use of announcements
> loose coupling is not needed. But in the other hand the bigger the
> reuse the bigger the need of loose coupling. Remember that loose
> coupling is
> needed when a children wants to communicate something about it's
> state to
> potential parents or any subscriber without understanding anything
> them. If situation is simpler than that, and you can achieve the same
> feature with a simple message send, so do it. You don't need/want to
> complicate things just for fun.
Thanks for sharing that with us.
We need to record such practices and advices.
> About components that should be disabled, I think you can use a
> request (SURequest) to update the state of that component in the
> side. That way, when the command is called it can announce or not
> on that state which your application (other components for instance)
> silently update it's state using this request.
> Sebastian Sastre
>> -----Mensaje original-----
>> De: seaside-bounces at lists.squeakfoundation.org
>> [mailto:seaside-bounces at lists.squeakfoundation.org] En nombre
>> de Oleg Richards
>> Enviado el: Lunes, 14 de Enero de 2008 06:16
>> Para: seaside at lists.squeakfoundation.org
>> Asunto: [Seaside] Announcement or simple method call (Command
>> Hello Guys!
>> I want to use command pattern in my application and use
>> announcements framework to invoke the same command in the
>> same component from different places. Now it was done using
>> simple method call. How do u think: Should i refactor my
>> application to "command pattern"?
>> I'm afraid of one thing: For example one my component will
>> subscribe to special command. When this component will be
>> visible this is perfect. But what will be done if this
>> component call another one, so it will be not visible, but
>> not destroyed because it will be standing in stack of
>> backtrace. Is it a danger? I dont want him to receive this
>> message, when it is not active. And i also don't want to
>> unsubscribe from event in every call procedure..
>> What do you think?
>> Cheers, Oleg
>> View this message in context:
>> Sent from the Squeak - Seaside mailing list archive at Nabble.com.
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside