SAP系统里的胖接口Fat interface
Recently I am planning an internal training regarding Software engineering concept to my colleagues and one topic is “Interface Segregation”.
The following guideline is quoted from OODesign:
“When we design an application we should take care how we are going to make abstract a module which contains several submodules. Considering the module implemented by a class, we can have an abstraction of the system done in an interface. But if we want to extend our application adding another module that contains only some of the submodules of the original system, we are forced to implement the full interface and to write some dummy methods. Such an interface is named fat interface orpolluted interface.
The Interface Segregation Principle states that clients should not be forced to implement interfaces they don’t use. Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one submodule.”
I am very curious whether SAP standard code contains such fat interface or not. So I wrote a small CDS view:
And get all interfaces which contains more than 10 methods:
DATA: lt_int TYPE STANDARD TABLE OF Zfat_Interface.
SELECT * INTO TABLE @lt_int FROM ZFAT_INTERFACE where method_count > 10 ORDER BY method_count DESCENDING.
The result is there are totally 3139 such interfaces in my CRM development system.
I quickly go through the list, most of them are used to build system functionalities and NO application will implement them, so in my opinion the fact is acceptable. If you are intrested with the list, you can find the excel here.
On the other hand there is also another category of interfaces which has NO methods or attributes defined. Refer to this blog Tag(Marker) Interface in ABAP and Java for more detail.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- 关于 SAP UI5 接口 sap.ui.core.IAsyncContentCreation 的问题讨论
- sap.ui.core.IAsyncContentCreation 这个标记接口在 SAP UI5 框架中的应用
- SAP ABAP 中,if_http_extension 接口的flow_rc 字段含义
- 查看指定 SAP CRM One Order 的 note 数据
- SAP Gateway Service Builder 里的 OData 服务实现方式
- 第三方外部 Saas提供商如何跟使用 SAP 系统的客户进行对接接口集成
- SAP Fiori Launchpad tile点击之后的跳转链接是如何解析出来的
- SAP C4C的URL Mashup无法添加到embedded component里去
- 使用OData服务创建SAP C4C的Lead数据,必须指定Account字段
- SAP Spartacus pop over 元素的单元测试
- SAP C4C url Mashup的跳转工作原理 - 新的浏览器窗口是如何打开的
- 一个SAP S/4HANA CDS view extension的具体例子
- SAP APF modeler过滤器的设计原理
- SAP UI5和React的页面渲染性能比较
- 增强现实和3D渲染技术是如何应用在SAP产品里的
- SAP 云平台多目标应用 Multi-Target Application 的开发技术介绍
- SAP UI5 初学者教程之三:开始接触第一个 SAP UI5 控件 试读版
- SAP 电商云 Spartacus UI BaseSiteInitializer 的实现明细
- SAP 金税接口增强 BADI
- SAP 金税接口介绍