hi all;
we have a GUI built with flex using cairngorm microarchitechture.
the GUI is quite complex, and there is an xml schema (xsd) that
represents the VO structure.
We prepared a code generator(using AIR) which parses the xsd and creates
vo's,commanders,events,model&frontcontroller, so we just handcode the
view. (Vo's are serializable to XML and deserializable from XML , all
auto generated -sth like jaxb of java- )
the GUI was good for version1 but the XSD had to change a lot and we had
to insert hand written code into commaders and we started to have
performance issues.
now there is a new XSD, GUI will be recreated and we want to upgrade our
code generator to support the changes (more clever commanders & more
specific events!); so here comes my design question :
every class has it's own commander. and sometimes, when an event is
being executed, another commander should also work(sth more must be
done), and there is a specific event for that operation too.
(e.g. deletion of an instance of class A requires the update of the
instances of class B )
in this situation,
1 should commanderA dispatch an event to update class B instance
or
2 should commanderA call commanderB's execute function with the
needed event as argument
or
3 should commarderA edit B vo's . (we don't prefer this cuz it
violates the generic style of our code & cairngorm)
the second option is more efficient since it does not need to dispatch
the event and wait for it to be caught; but we wonder whether it
violates the cairngorm design pattern rules.
this is a really important project, so we'll be very pleased by taking
your comments.