[Seaside] Announcement or simple method call (Command Pattern)

Sebastian Sastre ssastre at seaswork.com
Mon Jan 14 16:03:09 UTC 2008


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 where
loose coupling is not needed. But in the other hand the bigger the component
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 about
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.

	About components that should be disabled, I think you can use a
request (SURequest) to update the state of that component in the server
side. That way, when the command is called it can announce or not depending
on that state which your application (other components for instance) can
silently update it's state using this request.

	cheers,

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 Pattern)
> 
> 
> 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: 
> http://www.nabble.com/Announcement-or-simple-method-call-%28Co
mmand-Pattern%29-tp14796959p14796959.html
> Sent from the Squeak - Seaside mailing list archive at Nabble.com.
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list