views:

69

answers:

3

I wrote a piece of java code using threads, JDBC, Java Mail API etc. without using any of the frameworks (read Spring). I am frankly not too comfortable learning them first (lots of terminologies to remember!) and use them. So, please suggest me some ways to refine my existing code incorporating few of these framework concepts applicable to the aforementioned things without having to learn a lot about them. Is there any quick way to learn some vital framework concepts and use it.. sounds certainly foolish, but still looking for somebody's experiences :)

A: 

I am not one of those people that can read a book and understand (although, I certainly wish I was that type). I have to learn by doing so I suggest installing an IDE that supports the framework you want to learn and do the tutorials or build something that you can use personally. Couple that with some books/internet for reference and guidance. Good luck!

northpole
Thank you northpole
Singaram Subramanian
+1  A: 

for your simple stuff i dont really see a value add of using framework. u could replace the thread handling with the Java 5 Executors though. And if you want IoC/dependency injection then look into Google Guice

Pangea
Guice is just as much a framework as Spring is. I don't see what makes it more acceptable.
duffymo
Guice is just for dependency injection and extremely lightweight. Spring on the other hand is (after years of development) a monster.
Willi
Thank you Pangea..
Singaram Subramanian
+3  A: 

If you aren't interested in frameworks, your code should at least use interfaces and layering that's appropriate. Your app will be well-layered if you have interfaces for services and repositories whether you use a framework or not.

You should have a front controller servlet that accepts all requests.

You should bind and validate all requests prior to processing in the service tier.

The services should be completely separate from your web tier. If you can't unbolt the web UI and have the rest of the stuff work, you're doing it wrong.

duffymo
Thanks Duffymo!
Singaram Subramanian