Madhawa Learns To Blog : C#, Java

.net, c#, java,sql, OOAD and more mad memory dumps...

  Home  |   Contact  |   Syndication    |   Login
  45 Posts | 0 Stories | 50 Comments | 15 Trackbacks

News

Archives

Post Categories

Blog Roll

Hang Outs

My old blog

Doing some R&D works on GWT a few weeks back, I really fascinated on the Google frameworks. Next Google framework I’m gonna puts my hands on is Guice: Google way of implementing Dependency Injection.  That isn’t a company assignment but I think its worth to learn and try. Guice (pronounced "juice") is an ultra-lightweight, next-generation dependency injection container for Java 5 and later.

If you have ever tried out to achieve loose coupling to the ultimate extent you really should know about dependency injection. It’s not a buzz word anymore. People are using several of methods and frameworks to implement DI. Couple of years back when I was at my good old place (Logical Systems now known as Kandysoft) I did my first application design on my own. It was an e-commerce web site and I got instructions to develop the application framework as generic as possible. So we can re-use some of it functionalities in other applications. Our focus was on product catalog and shopping cart. Some applications product catalog and shopping cart is not separated but I thought it has to be developed as separated. So I did it and it was a very successful one. At that time I actually had heard about DI and use of it to achieve loose coupling. But only article I had read was
Martin fowlers one and I couldn’t understand it much of it at that time. And for the worse case I had limited time frame to complete and deliver the project as we always do. Anyway I gained what I wanted by  using interfaces and now I know I have implemented dependency injection by hand even though I didn’t know  I was doing that.

BTW now there are so many application frameworks that leverage use of DI and some related functionalities. I think spring is in the top. They are hitting both java and .net so it’s a great framework to developers like me who focused on both java and .net.

But if you are new to DI and doing java I think Guice is the best to put your hands on first. Like all Google frameworks it simple and easy to learn. I’ll shed some posts later on DI and Guice.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Saturday, July 14, 2007 7:54 AM

Feedback

# re: Guice: Google way of implementing Dependency Injection aka Inversion of Control 7/20/2007 11:17 PM Mikie Heinsten
True Madhawa... Seems Guice is very simple but powerfull. If you want to use IoC Guice is more than enough. But Spring is a complete framework eventhough its little heavy.

# re: Guice: Google way of implementing Dependency Injection aka Inversion of Control 9/5/2008 9:34 AM Lakshitha
Machan... there is another framework available for similar purpose. actually its a web framework called Apache Tapestry. It has a built in IOC registry and a lightweight one. I found that it's more simpler than Guice. :)

# re: Guice: Google way of implementing Dependency Injection aka Inversion of Control 9/8/2008 5:47 AM Madhawa
Thats great machan. I think you gonna use it right?. BTW as you know now again I'm focussed on .net I'm gonna try Unity, the microsoft flavour in IOC. :)

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: