SwiXML - Abstracting Action Linking

Don Brown <[email protected]>
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
While I appreciate the simplicity of linking Actions to member variables,
there are cases where that might not be appropriate.  For example, I'm
working on gui where the actions are supplied by different plugins and
components.  I'd like to wire the gui to those pre-instantiated Actions.

The solution I believe is to abstract the action linking code into an
interface named ActionLinker (or whatever).  The parser can then use this
interface to link the action to the gui.  The default implemention, of
course, will be the current method, however, upon instantiating the
SwingEngine but before parsing the XML, the host code could pass an
alternate implemention of ActionLinker via setActionLinker.

Speaking of abstraction, another target is the instantiations of the
plugins (great feature, btw).  I've found the Spring IoC framework very
useful and would like to use it to handle the creation of my swixml
plugins.  Could that code also be extracted into some sort of Factory?

As for implementation, I would be happy to write up the proposed code and
submit patches.  I couldn't find the swixml cvs, so I'll make them against
rc2 build 132.

Comments welcome.

Don
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.