`
cdragon
  • 浏览: 76873 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

inheritance VS interface

阅读更多

继承和接口的关系,可以从几个主要角度理解:

 

1、在方向上,继承接近于竖向的抽象,而接口更接近于横向的抽象。

2、从功能上,继承较多应用于领域模型,而接口多倾向于“工具性”使用,即领域中通性部分。

3、从产品上,继承多应用实际应用类,而接口更倾向于通用底层,一般不对开发人员暴露。

4、从功能上,继承可以看成是主干,而接口属于分支,使模型更充实和丰富。

 

小结,在抽象维度上,接口与继承一个不能少,而接口会使模型最优化,所以要特别认真对待--其实在建模一开始,就要对继承与接口统一考虑:继承与接口不对立而是统一的关系。这也是我个人认为极限抽象为什么不好的原因。

 

后记,coding的目的,在于以一种可显化的方式(如函数、类)来交流“约定的符号”(如变量),并形成制式(即模式)。

 

而对于接口,接口的定义,首先最重要的是:接口不能拥有实例,只能实现。而容器(container)是重要的识别(identity)组成。而容器的本质是命令在外。IoC是SoS(system of system),它的本质是结构控制数据,而非数据掌握结构;是人(我们)来控制系统,绝非系统控制人(我们)。(further more,make manufacturing-functioning included, indepdent from consuming,or provider-consumer pattern called.)

分享到:
评论

相关推荐

    Alura_inheritance_Interface:继承和接口示例-Alura课程

    Alura_inheritance_Interface:继承和接口示例-Alura课程

    Jpaca 帮助文档 Jpcap API EN.CHM

    Class inheritance diagram Direct Subclasses All Known Subinterfaces All Known Implementing Classes Class/interface declaration Class/interface description Nested Class Summary Field Summary ...

    前端项目-klass.zip

    前端项目-klass,Class provider with classical inheritance interface

    object-c基础教程

    o @interface o @implementation o 把它们凑在一起  详细说明... o 多重参数 o 建构子(Constructors) o 访问权限 o Class level access o 异常情况(Exceptions)处理  继承、多型(Inheritance, ...

    Python - How to Program, 1e (2002).pdf

    Object-Oriented Programming: Inheritance and Polymorphism. 9. Operator Overloading. 10. Graphical User Interface Components: Part 1. 11. Graphical User Interface Components: Part 2. 12. Exception...

    Daikon Forge GUI Library

    The Daikon Forge GUI Library (DF-GUI™) is a user interface library for Unity that provides a very flexible and powerful way to create the user interface for your games. It includes a useful list of ...

    Android代码-YaMvp

    YaViewDelegate: Composition over inheritance compile 'com.github.piasy:YaMvp:1.3.1' YaMvp-Rx RxJava Subscription management. compile 'com.github.piasy:YaMvp-Rx:1.3.1' YaRxDelegate: Comp

    Object-Oriented Software Construction 2nd

    21.5 A USER INTERFACE FOR UNDOING AND REDOING 711 21.6 DISCUSSION 712 21.7 BIBLIOGRAPHICAL NOTES 715 EXERCISES 715 Chapter 22: How to find the classes 719 22.1 STUDYING A REQUIREMENTS DOCUMENT 720 ...

    ModelMaker.Code.Explorer.v8.0.0.1877.part1

    As a Class Browser it shows classes (inheritance) and members (fields, methods, properties) in two filtered views, similar to the windows explorer. On the left the Explorer docked in the IDE editor. ...

    ModelMaker.Code.Explorer.v8.0.0.1877.part2

    As a Class Browser it shows classes (inheritance) and members (fields, methods, properties) in two filtered views, similar to the windows explorer. On the left the Explorer docked in the IDE editor. ...

    Java.Crash.Course.1541019245.epub

    You will learn all the technical Java programming language such as Loops and Arrays, Boolean Logic, Methods, Inheritance and Polymorphism, Algorithms, etc. You will get a chance to apply what you ...

    Learn.JAVA.PROGRAMMING.from.scratch.B0140CLLFG

    Chapter 5: Inheritance (Abstract class and Interface) Chapter 6: Data types Chapter 7: Object comparison Chapter 8: Data Structures and their operations Chapter 9: Exceptions and Errors Chapter 10: ...

    基于OPENGL的GUI开发源代码

    other user interface elements, and an inheritance-based event handling model. GLOW also includes a full-featured and extensible library of cross-platform widgets for building powerful graphical ...

    Learning Android: Develop Mobile Apps Using Java and Eclipse(第二版)

    Interfaces and Inheritance Collections Generics Threads Summary Chapter 3 The Stack Stack Overview Linux Native Layer Dalvik Application Framework Applications Summary Chapter 4 Installing and ...

    C# 语言规格说明(English Edition第五版)

    3.7.1.2 Hiding through inheritance 70 3.8 Namespace and type names 71 3.8.1 Fully qualified names 73 3.9 Automatic memory management 73 3.10 Execution order 76 4. Types 77 4.1 Value types 77 4.1.1 The...

    Effective C++(第三版)

    differentiate between inheritance of interface and inheritance of implementation. 条款35:考虑virtual函数以外的其他选择 consider alternatives to virtual functions. 条款36:绝不重新定义继承而来的non-...

    ramping-up-java:开始使用我的Java!

    学习班访问变量的修饰符Private :只能在当前课程中使用,不能在课程之外使用Protected :可以在该类的当前类和子类中使用Public :所有类都可以引用此字段,这是默认设置Inheritance VS Composition Is-A关系就是...

    Java 9 for Programmers (Deitel Developer Series) 完整高清azw3版

    Inheritance, “Programming to an Interface not an Implementation” Lambdas, Sequential and Parallel Streams, Functional Interfaces with Default and Static Methods, Immutability JavaFX GUI, 2D and 3D ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Classes Inheritance Multiple Inheritance Interfaces Operator Overloading Access Control Declaration Order Write Short Functions Google-Specific Magic Smart Pointers cpplint Other C++ Features ...

    [iPhone开发书籍大全].Learn.Objective-C.on.the.Mac.pdf

    Write applications for the Mac OS X interface, the cleanest user–interface around. Understand variables and how to design your own data structures. Work with the file system. Connect to data ...

Global site tag (gtag.js) - Google Analytics