• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

MVC design pattern in the Client Server Architecture?

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can i implement MVC design pattern in the Client Server Architecture? Whether MVC supports only n-tire architecure?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My client is browser based, web server is Apache/Tomcat, server components are java based..
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Whatever you say buddy! And I believe this tiny ad too:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic