• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Phased implementation

 
Ranch Hand
Posts: 54
Clojure Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I work on a team that maintains a big web app based on java and Struts 1. We would like to "try" Spring. Do you think it's a useful approach to select a couple of DAO's and rework them with dependency injection, as a way of proving the concept to our manager, and developing confidence?
 
Ranch Hand
Posts: 349
Hibernate Eclipse IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Taking couple of DAOs


Do you mean to say that you are planning only to use Spring for transaction handling and for the data access layer?

To integrate your Struts application with Spring, you have two options:

  • Configure Spring to manage your Actions as beans, using the ContextLoaderPlugin, and set their dependencies in a Spring context file.
  • Subclass Spring's ActionSupport classes and grab your Spring-managed beans explicitly using a getWebApplicationContext() method.

  • We follow the first approach.
     
    Rick Goff
    Ranch Hand
    Posts: 54
    Clojure Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Ananth Chellathurai wrote:

    Taking couple of DAOs


    Do you mean to say that you are planning only to use Spring for transaction handling and for the data access layer?

    To integrate your Struts application with Spring, you have two options:

  • Configure Spring to manage your Actions as beans, using the ContextLoaderPlugin, and set their dependencies in a Spring context file.
  • Subclass Spring's ActionSupport classes and grab your Spring-managed beans explicitly using a getWebApplicationContext() method.

  • We follow the first approach.



    Thanks for the quick reply! Yes, we have in mind the first option. I haven't had any exposure to Spring, except in reading *about* it, but my teammate who used it on another project tells me that we can use an applicationContext.xml file to define services, which refer to DAO methods. We annotate our Action classes that have traditionally instantiated a DAO individually and participated in Connection Pool sharing such that "Spring handles the connections." Does that sound right?
     
    Attractive, successful people love this tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!