Outline Create Initial Design Classes ★◆Define Operations ◆Define Methods ◆Define States ◆ Define Attributes ◆Define Dependencies ◆Define Associations .Define Generalizations Object Oriented Analysis and Design 11
Object Oriented Analysis and Design 11 Outline Create Initial Design Classes Define Operations Define Methods Define States Define Attributes Define Dependencies Define Associations Define Generalizations
Operations:Where Do You Find Them? Messages displayed in interaction diagrams ClassA ClassB ClassA ClassB 1 V/Perform Responsibility\ 1:\performResponsibility ()result\ Other implementation dependent functionality Manager functions ■Need for class copies Need to test for equality Object Oriented Analysis and Design 12
Object Oriented Analysis and Design 12 Messages displayed in interaction diagrams Other implementation dependent functionality ▪ Manager functions ▪ Need for class copies ▪ Need to test for equality Operations: Where Do You Find Them? : ClassA 1 : V/Perform Responsibility\ : ClassB : ClassA 1 : \performResponsibility (): result\ : ClassB
Name and Describe the Operations Create appropriate operation names ◆ ▣Indicate the outcome Use client perspective Are consistent across classes Define operation signatures -operationName([direction]parameter class,..): return Type Direction is in,out or inout with the default in if absent Provide short description,including meaning of all parameters Object Oriented Analysis and Design 13
Object Oriented Analysis and Design 13 Name and Describe the Operations Create appropriate operation names ▪ Indicate the outcome ▪ Use client perspective ▪ Are consistent across classes Define operation signatures ▪ operationName([direction]parameter : class,..) : returnType • Direction is in, out or inout with the default in if absent Provide short description, including meaning of all parameters
Guidelines:Designing Operation Signatures When designing operation signatures consider if parameters are: Passed by value or by reference Changed by the operation Optional Set to default values In valid parameter ranges The fewer the parameters,the better ◆Pass objects instead of“data bits' Object Oriented Analysis and Design 14
Object Oriented Analysis and Design 14 Guidelines: Designing Operation Signatures When designing operation signatures, consider if parameters are: ▪ Passed by value or by reference ▪ Changed by the operation ▪ Optional ▪ Set to default values ▪ In valid parameter ranges The fewer the parameters, the better Pass objects instead of “data bits
Operation Visibility Visibility is used to enforce encapsulation May be public,protected,or private Private operations Public Protected operations operations Object Oriented Analysis and Design 15
Object Oriented Analysis and Design 15 Public operations Protected operations Private operations Operation Visibility Visibility is used to enforce encapsulation May be public, protected, or private