What are the main advantages of MVC pattern over the old fashioned 3-layer pattern

前端 未结 4 597
迷失自我
迷失自我 2020-12-07 22:50

I am contemplating about using an MVC pattern in my new project and I can clearly see the main advantage of being able to put the data layer (the model) a little closer to t

4条回答
  •  青春惊慌失措
    2020-12-07 23:26

    Beside

    • code reuse,
    • separating of concerns,
    • less coupling between the layers,

    already mentioned by @bakoyaro and @arjan

    i think that MVC is better than 3-tier when combined with the "convention over configuration" pattern. (i.e. "ruby on rails" or Microsofts "MVC for asp.net").

    In my opinion this combination leads to to better and easier code maintanance.

    In the first place it makes learning the mvc-framework a bit more difficuilt since you have to learn the conventions (a la controllers go into the controllers folder and must be named xxxxxcontroller)

    But after you learned the conventions it is easier to maintain your own and foreign code.

提交回复
热议问题