摘要:
Interface from user, not from implementor.(DIP)Interface-Oriented Programming.Interface or Abstract function or Abstract classJava专门提供了一种机制,名为“抽象方法”(same as abstraction)。它属于一种不完整的方法,只含有一个声明declaration,没有方法主体 body of definition。下面是抽象方法声明时采用的语法:abstract void X();包含了抽象方法的一个类叫作“抽象类”abstract class with o 阅读全文
posted @ 2013-08-06 19:53
iDragon
阅读(237)
评论(0)
推荐(0)
摘要:
OS puts emphases on how to provide interfaces to user's APPs for using hardware device in the convenient and efficient way.Everything has its own logic of running and must be done step by step,no shortcut. Take a look at Android OS FrameworkNow, how to make the above OS run and every component o 阅读全文
posted @ 2013-08-06 15:46
iDragon
阅读(894)
评论(0)
推荐(0)
摘要:
JVM & BytecodeHas-a or Is-a relationship(inheritance or composition)如果想利用新类内部一个现有类的特性,而不想使用它的接口,通常应选择合成。也就是说,我们可嵌入一个对象,使自己能用它实现新类的特性。但新类的用户会看到我们已定义的接口,而不是来自嵌入对象的接口。考虑到这种效果,我们需在新类里嵌入现有类的private对象。有些时候,我们想让类用户直接访问新类的合成。也就是说,需要将成员对象的属性变为public。成员对象会将自身隐藏起来,所以这是一种安全的做法。如选择继承,就需要取得一个现成的类,并制作它的一个特殊版本。 阅读全文
posted @ 2013-08-06 09:00
iDragon
阅读(199)
评论(0)
推荐(0)
摘要:
Make changes on existing code for subsequent and constant changes of requirement. Reference:http://www.refactoring.com/catalog/index.htmlWays of RefactoringsAdd ParameterChange Bidirectional Association to UnidirectionalChange Reference to ValueChange Unidirectional Association to BidirectionalChang 阅读全文
posted @ 2013-08-06 08:32
iDragon
阅读(226)
评论(0)
推荐(0)

浙公网安备 33010602011771号