Model View Controller vs Boundary Control Entity

后端 未结 4 1872
独厮守ぢ
独厮守ぢ 2020-12-16 00:35

What\'s the difference between MVC (Model View Controller) and BCE (Boundary Control Entity), I know that these two pattern are similar, but there\'s a difference, what is t

4条回答
  •  既然无缘
    2020-12-16 01:12

    BCE is how you create decoupled components that follow the open/close principle, dependency inversion and interface segregation. It is what you want to design the core of your application.

    BCE consists of a combination of the following elements: Boundaries to other components, logic controllers and business entities.

    Each boundary which consists two interfaces:

    • An input interface, responsible for exposing only the methods of the business logic that are needed to be known by the other component (interface segregation)
    • An output interface, responsible for not coupling the business logic to a specific component's implementation, rather make it so that the logic defines the contract and the other component adapts to it (dependency inversion + observer)

    Note: You should strive to make your boundaries general and abstract (ie. do not leak concrete details in the interface). Ideally you should be able to replace the external component with a different one without breaking the interface or the core business logic code.

    Each controller contains the logic for a use-case. This is where the application specific logic is.

    Entities represent business objects, such as an invoice, a client, a report and other domain objects. They are essentially data-structures but contain code which is not specific to a particular use-case. Eg: invoice.addItem().

    The controller will receive instructions from the input boundary coordinate the entities to update the application state, produce some result and send it over the output boundary.

    I don't know MVC, so I leave this as half answered

提交回复
热议问题