当前位置:网站首页>如何实现常见框架
如何实现常见框架
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???)
边栏推荐
- Core principles of video games
- 【DSP】【第二篇】了解C6678和创建工程
- Rhcsa Road
- C language games - minesweeping
- recyclerview gridlayout 平分中间空白区域
- Infrared thermometer based on STM32 single chip microcomputer (with face detection)
- Entity alignment two of knowledge map
- Le langage r visualise les relations entre plus de deux variables de classification (catégories), crée des plots Mosaiques en utilisant la fonction Mosaic dans le paquet VCD, et visualise les relation
- [weekly pit] calculate the sum of primes within 100 + [answer] output triangle
- 动态切换数据源
猜你喜欢

What is the problem with the SQL group by statement

New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue
![[diy] how to make a personalized radio](/img/fc/a371322258131d1dc617ce18490baf.jpg)
[diy] how to make a personalized radio

【微信小程序】運行機制和更新機制

Reinforcement learning - learning notes 5 | alphago

【DSP】【第二篇】了解C6678和创建工程

【每周一坑】计算100以内质数之和 +【解答】输出三角形

(工作记录)2020年3月11日至2021年3月15日

Comment faire une radio personnalisée

小孩子学什么编程?
随机推荐
【微信小程序】运行机制和更新机制
APS taps home appliance industry into new growth points
01 basic introduction - concept nouns
逻辑是个好东西
【每周一坑】信息加密 +【解答】正整数分解质因数
User defined current limiting annotation
[weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100
设计你的安全架构OKR
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,
Basic knowledge of lists
Design your security architecture OKR
R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw
Comment faire une radio personnalisée
看过很多教程,却依然写不好一个程序,怎么破?
Performance test process and plan
知识图谱之实体对齐二
Statistical inference: maximum likelihood estimation, Bayesian estimation and variance deviation decomposition
Extraction rules and test objectives of performance test points
Minimum cut edge set of undirected graph
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient