当前位置:网站首页>如何实现常见框架
如何实现常见框架
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???)
边栏推荐
- 【微信小程序】運行機制和更新機制
- [diy] how to make a personalized radio
- [DSP] [Part 1] start DSP learning
- [diy] self designed Microsoft makecode arcade, official open source software and hardware
- Utilisation de l'écran OLED
- OAI 5G NR+USRP B210安装搭建
- (work record) March 11, 2020 to March 15, 2021
- Extraction rules and test objectives of performance test points
- 小孩子學什麼編程?
- Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
猜你喜欢
【微信小程序】运行机制和更新机制
Number of schemes from the upper left corner to the lower right corner of the chessboard (2)
OAI 5G NR+USRP B210安装搭建
Pycharm remote execution
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
02 basic introduction - data package expansion
Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
(工作记录)2020年3月11日至2021年3月15日
Use of OLED screen
随机推荐
Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
Regular expression collection
正则表达式收集
Minimum cut edge set of undirected graph
[wechat applet] operation mechanism and update mechanism
'class file has wrong version 52.0, should be 50.0' - class file has wrong version 52.0, should be 50.0
#yyds干货盘点#重新梳理箭头函数的this
Web security - payload
Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
【微信小程序】運行機制和更新機制
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
什么是RDB和AOF
Logic is a good thing
use. Net analysis Net talent challenge participation
Variable star --- article module (1)
Detailed explanation of knowledge map construction process steps
Xcode6 error: "no matching provisioning profiles found for application"
Distributed ID
PG基础篇--逻辑结构管理(事务)
为什么新手在编程社区提问经常得不到回答,甚至还会被嘲讽?