DCI - Data, Context and Interaction - Successor to MVC?

前端 未结 5 2050
天涯浪人
天涯浪人 2021-01-30 03:27

What is the best description of Data, Context and Interaction (DCI) to pitch it to an organization?

It\'s created by Trygve Reenskaug, the creator of the MVC-pattern.

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 03:58

    Trygve makes a presentation of DCI in https://vimeo.com/8235394

    DCI has been created to solve a problem in object orientation: it's too difficult to review OO code.

    The code for one use-case in OO is typicall spread out between lots of classes. To understand how the code works, you must also know the relationships between objects in runtime. These relationships aren't set in code, they depend on the situation.

    What DCI proposes is that code for a given use-case is separated out from the classes and put into a different artifact called context. Objects of different classes can enter into a relationship in this context and take part in interaction where they have different roles.

    The whole point of DCI is to make OO code more readable!

    That's how I would pitch it.

提交回复
热议问题