Click Here to Install Silverlight*
IndiaChange|All Microsoft Sites
Microsoft
Communities 
 
Chat Transcript
 
Chat Topic : Model View Controller
Chat Expert : Pooran Prasad (MVP)
June 08, 2005
 
 
subhashini (Moderator): hello everybody :) a very good evening to all of you !
subhashini (Moderator): Welcome to today's chat on Model View Controller
Babu: good evening to all....
subhashini (Moderator): we have Pooran Prasad ( MVP ) with us today.
subhashini (Moderator): To give you a quick intro about him
subhashini (Moderator): R Pooran Prasad is currently undergoing grooming program at NirmaLabs [ <http://www.nirmalabs.com> ]. Before that, he has worked for Itreya Technologies Pvt Ltd [ <http://www.itreya.com> ] for 3½ years. During his stay at Itreya, the open work culture and very supportive environment helped him to learn and hone his skills on latest Microsoft technologies, and share the same within the organization and communities. He has worked on almost all the Microsoft related projects in Itreya, including 3 products from inception to deployment.
He is currently undergoing business training and will like to keep in touch with technology and help the Indian communities flourish leaps and bounds. Contact him at itzpooran@msn.com
subhashini (Moderator): Before we start a few chat rules as always
subhashini (Moderator): Please refrain from sending any private messages to the expert during the chat
subhashini (Moderator): Chat Procedures:
This chat will last for one hour. During this hour, our Experts will respond to as many questions as they can. Please understand that there may be some questions we cannot respond to due to lack of information or because the information is not yet public. We encourage you to submit questions for our Experts.
subhashini (Moderator): We ask that you stay on topic for the duration of the chat. This helps the Guests and Experts follow the conversation more easily. We invite you to ask off topic questions after this chat is over.
subhashini (Moderator): Please use the radial button "submit a question " to ask any questions to the expert
subhashini (Moderator): So let's get the chat rolling and let's welcome Pooran
subhashini (Moderator): Hi pooran :) the stage is set ...
Pooran_MVP (Expert): : Hello Everybody .. Thanks for coming :)
suchi: hi pooran
Prash: Hi Poori :)
Pooran_MVP (Expert): Today, we will discuss MVC pattern, its uses and implementation details
Pooran_MVP (Expert): : I suppose the audience has worked on Web applications/Windows applications using .Net platform
Babu: ya...ofcourse
Pooran_MVP (Expert): : To give a brief intro about MVC pattern..
Pooran_MVP (Expert): : The Model View Controller pattern was invented in a Smalltalk context for decoupling the graphical interface of an application from the code that actually does the work.
Pooran_MVP (Expert): : To put it in simple terms ..
Pooran_MVP (Expert): : Input --> Processing --> Output
Controller --> Model --> View
Pooran_MVP (Expert): : Lets get deep in to each of these
Pooran_MVP (Expert): : VIEW
View is the graphical data presentation (outputting) irrespective of the real data processing. View is the responsible for look and feel, some custom formatting, sorting etc. View is completely isolated from actual complex data operations.
Pooran_MVP (Expert): : It is what user sees.
Pooran_MVP (Expert): : CONTROLLER
Controller is responsible for Notice of action. Controller responds to the mouse or keyboard input to command model and view to change. Controllers are associated with views. User interaction triggers the events to change the model, which in turn calls some methods of model to update its state to notify other registered views to refresh their display.
Pooran_MVP (Expert): : Through controller, user interacts with the application
Pooran_MVP (Expert): : MODEL
Model is responsible for actual data processing, like database connection, querying database, implementing business rules etc. It feeds data to the view without worrying about the actual formatting and look and feel.
Pooran_MVP (Expert): : This is underlying data from database/xml/app config etc.
Pooran_MVP (Expert): : Are there any questions till now?
k: Hi pooran, Now Can you give simple example where we can visualize this in an .Net Web App
Bijoy: SO MODEL is equivalent to all other tiers
Pooran_MVP (Expert): : Well, asp.net pages are the best examples.
k: So Is It like component Class->Code behind->Page
subhashini (Moderator): Hi k, could you please use the radial button "submit your question" to ask a question, else the expert would not be able to answer them easily
Pooran_MVP (Expert): : yes. in asp.net, .aspx page acts as view, .aspx.vb/.aspx.cs act as controller and your dataset acts as your model
subhashini (Moderator): request all of you to please use the "submit a question" radial button to ask any question
Pooran_MVP (Expert): : Bijoy, Model is your data. Usually, in medium and large applications, we do have separate Database classes where database access is through functions like getData, setData
Pooran_MVP (Expert): : Asp.net provides 2 tier architecture. However, we can write components for controller and database classes to make it much extensible
Pooran_MVP (Expert): : Lets proceed with advantages of MVC pattern
Pooran_MVP (Expert): : 1.Since MVC handles the multiple views using the same enterprise model it is easier to maintain, test and upgrade the multiple system.
2.It will be easier to add new clients just by adding their views and controllers.
3.Since the Model is completely decoupled from view it allows lot of flexibilities to design and implement the model considering reusability and modularity. This model also can be extended for further distributed application.
4.It is possible to have development process in parallel for model, view and controller.
This makes the application extensible and scalable.
Pooran_MVP (Expert): : While architecting the application, much care has to be taken to design the application to get maximum performance and scalability
Pooran_MVP (Expert): : with MVC pattern, we can make it possible
Pooran_MVP (Expert): : However there are some drawbacks
Pooran_MVP (Expert): : 1.Requires high skilled experienced professionals who can identify the requirements in depth at the front before actual design.
2.It requires the significant amount of time to analyze and design.
3.This design approach is not suitable for smaller applications. It Overkills the small applications.
venkat Murthy: Pooran, other than limitations of smaller applications, are there any benchmarks for MVC pattern. Like, when should we go for MVC, when not.
Pooran_MVP (Expert): : Venkat, As I told earlier, if we have architect in team or any professional with knowledge of implementing MVC pattern, it could be of help. There aren't any benchmarks I have come across
Pooran_MVP (Expert): : Designing apps requires quite a bit of time of development cycle. Most of the times 1/3 of time should go into designing application. Practical experience of object oriented application development is must
DMk: But why is this approach not suitable for smaller applications?
Pooran_MVP (Expert): : By smaller applications, I mean POCs [ Proof of concepts] and applications with less than 10000 lines of code. Most of the times it will not be necessary to implement MVC pattern in such cases
Pooran_MVP (Expert): : any more questions? request all of you to please use the "submit a question" radial button to ask any question
venkat Murthy: Thnx Pooran. Since we've lot of architecting models (Zachman, MDA.. etc), I was just curious enough to learn weather it could be of any use to apply MVC to a set of project types. Say for example, Zachman is recommended for EAI applications etc.
venkat Murthy: Correct me if i am wrong
Pooran_MVP (Expert): : If you are using ASP.Net to develop, you are using part of MVC pattern already.
Pooran_MVP (Expert): : And most of the times, we use mix of patterns in an applications. I have used this pattern in more than 4 projects
Pooran_MVP (Expert): : One of them is EAI application and it works wonderfully
Pooran_MVP (Expert): : I hope that answers your question
Jeya: Hi, We are developing an web based application using ASP.NET. We have done the business logic using C# in an Lib. We imported the Dlls and Business Access layer to our VS.NET. All the database transactions are through Stored Procedure. Do see is it correct?
Jeya: Does this fit into MVC pattern ?
Pooran_MVP (Expert): : 100%
Pooran_MVP (Expert): : This is the best example for MVC pattern
Jeya: Thanks.
Pooran_MVP (Expert): : In windows application world, this concept is not there by default. It is recommended to create components for data access.
Pooran_MVP (Expert): : Recently we designed an application where a model and controller component which was shared by both windows application and a related web application.
pradeep TP: hi all. may i know whether this chat is in progress.
Pooran_MVP (Expert): : Are there any more questions so far? Pradeep, yes it is.
k: Actually can we Call the DAL the MODEL or the BLL
Pooran_MVP (Expert): : Yes we can.
k: Both?
Pooran_MVP (Expert): : Yes. However, it is cautioned that considerable amount of time has to be spent before considering DAL and BLL.
pradeep TP: Pooran, where can i get the chat script of today's chat. I entered the chat room late.
Pooran_MVP (Expert): : Yes you can. Will be put up on the site.
pradeep TP: can i know whether there are any other web application architecture widely used in development.
Pooran_MVP (Expert): : K, if it is a medium sized application, and time is limited, it is preferred to develop custom components as understanding DAL and BLL will take time. If you have already worked on DAL and BLL, please go ahead and use them. For others who don't know DAL and BLL, it is Business Logic Layer (BLL) and Data Access Layer (DAL)
k: So Can we consider the Microsoft DataAccess Application Block as MODEL
Pooran_MVP (Expert): : K, yes you can.
Pooran_MVP (Expert): : Pradeep, There is maverik, zachman, mda, WebWork.. there are many of them
Pooran_MVP (Expert): : http://mavnet.sourceforge.net/ is one implementation for .net
Pooran_MVP (Expert): : variant of MVC
pradeep TP: thats great pooran. thank you . can you recommend any particular architecture which you think has worked for you most of the time.
Pooran_MVP (Expert): : I have worked with MVC pattern in almost 4 completely different projects. It works just fine. I am trying out Maverick for one project now
subhashini (Moderator): We have the last 7 mins for the chat to conclude
subhashini (Moderator): So please rush your queries to Pooran
Pooran_MVP (Expert): : In one application which needed access to java pates, where we had used struts
Pooran_MVP (Expert): : Any more questions
pradeep TP: pooran thank you for the answers. i am looking forward for the chat script.
k: So can we conclude that a 3-tier App is on MVC
Pooran_MVP (Expert): : Welcome Pradeep
k: Thanks Pooran
Pooran_MVP (Expert): : K, It is partly right. Even a 2 tiered or multi tiered application can be called MVC.
Pooran_MVP (Expert): : As you said, you are using BLL and DAL in web application. That constitutes 4 layers as we have 4 tiers
k: Ya ofcourse..
Pooran_MVP (Expert): : If it is simple asp.net application, our model is nothing but our dataset object which holds data
Pooran_MVP (Expert): : Are there any more questions?
pradeep TP: do we have a second part of the session?
k: Is It advisable to use Com+ Enterprise Services (for Transactions) in .Net web apps, or any disadvantage
Pooran_MVP (Expert): : We are planning for a session in BDotNet, Bangalore's user group where we take a sample application to explain the MVC pattern.
pradeep TP: when is that session going to happen?
Pooran_MVP (Expert): : Pradeep, sometime this month. Will let you know soon. keep watching http://groups.msn.com/bdotnet
Pooran_MVP (Expert): : k, the question is offtopic. However, the answer is, as Com+ enterprise services are to used with interop in .Net applications, which may give some performance issues, it is quite advisable to recode the services in .Net
k: Thanks Pooran
Pooran_MVP (Expert): : Welcome K
Pooran_MVP (Expert): : One last question before we wind up
subhashini (Moderator): So time's up!
subhashini (Moderator): and that brings us to the end of this chat
subhashini (Moderator): Please email Pooran for any additional queries
pradeep TP: what is Pooran's email address
subhashini (Moderator): at itzpooran@msn.com
subhashini (Moderator): Hope the chat was useful and informative for all of you.
subhashini (Moderator): Thanks for taking out time from your hectic schedule..
k: Thanks subhashini and Bye All
Pooran_MVP (Expert): : I suppose the MVC pattern as a concept is quite clear by now and this chat was informative. Feel free to attend the DotNet session for a practical example. Thanks for coming to this webchat.
subhashini (Moderator): and a big thanks to Pooran for hosting this chat
subhashini (Moderator): Please feel free to pool in your feedback at commind@microsoft.com
Pooran_MVP (Expert): : Thanks to Subhashini making this happen and bye to all
subhashini (Moderator): Have a lovely evening :)
 
     

©2009 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy Statement