Template Method模式建议,应当将公共模板代码移到继承层次结构之上,将算法细节推迟到子类。
The Template Method pattern suggests that I should move common boilerplate code up the inheritance hierarchy, deferring algorithmic details to child classes.
无论如何,这两种类之间存在大量相同的行为,它们继承了公共基类 AbstractList。
Regardless, it turns out that a phenomenal amount of behavior between these two classes is identical, and as a result, both in turn inherit from a common base class, AbstractList.
所有派生实体类和会话类都继承了bobase类中create和find方法的公共代码。
All derived entity classes and the session class inherit the common code of the create and find methods from the BOBase class.
应用推荐