gpt4 book ai didi

design-patterns - 结构与行为设计模式

转载 作者:行者123 更新时间:2023-12-03 12:26:14 24 4
gpt4 key购买 nike

关闭。这个问题不符合 Stack Overflow guidelines 。它目前不接受答案。












想改善这个问题吗?更新问题,以便堆栈溢出为 on-topic

2年前关闭。



Improve this question




我刚开始阅读设计模式,我有一些基本的疑问,即使看了很多文章也不清楚。有人可以解释我吗?我在这里看到了很多类似的帖子,但都不是很清楚。

  • 它们是如何划分为结构和行为模式的?
  • 有什么好书可以看吗?现在我正在关注 Head first 设计模式。
  • 记住所有这些模式并应用的简单方法是什么?我想记住每个模式的 UML 图和概念。你有其他建议吗?
  • 最佳答案

    1. How did they segregate in to structural and behavioural patterns?


    从戈夫书

    "Structural patterns are concerned with how classes and objects are composed to form larger structures. "



    一些结构模式:
  • 适配器​​
  • 装饰器
  • 门面
  • 代理
  • 享元

  • 等等

    "Behavior patterns are concerted with algorithms and the assignment of responsibilities between objects. Behavioral patterns describe not just the patterns of objects or classes but also the patterns of communication between them."



    一些行为模式:
  • 责任链
  • 命令
  • 迭代器
  • 中介
  • 观察者
  • 访客

  • 等等

    1. Is there any good book to follow?Now I am following Head first design patterns.


    这个问题超出了 SO 的范围,因为我们真的不应该推荐书籍。

    1. What is the easy way to remember all these patterns and apply? I thought of remembering UML diagram and concept for each pattern. Do you suggest any other way?


    设计模式的 UML 图令人困惑,因为几个模式具有相同或相似的图,您无法区分它们。不幸的是,最简单的方法是仅使用它们就知道如何使用它们。并随身携带一本设计模式书,以便为您不记得的较少使用的模式找到动机。

    关于design-patterns - 结构与行为设计模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31389331/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com