You may have just gone over my head. As I said earlier, I've not done
anyMG:Flex -- and in fact I was basing my answers on the XML
architecture for
MG:CF.
It looks like your example is the equivalent of the onApplicationStart,
onSessionStart, etc events in MG:CF.

For me, the biggest "problem" I see is that you're _not_ broadcasting a
message that says, "I need X piece of data" or "I need to check if the user
is logged in" -- you _are_ broadcasting "I'm running `Foo` event" and the
various controllers are configured to run for the given event.

As I understand the MVC pattern, the idea is that controllers know what they
can do and listen for someone asking for those things to be done -- it's all
about the business logic. Instead, the organization you're proposing...

(which, for the record, exists in MG:CF too; probably to maintain convention
for people used to using onApplicationStart/etc in Application.cfc, now they
just listen for the onApplicationStart message to be broadcast)

... is that the controller knows which events exist and which functions to
run. In doing so, you're giving up the separation between view and
controller, and you might as well instantiate and use your model objects
right from the view.

>From a coding standpoint, the problem with that organization is that when
you add a new event that needs to use some existing business logic, not only
do you have to write the event configuration, but now you also have to go
back and update the various controllers to respond to that event. In "my"
proposed organization, you just write the event configuration and broadcast
the message corresponding to the business logic you want to use, and there
is no need to update controller configuration.

Hopefully MG:Flex bears enough of a resemblance to MG:CF that I'm not making
a total ass out of myself, here. If it doesn't, and I am, then I'll just
recuse myself from the conversation and let someone who understands it
better respond. ;)

Adam


On Tue, Feb 10, 2009 at 5:02 AM, Tom Chiverton <[email protected]>wrote:

>
> 2009/2/10 Adam Tuttle <[email protected]>:
> > Tom, that would in theory necessitate multiple listener lines for the
> same
> > function in the same controller if it was needed for different events.
>
> Hmm, no, here's a concreate example, where the main view does
>
>        new ModelGlueEvent(EventHandlers.applicationStart).dispatch();
>
> And multiple Command's need to do things:
>
> <control:DataController id="dataController">
>                <control:messageListeners>
>                        <MessageListener
> message="{MessageBroadcasts.applicationStart}"
> method="{dataController.refresh}" />
> .
> .
> .
>        <control:IconStateController id="iconStateController">
>                <control:messageListeners>
>                        <MessageListener
> message="{MessageBroadcasts.applicationStart}"
> method="{iconStateController.setInitialState}" />
>
> > Hopefully this illustrates that you're adding extra work (which may be
> part
> > of why you're frustrated with the repetitiveness of it?) via extra lines
> of
> > XML.
>
> How would you construct the above ?
>
> > Clear as mud, right?
>
> Think of me as a recovering Cairngorm addict if it helps :-)
>
> --
> Tom
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

For more about Model-Glue, check http://www.model-glue.com .
-~----------~----~----~----~------~----~------~--~---

Reply via email to