• 已删除用户
Administrator
发布于 2021-09-11 / 25 阅读
0

南向接口与北向接口

官方定义

A northbound interface is an interface that conceptualizes lower level details. It interfaces to higher level layers and is normally drawn at the top of an architectural overview.
北向接口(Northbound Interface)是指,一个较低层次的接口连接更高层的层接口,通常绘制在体系结构概述的顶部。

A southbound interface decomposes concepts in the technical details, mostly specific to a single component of the architecture. Southbound interfaces are drawn at the bottom of an architectural overview.
南向接口(Southbound Interface)是指,偏重技术细节,主要是特定于架构的单个组件。通常绘制在体系结构概述的底部。

命名由来

北向接口因处于架构图的顶部而得名,南向接口则因处于架构图的底部而得名,地图中上北下南。

简图解释

南北向接口只是针对某个组件来说的,向下的接口称为南向,向上的接口称为北向。

例如在 Spring 项目中,View 对 Controller 层就是北向接口,Controller 对 Service 层就是南向接口,而 Service 对 mapper 层又是北向接口,mapper 层对数据库层又是北向接口。

参考资料

CSDN 什么是北向接口和南向接口?