=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm currently exploring different ideas for integrating SwiXML and Spring. =
=20
One such idea is to extend SwiXML's SwingEngine class to implement the=20
BeanFactory interface, which I've already done. This works fairly well=20
conceptually, because SwiXML is very much like an IoC container: it can=20
create Swing controls, inject actions into them, and inject the controls in=
to=20
other controls.
I would like to use SwiXML to build my GUI, and Spring to configure and def=
ine=20
the behavior of the GUI. What I would love to do is define (instantiate) t=
he=20
control in the SwiXML config, and configure it in the Spring config. Is th=
is=20
possible?
Here is an example. Say I have this SwiXML configuration (borrowed from=20
SwiXML docs):
<frame>
<panel background=3D"6699cc" constraints=3D"BorderLayout.CENTER">
<label text=3D"Hello Swinglet"/>
<button name=3D"okButton" text=3D"OK" tooltiptext=3D"Press OK"/>
</panel>
</frame>
Notice that I've named the button "okButton", which will make it appear in =
the=20
SwiXML BeanFactory as a bean with the id of "okButton". Now, it would be=20
nice to wire that control with some behavior in Spring. Maybe something=20
like:
<bean ref=3D"okButton">
<!-- Set properties here -->
</bean>
This also lends itself to a clean separation of concerns. A GUI designer c=
an=20
design the GUI without worrying about behavior, while a developer can wire=
=20
the GUI to his business logic.
Of course, there might be a better approach to this whole problem. I'm ope=
n=20
to suggestions.
- Andy
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD4DBQFApQdGdgQy3TUmt38RAn/eAJwM8VlaHuh8jW72SMMAdEr1lNKI0gCYnkuV
=46RBk73uii4x6hzMjrHZTDg=3D=3D
=3D7Bqk
=2D----END PGP SIGNATURE-----
|