Hi,
I have been using Spring DI and IOC extensively in my earlier projects. As per a new project requirement, we have to setup our projects as follows :
Business project (
Java project)
Common project ( Java project)
Presentation project (Web project)
Business and presentation communicates/uses the common layer. However, the business and presentation are to be deployed in different app servers, and the communication between business and presentation is not http based. Presentation invokes the business through iiop protocol. That means, the protocol switching happens, while calling business (Java project) from presentation (web project).
In Business project, I am planning to encapsulate all business logic methods, and DAO methods in a facade object, using SPRING dependency Injection feature and normal OOPS technique. Then, I can expose the facade object using
EJB, from the presentation layer, I invoke the ejb and get the facade object from business layer.
My only concern is, where to load the spring context xml, in the business layer ? In the presentation layer, I am pretty sure of the loading, where I can use web.xml and my base action class (in
struts) to load the spring context xml using WebapplicationContext. However, in the business layer, which class is the best place where I can invoke/load my spring context and initialize the Spring IOC container ? Is there any provision that can be applied in the app server level ? (currently I am using Web sphere app server) Any help in this topic is highly appreciated.
Thanking you,
Jitendriya Dash
Java/J2EE developer, Mumbai.