Free Essay

Abt1 Task 3

In:

Submitted By helm2
Words 549
Pages 3
MVC and Decorator
Software Design Patterns
ABT1 Task 3
January 2015
A Basic MVC Pattern Example
MVC Component:
MODEL
 Data / Knowledge that represents an object
 Logic data often to update controller state
 Model can be a single object or many

MVC Component:
VIEW
 View: Represents the visual representation of the model data whether graphic, text, or other supported format.
 Presentation filer by revealing only what attributes are indicated
 Encapsulates data provided by model, by bringing it to life and displaying it to user
 View has to be aware of the attributes of a model by asking and receiving appropriate messages

MVC Component:
CONTROLLER
 Controller: Interacts with both model and view components by controlling the data flow into the model object.
 It is the link between a user and the system.
 Able to take model language and implement in view.
 Updates view when changes are present.
 Provides means by which a user can output by means of menus, buttons, mouse and other command and data avenues.
 Calls appropriate resources to carry out operations

Examples of MVC Applications
Websites
 Model: Data that controller will manage.
 View: Display requested data as indicated by user
 Controller: Manages user requests received as http or similar. Calls and coordinates resources to perform actions.
Calculator
 Model: input based on user interaction and requested data.
 View: Display screen of input and results of Model calculations.
 Controller: User interface buttons to enter numeric values and functions to send to Model.
A Basic Decorator Pattern Example
Decorator Pattern: Component and Decorator
 Component: Original programming or application before modification.
 Decorator: References and confirms component and interface relationship.
 Component is sub-classed into Decorator so all instances of original class are affected by Concrete Decorator change.
 OPEN CLOSE PRINCIPLE states that classes are open for extension but closed for modification thus Decorator Pattern addresses this issue.

Decorator Pattern:
Concrete Decorator and Concrete Component
 Concrete Decorator: used to override Component methods that need modification as result of a Decorator.
 Concrete Decorator: adds actual additional feature sets, function and responsibly to Component by overriding
 Concrete Decorators can be temporary and often referred to as WRAPPERS. Can be stacked and combined on a per user basis.
 Alternative to sub-classing which changes behavior at compile time, all instances of original class, whereas decoration institutes new behavior at runtime for individual objects.
 Concrete Component: is the implementation of the interface for the Component. Continues to be pointed to by Decorator and Component as additional functionality are stacked.

Examples of Decorator Pattern Applications
Cell Company Plans
 Component: SIM card programming designed to access network and initiate phone calls basic to all cell phones.
 Concrete Component: User interface as in phone OS and dialer.
 Decorator: Subclass of component acting as mediator between new features / plans and original basic operation.
 Concrete Decorator: To add features such as data for internet access, unlimited SMS, unlimited or specified data amounts. In any combination.
Weather Widgets
 Component: Weather application programming that accesses frequently updated weather database entries including allergy, wind, radar, etc...
 Concrete Component: User interface as in entry screen to customize city or specified data.
 Decorator: Subclass of component acting as mediator between new features and original operation.
 Concrete Decorator: Used to customize view, user experience and template design. Changes as necessary including Widget design. Customizable as application allows.
References

Similar Documents

Premium Essay

Dissertation on Real Estate

...Dissertation on the Real Estate Sector of Mumbai and the Indian Middle Class Abstract The global financial meltdown had hit the real estate sector all around the globe, and Mumbai real estate sector is one such amongst them. The specific segment is plagued by reduction of demands, lowering of prices, inventory accumulation etc. In order to maintain their sustenance, they now want to target the middle class segment of the society. The entire purpose of this dissertation was to identify in the present economic conditions of the country, the target customer for such real estate sector. In order to conduct the research, a mixed research methodology is adopted deploying both qualitative research as well as quantitative research. Relevant research instruments were chosen, and 10 respondents were interviewed for the qualitative research and 300 individuals were undertaken in the quantitative research methodology. It was found that indeed the middle class with their high aspiration levels, and disposable income were the ideal target for real estate. However, in order to further attract the target customers, a host of suggestions are made. This dissertation is created through thorough referencing from academic journals, books, reports, newspaper articles etc. This paper would also be immensely helpful for students aiming to understand a clear picture of the real estate sector of Mumbai on ways to maintain its growth. Table of Contents Abstract 2 Introduction 5 Background...

Words: 16681 - Pages: 67