-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b7611c6
commit f05a1bb
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# nh-micro | ||
micro service and dynamic script | ||
|
||
MVC框架的缺点 | ||
系统按照Controller、Service、Dao层次划分,虽然在建设初期技术结构清晰。但每个业务逻辑代码都分散到不同代码框,业务结构不直观,不利于后期业务重构。 | ||
业务代码与MVC技术栈深度耦合,某层技术框架升级,导致整体服务不可复用。 | ||
由于代码分散,支持版本化成本很高。 | ||
|
||
|
||
|
||
脚本化微服务(NHMicro开源框架)实现MVC反模式 | ||
Controller层改造 | ||
|
||
使用微服务交互接口取代Controller,或者仍使用原有Controller技术栈,但调用NHMicro微服务提供的脚本调用Util。 | ||
Service层改造 | ||
|
||
uService层功能代码脚本化,脚本化有利于快速调整调用流程,有利于版本化。 | ||
Dao层改造 | ||
|
||
统一封装Dao(NHMicro开源框架已经提供Dao封装),基于Spring-jdbcTemplate封装统一Dao。 | ||
|
||
|
||
|
||
脚本化微服务(NHMicro开源框架)-实现技术栈中的虚拟机 | ||
NHMicro微服务架构中交互层和dao层不含有业务属性,需求变更时不需要修改微服务交互层代码和微服务Dao层代码。 | ||
|
||
一个脚本实现一个业务功能,业务框架清晰。 | ||
|
||
脚本内容修改后,设置新的名称,可以和旧脚本部署在同一个系统中,实现版本化。 | ||
|
||
脚本可以被复制到另一个不同MVC栈的系统中,实现代码复用。 | ||
|
||
NHMicro微服务架构是Java技术栈中的虚拟机,一次脚本编写到处复用。 | ||
|
||
|