Download presentation
Presentation is loading. Please wait.
Published byTaliyah Reynold Modified over 10 years ago
1
Technieken van de Software Architectuur, VUB ‘98-’99, Part 11 Object Orientation Review
2
Technieken van de Software Architectuur, VUB ‘98-’99, Part 12 Review: OO 4An object-oriented application is a set of interacting entities (objects) 4Objects have state and behaviour 4Message passing is the sole communication mechanism between objects 4Objects are grouped into classes 4Classes are grouped into inheritance hierarchies
3
Technieken van de Software Architectuur, VUB ‘98-’99, Part 13 Review: Object Encapsulation 4Hiding implementation details 4Protecting state information of objects 4Creating objects with encapsulated state/behaviour 4Communicating via a uniform interface
4
Technieken van de Software Architectuur, VUB ‘98-’99, Part 14 Objects Communicate via Messages assignment paper time professorassistentstudent writeResearchPaper doAssignment reworkIntoPaper
5
Technieken van de Software Architectuur, VUB ‘98-’99, Part 15 Object Collaboration professor assistent student 2: doAssignment 3: reworkIntoPaper 1: writeResearchPaper
6
Technieken van de Software Architectuur, VUB ‘98-’99, Part 16 Attributes and Methods 4An object’s interface contains attributes and methods 4Attributes and methods can be public, protected or private 4Methods are shared by all the objects of the class private public person:Person name:String age:Integer checkAge( ) isParentOf(child:Person):Boolean protected
7
Technieken van de Software Architectuur, VUB ‘98-’99, Part 17 Messages (What) versus Methods (How) Interface (What) Methods (How)
8
Technieken van de Software Architectuur, VUB ‘98-’99, Part 18 Review: Classes & Instances 4Class: Template for objects that share common characteristics 4Instance: A particular occurrence of an object defined by a class Class Person Book Instance John Doe: Person Succeeding With Objects: Book
9
Technieken van de Software Architectuur, VUB ‘98-’99, Part 19 Review: Class Generalisation/Specialisation Person EmployeeFreelanceSelf-Employed
10
Technieken van de Software Architectuur, VUB ‘98-’99, Part 110 Review: Class Relationships Aggregation Association MotherDaughter 1 cardinality FloorBuilding
11
Technieken van de Software Architectuur, VUB ‘98-’99, Part 111 Review: Message Expression 4Unary messages »Date today »aPoint x 4Binary messages »2 + 3 4Keyword messages »array at:1 put:#Oranges Smalltalk Syntax
12
Technieken van de Software Architectuur, VUB ‘98-’99, Part 112 Smalltalk: Precedence 4Expressions evaluate from left to right 4Evaluation order »Messages within parentheses »Unary messages »Binary messages »Keyword messages
13
Technieken van de Software Architectuur, VUB ‘98-’99, Part 113 Smalltalk 4Assignment »aSet := Set new 4Blocks »(2 < 3) ifTrue: [a := 4] ifFalse: [a := 5] »anArray do: [ :a | Transcript show:a printString] 4Returning from a method (^) »^name
14
Technieken van de Software Architectuur, VUB ‘98-’99, Part 114 Convention In Smalltalk we talk about methods. The UML design equivalent is called operations. In the course slides, the conventional translation from Smalltalk syntax to UML syntax is used: 3unary method ‘m’ -> ‘m()’ 3operator method ‘+’ -> ‘plus(arg:argType)’ 3keyword method ‘x:y:’ -> xY(arg1:a1Type, arg2:a2Type) 3private protocol -> private operation 3protected protocol -> protected operation
15
Technieken van de Software Architectuur, VUB ‘98-’99, Part 115 UML: Tags and Constraints 4Tags are post-it-notes that can be attached by a line to any entity in a UML diagram. »Tags can contain comments, documentation, or semantic information 4Constraints can be used to add additional semantic information to a UML diagram »Denoted between curly braces { } »Usually expressed in OCL »Other constraints also allowed This is a comment. {version = 1.1} {developer=“Tom”} {abstract} {invokes send}
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.