ChangingThePresent USES polymorphism in several places to provide common behavior, particularly when we are dealing with images.
ChangingThePresent在几个地方使用了多态以提供通用的行为,尤其是在处理图像的时候。
ActiveRecord has a feature called polymorphic associations that is ideal for attaching common behavior to a class without inheritance.
ActiveRecord具有一种称为多态关联的特性,非常适合将通用行为附加给类,完全无需继承。
You can reduce code duplication by abstracting the common behavior and including it in the generic DAO, where all users of the class will have access to the functionality.
提取通用行为并把它们包含在泛型DAO 中,让类的所有用户通过泛型 DAO访问这些功能,这样就可以减少代码重复。
It also hurts the design of your domain classes because this utility class must now sit at the top of your object hierarchy, not allowing you to use inheritance to consolidate common behavior.
这还不利于域类的设计,因为这个实用类现在必须位于对象层次结构的顶层,不允许您使用继承来整合常见行为。
Aspect Oriented Programming (AOP) compensates the weakness of object Oriented Programming (OOP) at applying common behavior that spans multiple non-related object models.
面向方面编程(AOP)弥补了面向对象的编程(OOP)在跨越模块行为上的不足。
Aspect Oriented Programming (AOP) compensates the weakness of object Oriented Programming (OOP) at applying common behavior that spans multiple non-related object models.
面向方面编程(AOP)弥补了面向对象的编程(OOP)在跨越模块行为上的不足。
应用推荐