This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Design Pattern doubt.

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An ebay.com developer has created a web applicatino that includes a servlet fo each use case in the application. These servlets have become rather difficult to maintain becase the request processing methods have become very large. ther is also common processing code in many servlets because these use cases are very similar.
Which two design patterns can be used together to refactor and simplify this application?


I can straight away see the front controller pattern fitting in with the "large number of request processing methods" but which is the other one?
MVC? this seems a bit tricky- when you're allowed to refactor your code?


And another question
The composite delegate pattern isn't in the objectives list, then why does it figure in the mock exam of the design patterns chapter in HFSJ? will there be surprises like this in the exam?
 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Front Controller and MVC
2. NO. Questions in exam will be fairly easy and straight.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

1. The answers should be Front Controller and MVC. MVC is not only the design pattern, but more it itself is architecture. The One of the Controller part of the MVC architecture can be Front Controller.

2. I think there is no Composite Delegate pattern defined in the J2EE patterns.

Thanks
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you people sure about this?

the answers in a mock exam say its front controller and "business delegate" but offers no explanation for the latter.

Can anybody please confirm this?
and those of you who have answered MVC, can you justify?
 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ONE - ONE servlet for each use case in the application.
TWO - COMMON request processing code.

The above are the KEY points of the question. Now take all the design patterns that you have studied.

BUSINESS DELEGATE - Possible. Because you transfer the common request processing code into a common component. FAVOURS TWO.

SERVICE LOCATOR - Again, Possible. The look up stuffs can be abstracted here. FAVOURS TWO.

FRONT CONTROLLER - FAVOURS ONE.

INTERCEPTING FILTER - Not Applicable here.

TRANSFER OBJECT - Not Applicable here.

=====
MVC - NOT APPLICABLE. This is because the main drawback of converting every use-case into MVC ends up in one M-V-C for every use case and thats why front controller pattern came into existence.

Please comment ....

Regards,
Mani
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i heard from this forum that Design Patterns are low scoring part in the scwcd.
Can u have notes on Design Patterns?
Any useful info,links,tips are welcome..
regards,
keshav..
reply
    Bookmark Topic Watch Topic
  • New Topic