2

Possible Duplicate:
What is the right way to use spring MVC with Hibernate in DAO, sevice layer architecture

I have 5 main layers in my application:

  1. Controller
  2. Delegate
  3. Service
  4. Facade
  5. DAO

Where should the @Transactional annotation go, according to the best practices?

Are there any exceptions where they can go in a Controller?

Community
  • 1
  • 1
th3an0maly
  • 3,360
  • 8
  • 33
  • 54
  • What is the difference between service and facade? A facade, by definition should be what you see from the UI layer, shouldn't it? – JB Nizet Sep 23 '12 at 09:47
  • this question is similar to you http://stackoverflow.com/questions/8993318/what-is-the-right-way-to-use-spring-mvc-with-hibernate-in-dao-sevice-layer-arch –  Oct 03 '12 at 08:01

1 Answers1

6

A facade is what you access from outside your system. Internally it may delegate to one or multiple services. Since a facade should never contain any logic and should simply delegate to only one service method (and not bunch multiple service calls together), it should not contain the @Transactional annotations. The services should have them instead.

Abhinav Sarkar
  • 23,534
  • 11
  • 81
  • 97