当前位置:网站首页>@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
边栏推荐
- [BMZCTF-pwn] 12-csaw-ctf-2016-quals hungman
- MySQL20-MySQL的数据目录
- 基于Pytorch的LSTM实战160万条评论情感分类
- ++Implementation of I and i++
- 用于实时端到端文本识别的自适应Bezier曲线网络
- Isn't there anyone who doesn't know how to write mine sweeping games in C language
- [untitled]
- MySQL35-主从复制
- Breadth first search rotten orange
- Mysql26 use of performance analysis tools
猜你喜欢
Introduction tutorial of typescript (dark horse programmer of station B)
CSDN blog summary (I) -- a simple first edition implementation
[reading notes] rewards efficient and privacy preserving federated deep learning
[Li Kou 387] the first unique character in the string
CSDN Q & a tag skill tree (V) -- cloud native skill tree
Other new features of mysql18-mysql8
MySQL28-数据库的设计规范
A brief introduction to the microservice technology stack, the introduction and use of Eureka and ribbon
C language advanced pointer Full Version (array pointer, pointer array discrimination, function pointer)
Win10: how to modify the priority of dual network cards?
随机推荐
Pytorch LSTM实现流程(可视化版本)
How to change php INI file supports PDO abstraction layer
Anaconda3 installation CV2
Mysql27 - Optimisation des index et des requêtes
MySQL36-数据库备份与恢复
Copy constructor template and copy assignment operator template
CSDN问答模块标题推荐任务(一) —— 基本框架的搭建
MySQL27-索引优化与查询优化
MySQL35-主从复制
Emotional classification of 1.6 million comments on LSTM based on pytoch
ZABBIX introduction and installation
Mysql34 other database logs
使用OVF Tool工具从Esxi 6.7中导出虚拟机
Bytetrack: multi object tracking by associating every detection box paper reading notes ()
[C language foundation] 04 judgment and circulation
Mysql22 logical architecture
MySQL26-性能分析工具的使用
++Implementation of I and i++
Pytoch LSTM implementation process (visual version)
Moteur de stockage mysql23