Architecture – How is MVC different from Layered

architectural-patternsArchitecture

Based on this book , refering to pages 156 to 159 , it talks about the two different types of software architecture model : MVC & Layered .

There are distributed system architecture patterns such as : Master-Slave , 2 tier client-server , multi-tier client server , P2P

These are my questions :

1) In MVC , there is the Model , View , Controller which is in essence a three layer architecture with View on top , Controller in the middle , Model on the bottom and all three layers are only able to communicate with the layers above and beneath them only which is exactly the same as layered architecture . What is the actual difference between them ??

2) Isnt MVC a form of client server architecture ??

3) Master-Slave seems exactly like 2 tier client-server where the server is the Master and the client is the slave , I dont understand how Master-Slave differs from Client-Server

Best Answer

MVC and Tiered applications are very different problems. One is an architectural pattern, and the other is a design pattern.

In reality, there is nothing that keeps MVC and layered architecture as mutually exclusive ideas.

  • Model: You have domain objects which represent the application's logical entities
  • Controller: You have objects/actions which map UI interaction to the domain model.
  • View: You have presentations for the domain objects that interact with controllers and bind to the objects in some way.

Tiered applications may have you arrange the model portion in a "Data Layer", and incorporate the controller logic in an "Application Layer", and finally tie it all together using views in the "Presentation Layer".

More often then not, these layers are often heavy handed, and the entire MVC approach can be applied in one layer, with a database back-end.

Related Topic