The Artima Developer Community
Sponsored Link

Java Buzz Forum
EasyContainer - a simple wrapper

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jeremy Rayner

Posts: 111
Nickname: j6wbs
Registered: Sep, 2003

jez codes stuff
EasyContainer - a simple wrapper Posted: Feb 17, 2004 8:18 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Jeremy Rayner.
Original Post: EasyContainer - a simple wrapper
Feed Title: javanicus
Feed URL: http://www.javanicus.com/blog2/subjects/java-rss.xml
Feed Description: Jeremy Rayner on java and other stuff.
Latest Java Buzz Posts
Latest Java Buzz Posts by Jeremy Rayner
Latest Posts From javanicus

Advertisement
All this PicoContainer stuff reminds me of the excellent article from DrDobbs Journal a couple of years ago called new Considered Harmful [ <-- good read]

With my foray into the Pico stuff, I thought it would be a good idea to simplify (for my lazy benefit) the bit that is basically doing the 'new', or the 'instatiation management' or some other term... that you can find at the core of any Type3 IoC framework.

I've put together a little wrapper around pico to start with, and possibly other containers that provide 'instatiation management', and at joe's suggestion (and fear of hecklers) I'll share the source to you lot to play with.

This wrapper is not breaking new ground, in fact is only putting simple method names round existing methods in pico, and removing the knowledge of container from your code (for the simple stuff). But it has got me thinking about the general case of 'instatiation management' as a replacement for new, and my next wander around the javaverse could include looking into The Java Syntactic Extender to provide a new syntax for making this as easy to use as new (irrespective of container)

JavaDocs,source code, and the prebuilt easy.jar

EasyContainer pico = new EasyContainer(new DefaultPicoContainer());
pico.reg(Boy.class);
pico.reg(Girl.class);
Girl girl = (Girl)pico.get(Girl.class);

Any thoughts...
P.S. My own critic inside says "Oh my god, he's written commons-logging generic wrapper equivalent for type3 containers" - but I might as well publish this anyways ;-)

Read: EasyContainer - a simple wrapper

Topic: My overview of EclipseCON Previous Topic   Next Topic Topic: My Dream application finally arrives

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use