aspose file tools*
The moose likes Spring and the fly likes Spring Modules Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Modules" Watch "Spring Modules" New topic
Author

Spring Modules

Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi All,

I am currently trying to learn spring so I bought books regarding this topic. (Spring Recipes and Pro Spring)

But as I was progressing, it seems that there was topics related to Aspect Oriented Programming/Transaction Management.

My goal is only to learn how to do web program using Spring MVC. Is it a requirement that I learn also that modules in order to progress?
I know that I need to know, Bean Configuration and IOC implementation of spring. JDBC Template also is a must I think.

Another question also is about annotations, is it ok if I just skip annotations? I havent tried annotations also so I am not sure if its worth investing time
on it. Based on the books, annotation is just another way of doing things in spring.


Thanks to future advise.


Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17256
    
    6

Personal Opinion, so take it with a grain of salt.

1) I use Annotations over xml.
2) AOP/Transactions is part of Core Spring, so it isn't an add on module. A lot of what happens in Spring is because of AOP.
3) If you don't want to use JDBC, which I don't, then JdbcTemplate is just a nice to know. ;)
The main problem I have with JDBC is that you end up designing your domain classes flattened to work with JDBC. Meaning attributes in one class that comes from a parent or worse child record. And your domain objects are no longer good OO design. No associations in classes happen, and you end up having attributes that are int ids to Foreign Key tables. You also end up designing your Apis with int String parameters instead of a cleaner api with your domain objects being passed around.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Mark Spritzler wrote:
The main problem I have with JDBC is that you end up designing your domain classes flattened to work with JDBC. Meaning attributes in one class that comes from a parent or worse child record. And your domain objects are no longer good OO design. No associations in classes happen, and you end up having attributes that are int ids to Foreign Key tables. You also end up designing your Apis with int String parameters instead of a cleaner api with your domain objects being passed around.

Even if using JDBC we can use connected object model. It's only a matter of mapping result set to objects. But it's pain to do it manually, I would recommend to use iBATIS Data Mapper framework instead.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17256
    
    6

Kengkaj Sathianpantarit wrote:
Mark Spritzler wrote:
The main problem I have with JDBC is that you end up designing your domain classes flattened to work with JDBC. Meaning attributes in one class that comes from a parent or worse child record. And your domain objects are no longer good OO design. No associations in classes happen, and you end up having attributes that are int ids to Foreign Key tables. You also end up designing your Apis with int String parameters instead of a cleaner api with your domain objects being passed around.

Even if using JDBC we can use connected object model. It's only a matter of mapping result set to objects. But it's pain to do it manually, I would recommend to use iBATIS Data Mapper framework instead.


Basically you end up coding Adapter code into the Mapper classes and that is very error prone code, and lots of it. That is why most people won't go that far and flatten their object model.

iBATIS is a very good tool for mapping queries to your domain objects.

Mark
Mark Reyes
Ranch Hand

Joined: Jul 09, 2007
Posts: 426
Hi Mark and Kenkaj,

Thanks for your replies!

It's always worth reading your replies..

Though I wont pretend that I know about the Data Mapper that you are discussing. I only used plain JDBC in much of my projects. Passing around int, string, byte in much of my
API calls.

But I plan to learn also about that after learning how to use Spring. Kudos to both of you
 
jQuery in Action, 2nd edition
 
subject: Spring Modules