zoukankan      html  css  js  c++  java
  • [Study Note] Patterns in Practice 20100403

    [Object Role Stereotypes]

    Responsibility-Driven Design

    CRC Cards, Class or Candidate/Responsibility/Collaborators

    Responsibility-Driven Design (RDD)

    Objects are not just simple bundles of logic and data. They are responsible members of an object community.

    Stereotype Description
    Information Holder Knows things and provides information. May make calculations from the data that it holds.
    Structurer Knows the relationships between other objects.
    Controller Controls and directs the actions of other objects. Decides what other objects should do.
    Coordinator Reacts to events and relays the events to other objects.
    Service Provider Does a service for other objects upon request.
    Interfacer Objects that provide a means to communicate with other parts of the system, external systems or infrastructure, or end users.

    Information Holder

    Money pattern/Whole Value

    The entity and value objects in a rich domain model are a common example of information holders.

    designing around behavior rather than designing from a data-centric viewpoint.

    Structurer

    The job of a structure is to track, store, and maintain relationships between objects.

    Dictionary<T, U>

    keep the structurer’s responsibility completely separate from the business processes that consume the objects held by the structure.

    Service Provider

    A service provider knows how to perform a task on behalf of another object, but it’s generally passive while it waits to be activated by some other class.

    Interfacer

    Facade pattern

    The interfacer role is effectivel a mediator used to  simplify communication with another system or subsystem.

    Coordinator

    A coordinator reacts to events and relays commands to other objects.

    Controller

    A controller object directs the actions of other classes. A controller is differentiated from a coordinator by the level of control.

    Using Object Role Stereotypes Effectively

  • 相关阅读:
    《JFlow: Practical Mostly-Static Information Flow Control》
    《嵌入式Linux C编程》第一章笔记
    Ansible --- 通过Ansible管理地区机房中的内网机器
    等保审核 --- MySQL密码复杂度
    等保审核 --- MySQL连接控制插件
    等保审核 --- MySQL操作审计记录
    CSS中居中的完全指南(中英对照翻译)
    svn提交报database is locked
    PHP session_cache_expire 会话函数
    MySQL CONCAT_WS 函数
  • 原文地址:https://www.cnblogs.com/zhaorui/p/1703942.html
Copyright © 2011-2022 走看看