Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在编程中,横切关注点是一个常见的关注点(因为缺乏更好的术语)。
例如,如果您在类中对飞机及其所有复合部件进行建模,则各种设备将依赖于相同类型的部件。例如油箱、水箱等。
我的设计中有同样的问题要处理。除了AOP,还有什么策略可以解决这个问题?
谢谢
好吧,根据定义,AOP 旨在处理横切关注点。因此,您的问题的答案是 AOP。除了 AOP,你不需要其他任何东西。你为什么要?