当前位置:网站首页>@Controller, @service, @repository, @component differences
@Controller, @service, @repository, @component differences
2022-07-06 10:45:00 【Programmer seven seven】
1、@controller controller ( Injection service 、 Use in Controller layer )
Used to label the control layer , amount to struts Medium action layer
2、@service service ( Inject dao、 Use in Service layer )
For tagging the service layer , It is mainly used for business logic processing
3、@repository( Realization dao visit 、 Use in Mapper layer )
Used to label data access layer , It can also be used to label data access components , namely DAO Components .
4、@component ( Put ordinary pojo Instantiate to spring In the container , Equivalent to the configuration file )
It refers to all kinds of components , That is to say, when our classes do not belong to various categories ( Do not belong to @Controller、@Services When waiting ), We can use @Component To label this class .
explain :
<context:component-scan base-package=”com.*”>
The example above is the introduction of Component Examples of components , among base-package Represents all subpackages that need to be scanned .
Common ground : By @controller 、@service、@repository 、@component Annotated classes , These classes will be included in spring Manage in containers
边栏推荐
- Unicode decodeerror: 'UTF-8' codec can't decode byte 0xd0 in position 0 successfully resolved
- 使用OVF Tool工具从Esxi 6.7中导出虚拟机
- MySQL26-性能分析工具的使用
- Mysql34 other database logs
- Global and Chinese market of transfer switches 2022-2028: Research Report on technology, participants, trends, market size and share
- windows下同时安装mysql5.5和mysql8.0
- CSDN question and answer tag skill tree (I) -- Construction of basic framework
- [reading notes] rewards efficient and privacy preserving federated deep learning
- MySQL29-数据库其它调优策略
- MySQL30-事务基础知识
猜你喜欢

Use JUnit unit test & transaction usage

Postman environment variable settings

CSDN博文摘要(一) —— 一个简单的初版实现

ByteTrack: Multi-Object Tracking by Associating Every Detection Box 论文阅读笔记()

Pytoch LSTM implementation process (visual version)

MySQL23-存儲引擎

Esp8266 at+cipstart= "", "", 8080 error closed ultimate solution

Why is MySQL still slow to query when indexing is used?

How to find the number of daffodils with simple and rough methods in C language

Invalid global search in idea/pychar, etc. (win10)
随机推荐
Global and Chinese markets of static transfer switches (STS) 2022-2028: Research Report on technology, participants, trends, market size and share
该不会还有人不懂用C语言写扫雷游戏吧
Mysql32 lock
基于Pytorch肺部感染识别案例(采用ResNet网络结构)
pytorch的Dataset的使用
Anaconda3 installation CV2
Mysql21 user and permission management
A brief introduction to the microservice technology stack, the introduction and use of Eureka and ribbon
C语言标准的发展
MNIST implementation using pytoch in jupyter notebook
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd0 in position 0成功解决
Case identification based on pytoch pulmonary infection (using RESNET network structure)
text 文本数据增强方法 data argumentation
Introduction tutorial of typescript (dark horse programmer of station B)
Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
Postman Interface Association
Valentine's Day is coming, are you still worried about eating dog food? Teach you to make a confession wall hand in hand. Express your love to the person you want
[untitled]
Security design verification of API interface: ticket, signature, timestamp
Windchill configure remote Oracle database connection