当前位置:网站首页>如何实现常见框架
如何实现常见框架
2022-07-06 12:44:00 【EnndmeRedis】
MyBatis
mybatis是一个持久层框架,解决了JDBC操作数据库要写复杂的建立连接、数据手动映射。使用xml配置省去建立sqlSession的过程,使用对象关系映射解决麻烦的手动映射。
需要做的就是在调用某个接口时去执行对应的SQL,这里就要用到动态代理
生成代理对象,代理对象就可以根据传入的SQL,完成建立连接并发用JDBC的方法执行SQL;通过反射拿到这个方法返回值的类型,将数据库返回的数据集合进行依次映射
Spring IOC容器
- 定义一些Bean的注解,我们要通过这些注解扫描添加到Bean容器
- 读取配置中的扫描路径并扫描,然后将路径下的.class文件都存放到一个Set中
- 遍历这个集合,根据类上的注解去交给IOC容器,也就是个Map集合
- 如果有Bean依赖其他Bean就完成依赖注入
- 产生循环依赖,再创建两个Map作二级缓存和三级缓存
MQ
- 指定消息协议(JMS、AMQP)
- 选择存储方式(内存、日志、数据库)在效率和可靠性做平衡
Naocs
参考Nacos实现原理
分布式锁
参考Redis做分布式锁过程 setnx -> red lock
分布式事务
参考XA、AT、TCC
本地消息表???还没理解
MQ:我保证了消息可靠(发布确认+持久化+手动应答),通过重试防止宕机带来的不一致问题。但是!如果是我下游服务本身业务问题,比如用户余额不足,那我下游服务如何通知上游服务回滚????(用Seata???)
边栏推荐
- [200 opencv routines] 220 Mosaic the image
- use. Net analysis Net talent challenge participation
- recyclerview gridlayout 平分中间空白区域
- 2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination
- #yyds干货盘点#重新梳理箭头函数的this
- Xcode6 error: "no matching provisioning profiles found for application"
- [weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100
- [weekly pit] information encryption + [answer] positive integer factorization prime factor
- Mtcnn face detection
- Web开发小妙招:巧用ThreadLocal规避层层传值
猜你喜欢
use. Net drives the OLED display of Jetson nano
[diy] self designed Microsoft makecode arcade, official open source software and hardware
[DIY]自己设计微软MakeCode街机,官方开源软硬件
2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
【每周一坑】正整数分解质因数 +【解答】计算100以内质数之和
02 basic introduction - data package expansion
“罚点球”小游戏
What key progress has been made in deep learning in 2021?
【DSP】【第二篇】了解C6678和创建工程
Leetcode question 283 Move zero
随机推荐
自定义限流注解
Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
Yyds dry goods count re comb this of arrow function
Manifest of SAP ui5 framework json
Infrared thermometer based on STM32 single chip microcomputer (with face detection)
Core principles of video games
[DSP] [Part 1] start DSP learning
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
[wechat applet] operation mechanism and update mechanism
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
2022 Guangdong Provincial Safety Officer C certificate third batch (full-time safety production management personnel) simulation examination and Guangdong Provincial Safety Officer C certificate third
Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
02 basic introduction - data package expansion
SSO single sign on
Why do novices often fail to answer questions in the programming community, and even get ridiculed?
Regular expression collection
[DIY]自己设计微软MakeCode街机,官方开源软硬件
Leetcode hot topic Hot 100 day 32: "minimum coverage substring"
Implementation of packaging video into MP4 format and storing it in TF Card
【OpenCV 例程200篇】220.对图像进行马赛克处理