Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Control Boundary (ECB) vs Model View Controller (MVC) [duplicate]

I'm not sure if i got the right concept.

I was told by people that

Boundary = View

Entity = Model

Control = Controller

however based on my knowledge of MVC. (fat model, thin controller)

Isn't the Boundary = Controller, Control = Model (the busienss logic) and Entity = Model (The orm classes or similar entity classes which does only crud ).

I may be wrong, please guide me!

like image 693
ericlee Avatar asked Oct 02 '15 17:10

ericlee


3 Answers

The two are very similar. The main difference is that MVC is typically used in user interface design whereas ECB is most often used in business logic. Here's a portion of a presentation by Adam Bien, who is known for promoting ECB, that helped me understand the difference between the two.

like image 155
Patrick Garner Avatar answered Oct 12 '22 11:10

Patrick Garner


Actually your first definition is simply correct. The meaning of words is sometimes confusing. The following link confirms and summarizes both patterns (naming ECB a variant of MVC): The Entity-Control-Boundary Pattern

like image 29
qwerty_so Avatar answered Oct 12 '22 09:10

qwerty_so


Your explanation is correct. But they are not similar. MVC is for user interaction. Business rules are not bound to users directly and even not I/O devices like the internet itself. The ECB pattern is used for separating business entities from the boundary (mvc framework, ORM's). Entities are business objects, they know nothing about databases, orm's. The control is not a controller like in MVC, it can be a Command which represents a use case. Only the Control may access the business entities. Business entities are a world of their own, completely isolated from the MVC layer. It can be a business framework with patterns, principles, types and separated layers of its own, that does not wish to interact with anything related to I/O.

We can combine MVC with ECB like this:

User <-> Controller [Boundary] <-> Control (use case) [Control] <-> Business entities [Entity] <-> Other business entities [Entity]

like image 43
Douma Avatar answered Oct 12 '22 10:10

Douma