wood burning stoves 2.0*
The moose likes Servlets and the fly likes Advantages of MVC over PageCentric architectures... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Advantages of MVC over PageCentric architectures..." Watch "Advantages of MVC over PageCentric architectures..." New topic
Author

Advantages of MVC over PageCentric architectures...

mars76
Ranch Hand

Joined: Nov 30, 2000
Posts: 30
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
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
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
Vishakha Ahuja
Ranch Hand

Joined: Sep 13, 2000
Posts: 191
Hi,
I know about MVC architecture, but what is this Pagecentric architecture ?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

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

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
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

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56

  5. [This message has been edited by Desai Sandeep (edited April 26, 2001).]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Advantages of MVC over PageCentric architectures...