what is the difference between 3 tier architecture and a mvc?

后端 未结 5 1437
不思量自难忘°
不思量自难忘° 2020-12-23 06:47

what is the difference between 3 tier architecture and a mvc ?

Are they same?

Both have 3 layers i.e model, views and controller

相关标签:
5条回答
  • 2020-12-23 07:34

    http://en.wikipedia.org/wiki/Multitier_architecture Briefly, in 3-tier architecture, presentation tier never communicates directly with data tier. In MVC, the relation among model, view, and controller is triangular. Two of three can communicate each other

    0 讨论(0)
  • 2020-12-23 07:35

    In MVC : MVC architecture is triangular: the view sends updates to the controller, the controller updates the model, and the view gets updated directly from the model

    In Three Tier : A three tier architecture is the client tier never communicates directly with the data tier In a Three-tier model all communication must pass through the middle tier

    0 讨论(0)
  • 2020-12-23 07:41

    Comparison with the MVC architecture

    At first glance, the three tiers may seem similar to the model-view-controller (MVC) concept; however, topologically they are different. A fundamental rule in a three tier architecture is the client tier never communicates directly with the data tier; in a three-tier model all communication must pass through the middle tier. Conceptually the three-tier architecture is linear. However, the [model-view-controller] MVC architecture is triangular: the view sends updates to the controller, the controller updates the model, and the view gets updated directly from the model.

    Source: http://en.wikipedia.org/wiki/Multitier_architecture#Three-tier_architecture

    0 讨论(0)
  • 2020-12-23 07:45

    MVC is a pattern used to make UI code easier to maintain and test. When the MVC pattern is used a larger portion of the UI code can be unit tested.

    Here is a good article which describes the MVC pattern in more detail: http://martinfowler.com/eaaDev/uiArchs.html

    3 tier architecture is a pattern used for a completely different reason. It separates the entire application into meaningful "groups": UI, Business Logic, Data Storage.

    So 3 tier application refers to all code in the application. The MVC pattern is a pattern used in the UI tier.

    Here is a good article on the 3 tier architecture: http://dotnetslackers.com/articles/net/IntroductionTo3TierArchitecture.aspx

    For further information you can search the internet and find a gazzilion articles on both subjects.

    0 讨论(0)
  • 2020-12-23 07:46

    Their are similar in a way, like:

    • 3 tier divides the whole app in: UI, logic and data
    • MVC divides the UI part in: view (kind of UI of the UI), model (data) and controller (logic)

    But the difference comes from how the tiers communicate with each other:

    • 3-tier: anything goes through the logic tier (a->b, b->c and c->b, b->a)
    • MVC: they communicate 2 by 2, in a triangular way. (a->b, b->c, c->a)
    0 讨论(0)
提交回复
热议问题