This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Advantages of MVC over PageCentric architectures...
mars76
Ranch Hand
Joined: Nov 30, 2000
Posts: 30
posted
0
Hi, Generally while building web sites using Servlets and JSP, the architectures followed are MVC and PageCentric.. But most of the people will advise that it's better to use the MVC model. What are the advantages of using MVC over PageCentric .. Thanks in advance.. Sateesh
Phil Hanna
Ranch Hand
Joined: Apr 05, 2001
Posts: 118
posted
0
Testing and debugging, for one thing. This is much easier in an MVC architecture, because you can isolate each component. Your model code can be driven by a batch Java application that logs the responses and compares them to expected values, for example. ------------------ Phil Hanna Sun Certified Programmer for the Java 2 Platform Author of : JSP: The Complete Reference Instant Java Servlets
Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
Jason Menard
Sheriff
Joined: Nov 09, 2000
Posts: 6450
posted
0
I could be totaly mistaken, but the page-centric model is mostly a holdover from ASP and other web languages that are inherently not very object oriented. There are a couple problems with page-centric in my opinion. The first is that it is very hard perform maintenance, or changes on a project of any decent size. Just try tracing the flow and interrelations between pages when using a page-centric "model" (actually i think page-centric is more of a lack of an architectural model). The other problem is when working in teams of programmers and designers. In business, the programmer is not necessarily the designer and the designer does not necessarily know how to program. The designer is mainly concerned with how the page looks, concentrating on graphics, html, and layout. They often have serious difficulties working with a page that is a mix of html and some programming language. Now try to get even a few programmers to coordinate on a page-centric application and there will be much more coordination required then there might be under an MVC design. With MVC however, programming in a team is about as easy as it gets. For one you can apply sound OO design techniques to the project before you even start coding. Next it is a simple thing to do to divide up responsibility between your various programmers and designers. For example Programmer A may only have to worry about the control, Programmers B and C are handling the model, and Programmer D and Designer A will work on the views. Further MVC makes maintenance and performing any changes a relatively simple process, since the particular piece of code concerned may be easily isolated. If for example you decided that you also had to provide an XML-based view, this would be a relatively simple thing to do with MVC. With a page-centric design it could involve significant re-writing of the application. Just my $.02
Hi, I know about MVC architecture, but what is this Pagecentric architecture ?
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
In addition, once you have seperated View from the Model, you also can apply personalization. You can give your users the options from which they personalize the View which adds to the Business Value and attracts more users. The most famous and poineers of this techinique is myYahoo. Each user is given a chance to create their own profile/View of Yahoo. This can be done because the View is different from the Model which is Yahoo, the bottomline. All users are on the same Model but view it acc to their preference. Your News, Your Horoscope, Your Stock Protfolio. I guess there is a lot of emphasis on personalization software now-a-days in the market. regds. - satya
Hi, When you talk about this topic, the very first thing that comes in my mind is the maintenance issue If you consider the page-centric approach, your business logic is along with the presentation logic.Later on, if there is a requirement to make changes to your code, it becomes very difficult to incorporate those changes.Instead you may consider using the component-based architecture of Model-View-Controller, which gives you more scability, maintainability and flexibility. You can see the immediate advantage of MVC model in JSP only solution.You may consider making JSP pages for presentation (the View) and request processing(the Controller), and place all business logic in the Beans (the Model).Designing applications in this fashion, allows you to safely move to the combination of Servlet and JSP solution, when maintenance becomes difficult. Hope this helps Regards, ------------------ Sandeep Desai vgdesai@bom3.vsnl.net.in
Sun Certified Java ProgrammerScored 93 per cent
Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
IBM Enterprise Connectivity with J2EE Scored 72 per cent
Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
[This message has been edited by Desai Sandeep (edited April 26, 2001).]
<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>