• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Phased implementation

 
Ranch Hand
Posts: 54
Clojure Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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?
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic