File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes MVC design pattern in the Client Server Architecture? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "MVC design pattern in the Client Server Architecture? " Watch "MVC design pattern in the Client Server Architecture? " New topic
Author

MVC design pattern in the Client Server Architecture?

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1372
Can i implement MVC design pattern in the Client Server Architecture? Whether MVC supports only n-tire architecure?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
You really could model MVC inside each layer. Any given layer's API could be a view. Or you could picture a larger, more abstract MVC for the whole structure.

Describe your client & server a bit ... browser and web server or Swing Client and EJB server or some other variation? There is probably some flavor of MVC that can be used in just about any variation.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1372
My client is browser based, web server is Apache/Tomcat, server components are java based..
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It's common to do a flavor of MVC for web apps like that. In general servlets act as controllers, JSPs act as view and some kind of "plain old java objects" act as the model.

In one variation, you build a servlet/controller per web page. It interprets the entry fields and buttons (user gestures) for one web page. Other variations use a single servlet for the whole application. It maps a URL parameter or a combination of hidden fields to java classes that do controller behaviors.

The controller asks POJOs to do some work and then pass the results on to a JSP as a request object parameter. The JSP pulls data off the request and builds the next page.

Struts is one example of a framework that does all this. I made my own at work with a single servlet and a set of Commmand pattern objects. This stuff can be as simple or as complex as you like.

Hope that helps!
 
 
subject: MVC design pattern in the Client Server Architecture?