0

I am trying to figure out the difference between MVC and 3-tier architecture. I know that MVC, in big applications, applies to the presentation tier of 3-tier architecture:

If I'm right, what's the difference between the Model layer of MVC and the Logic tier of 3-tier Architecture?

tereško
  • 58,060
  • 25
  • 98
  • 150
eslXst
  • 131
  • 2
  • 10
  • I am no expert in n-tier, hence the comment instead of answer. As I see it, n-tier pattern is on different scale then MVC. Latter defines the flow of information within an application, while n-tier defines the flow of information between applications withing an infrastructure. But then again ... I am probably wrong about this. – tereško Dec 10 '13 at 18:51

2 Answers2

0

Another way to think of it is that MVC can act as the presentation layer of your 3 tier architecture.

To specifically answer your question, in MVC the Model is a representation of your data. the View presents and acts on your data and the Controller marshals your Models between the rest of your architecture (perhaps the BL of your 3 tier architecture) and the Views.

Maess
  • 4,118
  • 20
  • 29
  • is there a direct relation between the Model layer and the Business logic? The thing that's confusing me is that the Model layer is responsible for the Business logic. I've recently started with JavaEE, but I can't understand how combining these 2 concepts, MVC and 3-tier. – eslXst Dec 10 '13 at 19:46
  • No its apples and oranges. The model layer is certainly not responsible for the logic, that's a violation of the MVC pattern. The model is supposed to be 'dumb'. – Maess Dec 10 '13 at 19:57
  • @Maess that is **completely wrong**. Model is a layer, which contains business logic of the application. That includes implementation of *domain model* (using [domain objects](http://c2.com/cgi/wiki?DomainObject)), services and persistence abstraction. **Model is not a class or object**. There are two primary layer in MVC architecture: presentation layer (views, controllers, stuff) and model layer (domain objects, services, persistence). – tereško Dec 10 '13 at 20:06
  • @Maess, thank you for you answer. Till now I agree with you, but can you please make a projection of MVC on 3-tier architecture? So, let's start from the point that Tiers are places where layers are deployed. if I'm right,How can I deploy and distribute these layers (Model, View and Controller) in 3-Tiers Architecture? PS: The only information that I found: MVC, in big applications, applies to the presentation tier (the first tier of 3-tier architecture). – eslXst Dec 10 '13 at 20:29
0

I basically treat the MVC Model as the Entities in the Layered Architecture. I have thought about this sometime back and have written about it here. http://serena-yeoh.blogspot.com/2011/12/mvc-and-layered-architecture.html

You can also get a sample implementation in code from here http://layersample.codeplex.com/