• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Mock question - identify design Pattern

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the last question from Quiz on Design Pattern on website by Marcus Green.

Your junior designer has bought you a design that embeds html in print statements and you are concerned that the business and presentation logic are tightly combined. You are concerned that this will make it difficult to modify the display without touching the business logic. Which design pattern could you recommend to help separate presentation design from business logic?

I was able to figure that the design pattern has to be either MVC or front controller. Could someone help me understand why the design pattern here is Front Controller and not MVC ?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also get confused a little with these Either-MVC-or-Front-Controller type questions. May be the clue is lack of any data access components which will make us point to MVC pattern.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's pretty straight forward that this design pattern corresponds to MVC.
 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the answer given on the website says it should be Front Controller
And would you please explain what is so clear about it being MVC/FC ?
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doesn't this line from the question "Which design pattern could you recommend to help separate presentation design from business logic?" a good reason to say that MVC suits the given criteria?
 
Ezhil S Alagesan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The below stuff is taken from peabodyonscwcdpatterns doc on Front Controller

A centralized access point for presentation-tier request handling.
Forces
* You want to avoid duplicate control logic.
* You want to apply common logic to multiple requests. (IF)
* You want to separate system processing logic from the view. (MVC)
* You want to centralize controlled access points into your system. (IF)


Could anybody infer something with this piece of information.
 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well.. my mistake..
the answer on the website says MVC is correct.
May be reading more here -
http://java.sun.com/blueprints/patterns/MVC-detailed.html
will help us undertand the MVC pattern more clearly.
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic