This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Mock question - identify design Pattern

 
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 ?
 
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.
 
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE 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: 10192
3
Mac PPC Eclipse IDE 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.
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic