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 ??
They are distinct components of the architecture. In theory, each can be swapped without affecting the others.
E.g., the viewer serves two purposes:
- Allow the user to view the model.
- Allow the user to change/update the model.
Two viewers can differ on:
- What they allows the user view and the mechanisms to view them.
- What they allow the user to change and the mechanisms provided to change.
If there is a business case for existence of two viewers, there are no technical hurdles to support both.
If there is a business case for replacing the existing viewer with another viewer, there are no technical hurdles to do that either.
The Controller serves as the API layer to construct, query, and update the objects in the model. Speaking from a CAD background, the API layer could provide functions to:
- Facet a part for display purposes.
- Provide geometric queries, such as the closest point on face given another point.
- Compute the intersection of two surfaces to define the shared edge of two faces.
The Controller does not concern itself with who is requesting a certain action. If it supports the action, it performs it. Updates and improvements to the controller can be made independent of the Viewer and the Model.
The Model is the pure data of the application. It servers the data to the Controller. It is the least flexible of the lot. It is very easy to break the Controller by making changes to Model that are not backwards compatible or by introducing bugs while changing the Model. Even though it is separate from the Viewer and the Controller, any changes to the Model will have to made carefully so that the Controller and the Viewer are least affected by it.
2) Isn't MVC a form of client server architecture ??
It could be. In pure client server architecture, the client and server tend to be less closely tied than in a MVC architecture. A web browser is is rarely tied to the HTTP server. On the other hand, the GUI of a CAD application is very closed tied to the underlying model. There is no generic GUI interface that can be used to any CAD package.
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
It's the opposite. The client is the master and the server is the slave. The server responds to the requests made by the client.