Simon Martinelli is founder of simas GmbH and works as an independent Java EE consultant, architect, developer and trainer in Switzerland. Additionally he is a lecturer for Java EE architecture and design and Java Persistence API at Berne University of Applied Sciences. He is expert group member of JSR 352 Batch Applications for the Java Platform and JSR 354 Money and Currency API. Furthermore he is member of the board of Java User Group Switzerland and helps organizing events. Simon has posted 5 posts at DZone. You can read more from them at their website. View Full User Profile

simject: Simple Dependency Injection

  • submit to reddit
During my private studies on dependency injection (DI), dynamic proxy, remoting, Maven2 and JPA I started to create a small very simple dependency injection framework with some basic features.

It's not as powerful as Spring or similar frameworks but it helps me in my every day work, where I don't have a Java EE Server available.

I decided to make it available for every one - maybe someone can use it. Have a look:

logo.png3.56 KB
Published at DZone with permission of its author, Simon Martinelli.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


William Jaynes replied on Fri, 2008/08/15 - 5:40am

Spring can be used perfectly well in any Java application, in or out of JEE.

Robbie Vanbrabant replied on Fri, 2008/08/15 - 6:49am

Why not simply use and extend Guice? Externalized object wiring is highly overrated and usually not needed.

Simon Martinelli replied on Fri, 2008/08/15 - 9:06am in response to: William Jaynes

Hi William,

For sure Spring can do everything. The main purpose of simject is to keep it simple and to have a very small library.

Simon Martinelli replied on Fri, 2008/08/15 - 9:09am in response to: Robbie Vanbrabant

Hi Robbie,

I only wanted to use Java SE Standard like the @Ressource annotation and the configuration should be external (e.g XML). That's why don't took Guice.

Regards, Simon

Peter Karussell replied on Sun, 2008/08/17 - 6:03am

[quote] I only wanted to use Java SE Standard like the @Ressource annotation and the configuration should be external (e.g XML).[/quote]

Why not picocontainer? (with nanocontainer)

Simon Martinelli replied on Sun, 2008/08/17 - 3:15pm

Hi Peter,

I don't want to compete against PicoContainer or SpringFramework because they provide a lot more features than simject does. simject is a product of my private studies and I wanted to make it very simple.

But again if one is looking for simple dependecy injection with remoting and JPA support, let's try simject!

Regards, Simon

James Ervin replied on Tue, 2008/08/19 - 3:06pm

I have to ask... how about OSGi?

Simon Martinelli replied on Wed, 2008/08/20 - 2:55am in response to: James Ervin

OSGi is a great concept with dynamic component loading and versioning support.

simject does not address these features because I want to keep it extremly simple. It only provides simple dependency injection.

If you need all the OSGi features there are greate OSGi implementation like Equinox, Knopflerfish etc.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.