This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock question - identify design Pattern

 
Swati Udas
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • 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 ?
 
Ezhil S Alagesan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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 Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic