Designing and Developing a Component

Posted on
Like what you see? Share it.Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone

Questions derived from the 70-547VB – PRO: Designing and Developing Web-Based Applications by Using the Microsoft .NET Framework (VB.NET).

 

Objective: Designing and Developing a Component
SubObjective: Create the high-level design of a component

 

Item Number: 70-547VB.3.2.2
Single Answer, Multiple Choice

 

You develop Web-based applications. You are required to develop a component that will log the raw HTTP request and response for a Web application. You must ensure the component will be modular and provide extensibility to log other information in the future.

 

Which design pattern should you consider for the component?

 

 

  1. Front Controller
  2. Intercepting Filter
  3. Page Controller
  4. Observer

 

Answer:
B. Intercepting Filter

 

Tutorial:
You should consider the Intercepting Filter design pattern for the component to meet the requirements. The Intercepting Filter design pattern provides a processing mechanism before and after an application processes a request or response. This would be appropriate to limit, expand or log the data in a request or response. In this scenario, you must log the raw HTTP request and response with a pattern that provides modularity and extensibility. Because the processing of the request and response occur before the application or page processing, Filter components could be added, modified, removed or their order shuffled without affecting the processing in the application. Thus, the Intercepting Filter design pattern meets the requirements.

 

You should not consider the Front Controller or Page Controller design patterns for the component to meet the requirements. Both of these patterns describe how to centralize application processing and separate it from the underlying data and output. These patterns describe application processing, not how to intercept data before or after it is processed. The Page Controller pattern describes a component that receives a user request for a page, retrieves the requested data, and determines the appropriate response. The Front Controller pattern is similar to the Page Controller pattern, except it centralizes all control for the entire Web application. In this design pattern, a user request is received by a centralized Controller component that retrieves the requested data for a specified command and it forwards the data to the appropriate Controller for that command. The recipient Controller then processes the forwarded request and returns the response. This pattern is meant to create a hierarchy of Page Controller components under a centralized application Controller component.

 

You should not consider the Observer design pattern for the component to meet the requirements. The Observer pattern does not provide a mechanism for input or output pre-processing or post-processing. The Observer pattern describes how to have observers or subscribers monitor a subject object’s state changes. A subscriber could log the change events of a subject, but to log raw HTTP requests and responses, an Intercepting Filter component would be required to publish these events. This would then make the Filter component itself the subject and another component as a subscriber would be required to log the information. This provides unneeded complexity and is primarily based on the Intercepting Filter pattern.

 

Reference:
MSDN Library > Servers and Enterprise Development > Enterprise Architecture, Patterns, and Practices > Microsoft patterns & practices > Enterprise Solution Patterns Using Microsoft .NET > Web Presentation Patterns

 

MSDN Library > Servers and Enterprise Development > Enterprise Architecture, Patterns, and Practices > Microsoft patterns & practices > Enterprise Solution Patterns Using Microsoft .NET > Web Presentation Patterns > Intercepting Filter

 

MSDN Library > Servers and Enterprise Development > Enterprise Architecture, Patterns, and Practices > Microsoft patterns & practices > Enterprise Solution Patterns Using Microsoft .NET > Web Presentation Patterns > Page Controller

 

MSDN Library > Servers and Enterprise Development > Enterprise Architecture, Patterns, and Practices > Microsoft patterns & practices > Enterprise Solution Patterns Using Microsoft .NET > Web Presentation Patterns > Front Controller

MSDN Library > Servers and Enterprise Development > Enterprise Architecture, Patterns, and Practices > Microsoft patterns & practices > Enterprise Solution Patterns Using Microsoft .NET > Web Presentation Patterns > Observer

Like what you see? Share it.Share on Google+Share on LinkedInShare on FacebookShare on RedditTweet about this on TwitterEmail this to someone
cmadmin

ABOUT THE AUTHOR

Posted in Archive|

Comment: