当前位置:网站首页>@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-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)
- Mysql27 index optimization and query optimization
- Pytoch LSTM implementation process (visual version)
- MySQL35-主从复制
- Pytorch RNN actual combat case_ MNIST handwriting font recognition
- Baidu Encyclopedia data crawling and content classification and recognition
- ++Implementation of I and i++
- MySQL27-索引優化與查詢優化
- Postman Interface Association
- MySQL19-Linux下MySQL的安装与使用
猜你喜欢
API learning of OpenGL (2002) smooth flat of glsl
MySQL20-MySQL的数据目录
Invalid global search in idea/pychar, etc. (win10)
Esp8266 at+cipstart= "", "", 8080 error closed ultimate solution
该不会还有人不懂用C语言写扫雷游戏吧
MySQL27-索引優化與查詢優化
CSDN Q & a tag skill tree (V) -- cloud native skill tree
MySQL29-数据库其它调优策略
Pytoch LSTM implementation process (visual version)
Other new features of mysql18-mysql8
随机推荐
Pytorch LSTM实现流程(可视化版本)
Mysql22 logical architecture
CSDN博文摘要(一) —— 一个简单的初版实现
Just remember Balabala
Mysql21 - gestion des utilisateurs et des droits
Mysql28 database design specification
ZABBIX introduction and installation
Mysql35 master slave replication
MySQL完全卸载(Windows、Mac、Linux)
[BMZCTF-pwn] 11-pwn111111
使用OVF Tool工具从Esxi 6.7中导出虚拟机
Moteur de stockage mysql23
API learning of OpenGL (2002) smooth flat of glsl
Solution to the problem of cross domain inaccessibility of Chrome browser
MySQL35-主从复制
text 文本数据增强方法 data argumentation
基于Pytorch肺部感染识别案例(采用ResNet网络结构)
Postman environment variable settings
February 13, 2022 - Maximum subarray and
Mysql24 index data structure