Results 1 to 2 of 2

Thread: Refactoring an existing infrastructure to use Spring

  1. #1

    Default Refactoring an existing infrastructure to use Spring

    I'm about to introduce Spring into our existing framework, of which there's a lot of existing code. This already does a lot of IoC type stuff, but with dependency lookup, instead of injection. The aim of the game is to bit-by-bit replace our own IoC with Spring's, leveraging the dependency injection.

    What's the best approach to using Spring bean factories and the assoicated resources in a legacy framework? Holding references to factories seems to be the main issue.

    Despite the warnings in the JavaDoc, the best approach seems to be to use SingletonBeanFactoryLocator. Our app consists of lots of modules, with a strictly-defined dependency hierarchy. By using SingletonBeanFactoryLocator as the access point for components created from Spring resources, this seems to give the best way of associate disparate beans.xml config files between modules that may depend on each other.

    Unless there's another way?

  2. #2
    Join Date
    Aug 2004
    Location
    Auburn, AL, USA.
    Posts
    106

    Default

    You might also want to look at the ApplicationContextAware interface which would allow select object's to get a reference to the context, and pull Beans from it.

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 3
    Last Post: Jul 20th, 2005, 09:41 PM
  3. Replies: 1
    Last Post: May 4th, 2005, 02:43 PM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 16
    Last Post: Nov 19th, 2004, 09:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •