开发者

How to decide which one should use in web application MVC or 3 tier architecture?

If we will have to chose any one architecture patter开发者_如何学Pythonn for web application in .Net, which one will be the best, MVC or 3 tier, How to decide ?


Jeevan,

I think you're unfortunately following a train of thought that many developers new to MVC take insofar as you've been 'fed' a belief that the 'M' in mvc (model) is purely a linq2sql flat implementation and that's it for the model. Not so... in our apps we have to cater for a mixture of web/desktop and handheld devices all using various areas of common functionality within them. we therefore have created a 'BLL/DAL' dll with all our business logic that is referenced as the 'M' in our mvc apps. This same 'bll/dal' is used in our webforms apps as well as in our desktop apps. in one current app, we're hooking into an oracle backend with our bll/dal dll and using MVC purely as a RESTful service acting as an intermediary between two legacy systems. given the design of our bll/dal dll, we could just as easily switch that to sqlserver, should (as and when) the business require.

so in a nutshell, the proposition of choosing MVC or 3 tier (and i actually think you are meaning layered, rather than tiered [which relates more to physical separation of functionality/services]) is totally a moot point as they are converging, rather than disparate technologies.

hope this helps - i'll try to source some examples via mr google later today to exemplify the fullness of my approach.

[edit] - from a similar question here on SO; N-tier just refers to the physical structure of an implementation. These two are sometimes confused because an MVC design is often implemented using an N-tier architecture.

MVC Vs n-tier architecture

in a nutshell, one is object/API design, one is system architecture; both can live happily together.


Both are pretty high level concepts, and with all high level concepts there are no definitive answer. Moreover, you can quite succesfully mix them. For example have multitier application on the presentation tier, provide your application is large enough that this is required(for instance you had large cluster of data + analytics layer + reporting layer).

Everytime you're choosing between those 2, I would suggest thinking about these aspects:

  1. What architecture you and your team feel most comfortable with in order to make a deadline
  2. How complex your application really is and what will be specific benefits of using either of those architectures
  3. What are usage pattern that your system will exercise, and which architectural solution fit address needs of these usage patterns better
  4. How maintainable each solution will be

This list could go on of course, but I think these 4 things will get your on the right track.

From my experience architecture of more or less complex, real life system(that is not academic fantasy ones) is never MVC or 3 tier, but always is quite a mix of many things :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜