前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SAP ABAP Netweaver里的胖接口(fat interface)

SAP ABAP Netweaver里的胖接口(fat interface)

作者头像
Jerry Wang
发布2020-05-06 15:17:08
5030
发布2020-05-06 15:17:08
举报

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 or polluted 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:

代码语言:txt
复制
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.

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.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-05-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档