Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring Modules

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic