Design idea

Boudewijn Rempt boud at calcifer.valdyas.org
Tue Feb 10 12:48:42 CET 2004


On Tue, 10 Feb 2004, Patrick Julien wrote:

> I think you are using the wrong design pattern.  Please, allow me this humble
> suggestion: the mediator design pattern.

No need for humble -- you're the architect here :-).
>
> So, you have a director (the mediator) that sits between the colleagues
> (whatever class spawned the dialog and the concrete dialog).
>
> If I reuse the example given, the director has access to the internals of
> core, it can build a map of strings to composite ops.  It then passes the
> strings to the dialog.  When a selection occurs, the dialog emits the
> selection using the original string.  The mediator matches the string to the
> composite operation using it's map.  The mediator then passes the composite
> operation to whoever wanted it.  Or simply, on return of the dialog, etc.
>

Okay, that sounds good -- give a lot more decoupling between ui and core.
I'm going to try that tonight, I think.

-- 
Boudewijn Rempt | http://www.valdyas.org/fading/index.cgi



More information about the kimageshop mailing list