File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Any real life problems with MVC ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Any real life problems with MVC ?" Watch "Any real life problems with MVC ?" New topic
Author

Any real life problems with MVC ?

Celina Paul
Greenhorn

Joined: Nov 01, 2003
Posts: 16
I read a lot about MVC recently and was impressed to see how better the model is than the old Page 1 architecture.

But I did not find anywhere any real life issues mentioned with MVC.

What I would like to know is when implementing MVC, what should be avoided, etc.

Also, if there is any link explaining that, please let me know.
[ July 15, 2004: Message edited by: Celina Paul ]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
MVC can invite code bloat and overly complex solutions to simple problems if not used carefully.

Examples are small applications that are implemented on a framework like Struts that would have been maybe 1000 lines of code but because they use Struts explode to 10.000 lines or more.

It's basically the same as every pattern or technology: beware to not use it if not appropriate.


42
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

I will somewhat disagree: I think it's always a good idea to apply good patterns to even simple problems.

But I agree that it must be done carefully. Applying a bloated framework like Struts to a simple web app is a bad idea (actually, I'm on record as asserting that applying a bloated framework like Struts to any app is a bad idea -- but that's another show).

It's quite possible to apply proper patterns without code bloat. Sure you might end up with a greater total line count than without, but that's far less important than a good organization and structure.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
arnel nicolas
Ranch Hand

Joined: Dec 16, 2003
Posts: 149
Simple solution for simple problem. You really don't need to kill an ant using your 12 gauge shotgun.
Ken Robinson
Ranch Hand

Joined: Dec 23, 2003
Posts: 101
I do not think you can really go wrong with good MVC practices.

As with anything, get comfortable with the (MVC) concepts. Think of how you would do it and why it makes sense. THEN, not before, go and see what offerings there are. If you come to your own conclusions it will be much easier to evaluate API/Frameworks that are available.

Many available API/Frameworks will try to 'sell' themselves with a quick 'we offer MVC' explanation without really telling how they do it or why it's better than just good practice. Also, many people will all but dress in white robes with little armbands and tout how much they like framework A over framework B. Don't get caught up in that, it's such a waste of time in my opinion.
Dimitris Zavaliadis
Greenhorn

Joined: Jul 19, 2004
Posts: 5
Hi Celina Paul

Here are some links that you might find useful:

http://www.stardeveloper.com:8080/articles/display.html?article=2001060501&page=1

http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

http://java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/

http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html

http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html

http://www-106.ibm.com/developerworks/java/library/j-struts/

Hope this helps
Dimitris
Rafa Moreno
Ranch Hand

Joined: Nov 19, 2002
Posts: 53
We are moving from a model 1-2 to a MVC with struts, at first time I found hard to change the way of thinking but at the same time simpler for the processes.

I will stay with MVC even for the simplest projects if it's possible.

Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by Bear Bibeault:
I will somewhat disagree: I think it's always a good idea to apply good patterns to even simple problems.


I never said you shouldn't, just that the same patterns and pattern combinations aren't always correct for different sized applications.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Any real life problems with MVC ?