14-Jan-2003 - PowerPoint PPT Presentation

About This Presentation
Title:

14-Jan-2003

Description:

Java Help sessions TODAY (GH 227, 5PM 7PM) Committee, Year, Person (examples) (docs) ... each class is a model but also 'controller' elevate relationship to a class ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 16
Provided by: georgeh1
Learn more at: http://web.cs.wpi.edu
Category:
Tags: class | jan

less

Transcript and Presenter's Notes

Title: 14-Jan-2003


1
ModelViewController
  • 14-Jan-2003
  • Lecture 4

2
Outline
  • Previous Business
  • Java Help sessions TODAY (GH 227, 5PM 7PM)
  • Committee, Year, Person (examples) (docs)
  • Thursday 13 office hours for Dimitrova
  • Reading Questions
  • Lecture Contents
  • Relationships Redux
  • Model View Controller

3
Reading Questions
  • What does relationship fission mean?

Simply separate inheritance relationships from
aggregation


4
Reading Question
  • Can composition be other than 1?

No, and this is another difference between
aggregation and composition. Composition
implies 1 on the aggregate side (Node above)
5
Relationship Example
  • When multiple aggregates, look for loops



Node
Face

neighbor
6
Relationship Example
  • What is difference?

7
Relationship Example
  • There are full-time undergraduate students,
    full-time graduate students and part-time
    graduate students

Student
Student
Full-time
Part-time
Ugrad
Grad
PTGrad
FTGrad
Ugrad
PTGrad
FTGrad
8
Relationship Example (cont)
  • Courses have a set of students
  • Grad courses have grad students

Satisfied??
9
Relationship Example (cont)
  • Some grad courses can only have grad students.
    Some ugrad courses can only have undergrad
    students

Satisfied??
10
Model View Controller
  • As classes are designed they play different roles
  • if not, class has too many responsibilities
  • Common responsibilities are
  • represent data (or task) as a model
  • present state of the model to the user
  • enables changes to the model

11
Separation of Concerns
  • Model Think REUSE
  • represent data (or task) as a model
  • ? A Model can have any number of views
  • View Think GUI
  • present state of the model to the user
  • ? is notified of changes and pulls data from
    model
  • Controller Think business logic
  • enables changes to the model
  • ? interchangeable often totally separate from
    M/V

12
Structure of M/V/C
  • Simplified Model/View/Controller


Controller
notifies
1
1

Model
View
pulls data
13
Critique of Com/Per/Year example
  • What was essentially flawed with the
    Committee/Person/Year example?
  • each class is a model but also controller
  • elevate relationship to a class
  • model checking is a view of the data

Driver
Y
C
Po
ModelChecker
C
Y
Pe
Pe
14
Thursday Assignments
  • Review Model/View/Controller
  • Read Disciplined Inheritance paper
  • a question on the homework will be drawn from
    this paper.
  • Review Jan13 and Jan14 code examples
  • a question on the homework will come from this
    example
  • Exercises
  • 2-12
  • Review 2.5-2.8

15
References
  • Sample Info on Model/View/Controller
Write a Comment
User Comments (0)
About PowerShow.com