Menu

Architecture related - Struts, SOA, DAO

2004-10-05
2013-04-11
  • Girish varde

    Girish varde - 2004-10-05

    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 users 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

     
    • Brandon Goodin

      Brandon Goodin - 2004-10-07

      PLEASE DO NOT CROSS POST QUESTIONS!

       
      • Kris Jenkins

        Kris Jenkins - 2004-10-07

        ...as people tend to post cross answers.

         
    • Brandon Goodin

      Brandon Goodin - 2004-10-22

      THIS IS A USER SUPPORT QUESTION AND IS NOT RELATED TO THE DEVELOPMENT OF THE IBATIS FRAMEWORK. PLEASE POST ON THE USER SUPPORT FORUM IN THE FUTURE.

       

Log in to post a comment.