What Spring annotation should I use for Hibernate DAO classes so they could be found in scanning process? @Repository, @Service or @Component? I couldn’t figure out the difference. I’m on Spring 2.5.6 now.
P.S. Can someone guide me quickly through the layer idea? I only have heard a thing like presentation layer, but don’t have exact understanding what should I call so and what is the business layer? Are there other?
@Repositorywould be my recommendation.Presentation tier means web UI, so those should use the
@Controllerannotation.Services implement use cases using POJO interfaces; mark this as
@Service. Controllers will use services to fulfill use cases.