DOC PREVIEW
Duke CPS 100E - MVC: Model, View, Controller

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 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 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CompSci 100E8.1MVC: Model, View, Controllerÿ A model is the state and brains of a system In a game it's all the pieces and where they are In a spreadsheet it's the data and the formulaeÿ The view is how we look at the model Spread sheet has graphs, charts, cells, text, … Game has board, number of opponents, hit-points, …ÿ When the model changes, the views reflect the changes The model tells the views how/if it has changed Model sends information to views OR View asks model for informationCompSci 100E8.2MVC: interfaces and inheritanceÿ A model might have multiple views Tell all the views "I've changed" Who manages the views? This requires state: store views Why can't we keep this state in an interface?ÿ See IModel and AbstractModel One specifies behavior, the other provides default  Don’t rewrite code if we don't have to, maintaining views will be the same for all modelsÿ See IView and SimpleView No default/shared view state/behavior: text and GUICompSci 100E8.3Does SimpleViewer know Model?ÿ What does the SimpleViewer know about its model? If we look at code, is there any application-specific logic? What if we wanted to play a game, start a new game?ÿ Control in MVC with SimpleViewer and IModel Loading a file calls initialize() Entering text calls process() Model calls view with messages, errors, and complete updateÿ This isn't complete general, but it's pretty generic For this input, here's the outputCompSci 100E8.4Pixmap Assignmentÿ “Last” CompSci 6 Assignment Lots has been done for you Mainly an exercise in working with 2 D info ÿ Not really MVC Doesn’t hurt to keep that model in mind, thoughÿ Lots of GUI stuff Graphical User Interface is not reall focus of this course Just use what has been given Become familiar with it by reading code, seeing resultsÿ Feel free to experimentCompSci 100E8.5Java Exceptionsÿ Many I/O operations can throw Exceptions Code handles it for your However, need to know what is going on (Review pages in Chapter 2)ÿ Catching Exceptions Use try-catch blocktry {// statements that might generate exception}catch (exception_type var){// code that deals with exception}ÿ Method can pass on responsibility for exception with


View Full Document

Duke CPS 100E - MVC: Model, View, Controller

Documents in this Course
Topics

Topics

9 pages

Lecture

Lecture

3 pages

Notes

Notes

2 pages

Hashing

Hashing

19 pages

Lecture

Lecture

59 pages

Lecture

Lecture

6 pages

Lecture

Lecture

4 pages

Lecture

Lecture

20 pages

Lecture

Lecture

12 pages

Lecture

Lecture

12 pages

Lecture

Lecture

7 pages

Lecture

Lecture

8 pages

Lecture

Lecture

10 pages

Lecture

Lecture

4 pages

Notes

Notes

16 pages

Lecture

Lecture

5 pages

Lecture

Lecture

9 pages

Lecture

Lecture

4 pages

Lecture

Lecture

13 pages

Lecture

Lecture

6 pages

Lecture

Lecture

16 pages

Lecture

Lecture

5 pages

Lecture

Lecture

5 pages

Lecture

Lecture

12 pages

Lecture

Lecture

12 pages

Lecture

Lecture

10 pages

Sets

Sets

14 pages

Lecture

Lecture

9 pages

Lecture

Lecture

4 pages

Test 1

Test 1

7 pages

Load more
Download MVC: Model, View, Controller
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 MVC: Model, View, Controller 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 MVC: Model, View, Controller 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?