Spring-IOC Detailed notes

In the spring when the class which will be handed over to a spring container management, will use the @ Component, @ Controller, @ Service, @ Repository four notes, and that they in the end what is the difference thing.

  1. In fact, @ Controller, @ Service, @ Repository, @Component three classes are derived from their functional point of view, are the same, the class object which is injected into the spring, why should out three, in fact, is to a specification, the annotation can not be used in different classes
  2. A web layer @Controller
  3. @Service for Service Layer
  4. Dao layer for @Repository
  5. Among other components used @Component
Published 25 original articles · won praise 0 · Views 292

Guess you like

Origin blog.csdn.net/qq_42219004/article/details/105162189