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.
有2种不同的设计。第二个是(下)第一个的改进版本。不同之处在于我向 B 添加了 2 个子类。所以 A 现在依赖于 2 个子类。但是如果 B 以后有更多的子类会发生什么?
这真的是最佳实践吗?尤其是 GRASP 的观点?
除了与每个类建立关联之外,我更喜欢以下内容。