
基本思想:
-
增强类与被增强类实现(implements)相同的接口;
-
增强类中获取被增强类的引用。
// 共同的接口:
1 |
interface { |
// 被增强的类
1 |
class Person implements { |
// 增强的类
1 |
class SuperPerson implements { |

基本思想:
增强类与被增强类实现(implements)相同的接口;
增强类中获取被增强类的引用。
// 共同的接口:
1 |
interface { |
// 被增强的类
1 |
class Person implements { |
// 增强的类
1 |
class SuperPerson implements { |
近期评论