当前位置:网站首页>@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
边栏推荐
- Anaconda3 安装cv2
- MySQL28-数据库的设计规范
- ZABBIX introduction and installation
- Typescript入门教程(B站黑马程序员)
- Unicode decodeerror: 'UTF-8' codec can't decode byte 0xd0 in position 0 successfully resolved
- Moteur de stockage mysql23
- Time complexity (see which sentence is executed the most times)
- Record the first JDBC
- Windchill configure remote Oracle database connection
- MySQL 29 other database tuning strategies
猜你喜欢

Pytorch RNN actual combat case_ MNIST handwriting font recognition

Mysql21 user and permission management

Nanny hand-in-hand teaches you to write Gobang in C language

Mysql32 lock

API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T

MySQL22-逻辑架构

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

使用OVF Tool工具从Esxi 6.7中导出虚拟机

基于Pytorch肺部感染识别案例(采用ResNet网络结构)

windows无法启动MYSQL服务(位于本地计算机)错误1067进程意外终止
随机推荐
使用OVF Tool工具从Esxi 6.7中导出虚拟机
高并发系统的限流方案研究,其实限流实现也不复杂
Mysql27 - Optimisation des index et des requêtes
CSDN博文摘要(一) —— 一个简单的初版实现
基于Pytorch肺部感染识别案例(采用ResNet网络结构)
Mysql25 index creation and design principles
windows下同时安装mysql5.5和mysql8.0
@controller,@service,@repository,@component区别
MySQL33-多版本并发控制
CSDN问答模块标题推荐任务(二) —— 效果优化
MySQL23-存储引擎
pytorch的Dataset的使用
用于实时端到端文本识别的自适应Bezier曲线网络
Ueeditor internationalization configuration, supporting Chinese and English switching
Mysql21 - gestion des utilisateurs et des droits
Anaconda3 安装cv2
【C语言】深度剖析数据存储的底层原理
windows无法启动MYSQL服务(位于本地计算机)错误1067进程意外终止
MySQL27-索引优化与查询优化
Nanny hand-in-hand teaches you to write Gobang in C language