20090930-Composition

20090930-Composition - CSE115: Introduction to Computer...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 [email protected] 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Announcements New lab starting next week Exams handed back in lab (raw score) all students exam takers minimum 0 11 mean (avg) 38.7 39.0 median 41 41 maximum 50 50
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exam results 0 55 0 50 100 150 200 250 Grade distribution
Background image of page 4
Exam results 0 20 40 60 80 100 120 140 160 0 to 9 10 to 19 20 to 29 30 to 39 40 to 50 # students
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exam results 0 10 20 30 40 50 60 70 F C- C C+ B- B B+ A- A # students
Background image of page 6
Exam results 0 20 40 60 80 100 120 F C B A # students
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Agenda Relationships in model and code first relationship: composition Lifetime/Scope process memory Unified Modeling Language (UML) composition
Background image of page 8
RELATIONSHIPS
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Relationships in model and code relationships exist between objects in problem domains want to capture those relationships in our models and express them in our code
Background image of page 10
Composition A whole-part relationship (e.g. Dog-Tail) Whole and part objects have same lifetime when whole is created, it has its parts when whole is destroyed, parts go away too
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
whole/part creation in code Whole creates instance of part in its constructor In Java code, involves 3 changes to whole class: Declaration of variable of part type Instantiation of part class in whole class constructor Assignment of new part instance to variable
Background image of page 12
Lifetime issue lifetime of local variable from invocation of method/constructor to completion of method/constructor
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
whole/part creation in code Whole creates instance of part in its constructor In Java code, involves 3 changes to whole class: Declaration of instance variable of part type Instantiation of part class in whole class constructor Assignment of new part instance to instance variable
Background image of page 14
LIFETIME / SCOPE
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 16
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2011 for the course CSE 115 taught by Professor Decker during the Fall '08 term at SUNY Buffalo.

Page1 / 46

20090930-Composition - CSE115: Introduction to Computer...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online