DOC PREVIEW
UMBC CMSC 331 - Model-View-Controller design pattern

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1ModelModel--ViewView--ControllerControllerdesign patterndesign patternOverviewOverviewIntroduce concepts: design pattern, CRC Introduce concepts: design pattern, CRC cardscardsIllustrate with modelIllustrate with model--viewview--controller controller patternpatternShow how a programming language Show how a programming language (Java) supports MVC pattern(Java) supports MVC patternDesign PatternsDesign Patterns“Making abstractions which are powerful and deep is an art. It requires tremendous ability to go to the heart of things, and get at the really deep abstraction. No one can tell you how to do it in science. No one can tell you how to do it in design.”– Christopher AlexanderChristopher AlexanderChristopher Alexander““A pattern language actually gives us the powerA pattern language actually gives us the powerto generate these coherent arrangements ofto generate these coherent arrangements ofspace. Thus, as in the case of natural languages,space. Thus, as in the case of natural languages,the pattern language is generative. It not onlythe pattern language is generative. It not onlytells us the rules of arrangement, but shows ustells us the rules of arrangement, but shows ushow to construct arrangements how to construct arrangements ——as many as we want as many as we want ——which satisfy the rules. . . When a person is faced with an which satisfy the rules. . . When a person is faced with an act of design, what he does act of design, what he does is governed entirelyis governed entirelyby the by the pattern language which he has in his mind at that moment... pattern language which he has in his mind at that moment... His act of design, whether humble, or gigantically complex, His act of design, whether humble, or gigantically complex, is is governed entirely bygoverned entirely bythe patterns he has in his mind at that the patterns he has in his mind at that moment, and his ability to combine these patterns to form a moment, and his ability to combine these patterns to form a new design.new design.””––Christopher AlexanderChristopher Alexander2Software design patternsSoftware design patternsStarting in the late 80Starting in the late 80’’s, OO researchers developed s, OO researchers developed the idea that software design was like other design the idea that software design was like other design disciplines and could benefit from recognizing disciplines and could benefit from recognizing common, successful design patterns.common, successful design patterns.Classic book: Classic book: Design Patterns: Elements of Reusable ObjectDesign Patterns: Elements of Reusable Object--Oriented SoftwareOriented Software; Erich Gamma, Richard Helm, Ralph ; Erich Gamma, Richard Helm, Ralph Johnson, and John Johnson, and John VlissidesVlissides; Addison; Addison--Wesley, 1995 Wesley, 1995 Good starting point: Good starting point: http://hillside.net/http://hillside.net/Basic idea: competent software designer is familiar Basic idea: competent software designer is familiar with a large set of design patterns that with a large set of design patterns that ““work wellwork well””..When presented with a new problem, you should When presented with a new problem, you should start by selecting one or more patterns that start by selecting one or more patterns that ““fitfit””the the problem.problem.Why Use Patterns?Why Use Patterns?They have been proven.They have been proven.Patterns reflect the Patterns reflect the experience, knowledge and insights of experience, knowledge and insights of developers who have successfully used them.developers who have successfully used them.They are reusable.They are reusable.Patterns provide a readyPatterns provide a ready--made solution that can be adapted to different made solution that can be adapted to different problems as necessary.problems as necessary.They are expressive.They are expressive.Patterns provide a Patterns provide a common vocabulary of solutions that can common vocabulary of solutions that can express large solutions succinctly.express large solutions succinctly.Support for PatternsSupport for PatternsThe abstraction mechanisms inherent in The abstraction mechanisms inherent in OO languages are ideal for implementing OO languages are ideal for implementing patterns.patterns.As we will see, the Java Observer interface As we will see, the Java Observer interface and Observable class (in and Observable class (in java.util) provide provide useful tools to implement the modeluseful tools to implement the model--viewview--controller pattern.controller pattern.CMSC 446 Intro to Design PatternsCMSC 446 Intro to Design PatternsMW 7pm, Spring 2004, Bob MW 7pm, Spring 2004, Bob TarrTarrThis course is an introduction to software design patterns. Each pattern represents a best practice solution to a software problem in some context. The course will cover the rationale and benefits of object-oriented software design patterns. Several example problems will be studied to investigate the development of good design patterns. Specific patterns, such as Observer, State, Adapter, Strategy, Decorator and Abstract Factory will be discussed. Programming projects in the Java language will provide experience in the use of these patterns. In addition, distributed object frameworks, such as RMI and Jini, will be studied for their effective use of design patterns.3The MVC patternThe MVC patternMVC stands for ModelMVC stands for Model--ViewView--ControllerControllerOriginally developed by Smalltalk hackersOriginally developed by Smalltalk hackersThe Model is the actual internal The Model is the actual internal representationrepresentationThe View (or a View) is a way of The View (or a View) is a way of looking at or displaying the modellooking at or displaying the modelThe Controller provides for user input The Controller provides for user input and modificationand modificationModelViewControllerThe ModelThe ModelMost programs are supposed to do work, Most programs are supposed to do work, not just be "another pretty face"not just be "another pretty face"but there are some exceptionsbut there are some exceptionsuseful programs existed long before GUIsuseful programs existed long before GUIsThe The ModelModelis the part that does the workis the part that does the workThe Model should be


View Full Document

UMBC CMSC 331 - Model-View-Controller design pattern

Documents in this Course
Semantics

Semantics

14 pages

Java

Java

12 pages

Java

Java

31 pages

V

V

46 pages

Semantics

Semantics

11 pages

Load more
Download Model-View-Controller design pattern
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Model-View-Controller design pattern and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Model-View-Controller design pattern 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?