当前位置:网站首页>@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
边栏推荐
- CSDN blog summary (I) -- a simple first edition implementation
- 在jupyter NoteBook使用Pytorch进行MNIST实现
- MySQL21-用户与权限管理
- 虚拟机Ping通主机,主机Ping不通虚拟机
- Breadth first search rotten orange
- Pytorch RNN actual combat case_ MNIST handwriting font recognition
- Isn't there anyone who doesn't know how to write mine sweeping games in C language
- Global and Chinese market for intravenous catheter sets and accessories 2022-2028: Research Report on technology, participants, trends, market size and share
- In fact, the implementation of current limiting is not complicated
- 用于实时端到端文本识别的自适应Bezier曲线网络
猜你喜欢

Mysql27 - Optimisation des index et des requêtes

Pytorch LSTM实现流程(可视化版本)

How to change php INI file supports PDO abstraction layer

Mysql22 logical architecture

基于Pytorch的LSTM实战160万条评论情感分类

Export virtual machines from esxi 6.7 using OVF tool

MySQL27-索引优化与查询优化

MySQL27-索引優化與查詢優化
![[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in](/img/1f/93a6c6150ec2b002f667a882569b7b.jpg)
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in

【C语言】深度剖析数据存储的底层原理
随机推荐
February 13, 2022 - Maximum subarray and
Opencv uses freetype to display Chinese
百度百科数据爬取及内容分类识别
MySQL27-索引優化與查詢優化
Why is MySQL still slow to query when indexing is used?
Record the first JDBC
[Li Kou 387] the first unique character in the string
API learning of OpenGL (2005) gl_ MAX_ TEXTURE_ UNITS GL_ MAX_ TEXTURE_ IMAGE_ UNITS_ ARB
Just remember Balabala
MySQL21-用戶與權限管理
基于Pytorch肺部感染识别案例(采用ResNet网络结构)
IDEA 导入导出 settings 设置文件
【C语言】深度剖析数据存储的底层原理
Download and installation of QT Creator
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
CSDN问答标签技能树(二) —— 效果优化
Have you mastered the correct posture of golden three silver four job hopping?
用于实时端到端文本识别的自适应Bezier曲线网络
frp内网穿透那些事
February 13, 2022-2-climbing stairs