Benefits:
It allows two or more previously incompatible objects to interact.
It allows reusability of existing functionality.
Applicable Scenarios:
An object needs to utilize an existing class with an incompatible interface.
You want to create a reusable class that cooperates with classes that don’t necessarily have compatible interfaces.
博客介绍了class和object交互的好处,包括让原本不兼容的对象能交互、实现现有功能的复用。还说明了适用场景,如对象需利用接口不兼容的现有类,或创建可与接口不一定兼容的类协作的可复用类。
1301

被折叠的 条评论
为什么被折叠?



