| Author |
Architecture related - Struts, SOA, DAO
|
Girish Varde
Greenhorn
Joined: Jul 09, 2004
Posts: 23
|
|
Hello all. I have some architecture level problem in my application. I describe in detail here. Guys with Jsp- Struts, Dao(Ibatis) experience can understand an help me. I use SOA i.e. Service Oriented Architecture along with DAO in my current web application in Jsp-Struts. When user requests a page, in Struts� action class, appropriate service is called. The serviceImpl class during its construction, loads properties file. The code for this is public DefaultServiceImpl() { super(); try { Properties props = new Properties(); props.load(Resources.getResourceAsStream("properties/dailystatus.properties")); String resource = "properties/dao.xml"; Reader reader = Resources.getResourceAsReader(resource); DaoManager.configure(reader); } catch(Exception e) { throw new RuntimeException("Could not initiate service. Cause: " + e); } } My Services extend this class. Since session object is not available (though application is available because of ServiceFactory class used in action) in this class, there is no way to change the properties file dynamically in action class, depending on user�s choice. The root of this problem is here. The application was developed for one department using one database. Now, three different departments are proposed to use the same application without changing code but just changing database when dept is changed. In short, I want to dynamically set properties file in the above constructer. Reply for further explanation. Thanks in advance for helping me. Girish Varde
|
 |
 |
|
|
subject: Architecture related - Struts, SOA, DAO
|
|
|