2

I am looking for a dependency injection framework for a Java SE (Swing) application that runs under JDK 1.4. Are there any recommended DI frameworks that I can use? (Guice and other annotation-based frameworks are out, and I don't want to mess with something like Retroweaver.)

Also, is Spring suitable for use in a Java SE application?

edit: this is a legacy application (which is why it's jdk 1.4) - I want to use spring to get some sanity into the ball of mud

Ken Liu
  • 22,503
  • 19
  • 75
  • 98
  • You can introduce a DI framework like Spring into your app, but you can't move up from Java 1.4 (end-of-lifed by SUN, by the way)? With any significant code base it would be a lot of work to retrofit a DI framework. Are the potential benefits worth the cost? – SteveD Aug 14 '09 at 14:04
  • Well, that's what I'm exploring. It wouldn't require a total retrofit, would it? Couldn't I just start by injecting a few dependencies at a time? There are some significant technical barriers (deployment issues) that are keeping the app on 1.4. – Ken Liu Aug 14 '09 at 20:26
  • @hbunny, for some mainframe installations you get 1.4 only, and it is very tedious to have any other versions installed. – Thorbjørn Ravn Andersen Jan 03 '11 at 11:30

1 Answers1

3

yes, it is. There is even a whole project called Spring Rich Client:

Spring-RCP's mission is to provide an elegant way to build highly-configurable, GUI-standards-following rich-client applications faster by leveraging the Spring Framework, and a rich library of UI factories and support classes.

dfa
  • 114,442
  • 31
  • 189
  • 228
  • 1
    On their site, under FAQ: "Can I use the project under java 1.4? No, as of 1.1.0 the codebase can only be run on 1.5+ JVM environments. " – amischiefr Aug 13 '09 at 19:59
  • not so much interested in rcp, I'm working on a legacy app. I see now that Spring 3.0 requires Java 5. Spring's web site is pretty, but not terribly informative. – Ken Liu Aug 13 '09 at 23:50