*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Mock question - identify design Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Mock question - identify design Pattern" Watch "Mock question - identify design Pattern" New topic
Author

Mock question - identify design Pattern

Swati Udas
Ranch Hand

Joined: Aug 18, 2004
Posts: 121
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 ?


SCJP 1.4 (90%)<br />SCWCD 1.4 (88%)
Ezhil S Alagesan
Greenhorn

Joined: Aug 31, 2007
Posts: 3
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.


I can, But I won't
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

It's pretty straight forward that this design pattern corresponds to MVC.


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Swati Udas
Ranch Hand

Joined: Aug 18, 2004
Posts: 121
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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: Aug 31, 2007
Posts: 3
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

Joined: Aug 18, 2004
Posts: 121
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock question - identify design Pattern
 
Similar Threads
doubt in design patterns
Question on design pattern
how can i implement mvc structure in ejb layer
Standard Tags, Design Pattern Qs
pattern ques.