I have a jar which contains all my core functionalities and a set of boundary interfaces that should allow the core to be used by different delivery systems such as web, console, etc.
Now say I want to use Struts2 in a separate project as the delivery system. Where should I place all the wirings needed by the core to be working properly?
I am doing all the wirings inside the main() method of the core app (I decide at that time what implementations of the interfaces used around the application should be used), but using an external project, where should I place all the wirings?
Thanks!
Roberto
Normally wiring is handled “automagically” through bean definitions in the S2 config files (this is how S2 wires itself up with its old Guice-y core) if you’re not using Spring, or via the normal Spring configuration methods (files and/or annotations).
If you really want to do it in Java, I’m not actually sure where the best place would be, or if it’d really be worth it. Why (and when) you want to do it in Java might help determine where to do it in Java.