살군의 보조기억 장치

Another memory device…

Spring: Annotation based configuration

leave a comment »

Need to read: Annotation based configuration in Spring

 

————————————————————————————————————————————

Spring 2.5 introduces further stereotype annotations: @Component, @Service, and @Controller. @Component is a generic stereotype for any Spring-managed component. @Repository, @Service, and @Controller are specializations of @Component for more specific use cases, for example, in the persistence, service, and presentation layers, respectively. Therefore, you can annotate your component classes with @Component, but by annotating them with @Repository, @Service, or @Controller instead, your classes are more properly suited for processing by tools or associating with aspects. For example, these stereotype annotations make ideal targets for pointcuts. It is also possible that @Repository, @Service, and @Controller may carry additional semantics in future releases of the Spring Framework. Thus, if you are choosing between using @Component or @Service for your service layer, @Service is clearly the better choice. Similarly, as stated above, @Repository is already supported as a marker for automatic exception translation in your persistence layer.

retrieved from: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html#beans-java

1) PRESENTATION LAYER (@Controller)

  • a) View (jsp)
  • b) FormBeans
  • c) Controllers

2) BUSSINESS LAYER (@Service)

  • a) Transactions
  • b) Services with interfaces -
  • c) Data transfer object
  • d) Validators

3) PERSISTANCE LAYER  (@Repository)

  • a) DAO (Hibernate DAO Classes of Spring)
  • b) ORM (Hibernate)
  • c) Database
  • d) POJO

retrieved from: http://www.coderanch.com/t/448566/Spring/many-layers-jpetstore-application

Advertisements

Written by gomiski

2011/08/16 at 8:24 am

Posted in Java, Lecture

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: