![]() |
![]() |
Three-Tier | MVC |
Three-Tier
A 3-tiered system really is made up of layers (think of cake layers). The UI Layer has access to the Business Logic Layer, and the Business Layer has access to the Data Layer. But the UI Layer cannot directly access the Data Layer. In order for the UI Layer to access data, it must go through the Business Logic Layer via some kind of interface. If it helps, you could think of each layer as one big loosely coupled component with strict design rules of access between layers.MVC (Model View Controller)
In contrast, the MVC pattern obviously does not keep a layered system. The Contoller accesses the Model (a runtime data repository) and the View. The View then accesses the Model. Exactly how does that work? The Controller ultimately is the logical decision point. What sort of logic? Typically, the Controller will retrieve, build, or modify a Model base on some triggered action. The Controller then decides which View is appropriate via some internal logic. At that point the Controller will push the Model to View.Note: Because I mostly develop with .NET, Microsoft has adopted the MVC pattern for ASP.NET with their own platform (see http://www.asp.net/mvc). You can certainly use the MVC pattern without Microsoft's platform, but why reinvent the wheel? I have been very happy using it so far.
Hi Suma,
ReplyDeleteI'm not sure if there is a good code example that will clearly show this. Your MVC project is your UI layer. Your business logic or mid-tier layer technically could be in your MVC project, but I prefer to have any other combination of linked projects or services externally or in your solution. This keeps some defined boundary (though not perfect) for other developers to have the UI and mid-tier layer separated. Your data layer is typically something like a database or file system. You keep your three-tier system in line by never allowing your UI and data layers to communicate directly with each other. The UI layer must make calls to the business logic layer to get data from the data layer.
I hope that helps. Let me know if you need any further clarification.
Hi BRYAN recently i attended one interview in that they asked me what is MVC architecture and give one example to illustrate.I just explained what is MVC. but i cant able to explain the example.Can u pls put ur effort to give simple example based on MVC architecture.Thanks in advance BRYAN.
ReplyDeleteHii This is sandeep Rath(software developer in mvc) any body wants asp.net mvc realtime projects then mail me.my mailid is sr034937@gmail.com
ReplyDeleteHi Sandeep,
DeleteIs it Free.
Regards
Baiju
Hi,
ReplyDeleteWhat's difference between DAL, Model and BLL in your example?
Programming is combination of intelligent and creative work. Programmers can do anything with code. The entire Programming tutorials that you mention here on this blog are awesome. Beginners Heap also provides latest tutorials of Programming from beginning to advance level.
ReplyDeleteBe with us to learn programming in new and creative way.
Great work to sharing this. It is really a great work and the way in which u r sharing the knowledge is excellent.
ReplyDeleteThanks for helping me to understand advaced concepts. As a beginner in Dot Net your post help me a lot.Thanks for your informative article.
dot net training in velachery | dot net training in chennai
Thanks for your informative article. Dot Net Training in Chennai
ReplyDelete