当前位置:网站首页>公司项目中的biz层和manager层是干啥的
公司项目中的biz层和manager层是干啥的
2022-07-26 10:46:00 【Eric-x】
我们都知道熟悉的三层架构:
- dao层:数据传输对象,一般是把数据库表封装成对象,表的各个字段就是该对象的各个变量。
- service层:相对具体的业务逻辑服务层。
- controller层:主要负责接受前台的数据和请求,并且在底层处理完之后把结果返回回去,一般不能写业务逻辑在这一层,因为第一造成了不可复用,第二以后的维护困难,第三这一层没有上层,如果给用户返回了奇怪的错误信息会不好看。
如果是小应用,而且后续扩展的可能性不高,只需要Dao——service——controller的,但是去到公司发现,公司的项目使用的不是三层架构,而是五层架构。因为公司的项目普遍都是比较大的。
会多了biz层和manager层。(咱们也不废话,先 介绍这两层的作用)
- manager层:负责将Dao层中的数据库操作组合复用,主要是一些缓存方案,中间件的处理,以及对第三方平台封装的层。
- biz层: 包含service层,service层注重基础业务的处理,biz层是复杂应用层的业务层。
manager层好理解,那biz层的作用是干啥呢?我们的service层不是可以进行互相调用吗,这样就够了呀?
确实,service是可以互相调用的,也是可以实现业务的。但如果业务稍微复杂点用service层 比如你一个service引入了两三个别的service ,业务再复杂点一个service要引入十来个别的service,这时候service又操作dao又操作别的service,那么不用biz 代码很乱且臃肿的
所以,biz层的存在是很有必要的。
文献参考:https://blog.csdn.net/qq_42685588/article/details/107830722
边栏推荐
- RT thread learning notes (I) -- configure RT thread development environment
- LIst和Dictionary实例应用(※)
- 剑指Offer(二十):包含min函数的栈
- 27.移除元素
- 在神州IV开发板上为STemWin 5.22加入触屏驱动
- Flutter编译报错 version of NDK matched the requested version 21.0.6113669. Versions available locally: 2
- 在altium designer中禁用USBJATG
- 13 managing resources by objects
- 35. 搜索插入位置
- IAR sprintf 浮点 在UCOS 总格式化成0.0的问题
猜你喜欢

使用Selenium抓取zabbix性能监控图
![[machine learning notes] [face recognition] deeplearning ai course4 4th week programming](/img/7e/9c0e88097b90c0c24ebf86f090805b.png)
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming

抽象工厂及其改进示例

Issue 7: how do you choose between curling up and lying flat
![[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)](/img/94/ff52b043320b6dea5ca1238e314de8.png)
[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)

Codepoint 58880 not found in font, aborting. flutter build apk时报错

RT-Thread 学习笔记(五)---编辑、下载、调试程序
![Error[pe147]: declaration is incompatible with 'error problem](/img/4f/57145d78f4dc1fe84d2f271dd9d82f.png)
Error[pe147]: declaration is incompatible with 'error problem

一文详解Nodejs中fs文件模块与path路径模块

putty的使用教程
随机推荐
kali 查看ip地址
RT thread learning notes (VIII) -- start the elmfat file system based on SPI flash (Part 2)
Sql Server 数据库之完整性约束
微信公众号开发 获取openid时报错40029 invalid code 问题的解决
面试过程中,面试官是如何考察Rust工程师的水平?
Koin
2021-08-13 learn C language with pengge - array
toolstrip 去边框
剑指Offer(九):变态跳台阶
2021-08-12 function recursion_ Learn C language with brother Peng
list升序和降序
Anaconda is used on vscode (the environment has been configured)
Add touch screen driver for stemwin 5.22 on Shenzhou IV development board
display-inline+calc实现左中右布局,中间自适应
35. 搜索插入位置
解决org.apache.commons.codec.binary.Base64爆红问题
344.反转字符串
12 don't forget every component when copying an object
Sql Server 数据库之数据类型
RT thread learning notes (VI) -- start the elmfat file system based on SPI flash (Part 1)