












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Design Workflow, Trace Relationships, Design Classes, Inheritance, Aggregation, Multiple Inheritance, Interface Realization, Templates, Nested Classes, Raman Ramsin, Lecture Slides, Object Oriented Design, Department of Computer Engineering, Sharif University of Technology, Iran.
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













Department of Computer Engineering
Department of Computer Engineering
Design Workflow The design workflow is about determining how the functionality specified in the analysis model will be implemented. The design workflow is the primary modeling activity in the last part of the Elaboration phase and the first part of the Construction phase. The design model contains: design subsystems; design classes; interfaces; use case realizations-design; a deployment diagram (first-cut).
Department of Computer Engineering
Design Workflow: Design a Class The Design Workflow consists of the following activities: Architectural Design Design a Use Case Design a Class Design a Subsystem
Department of Computer Engineering
Design Classes Design classes are the building blocks of the design model. Design classes are developed during the USDP activity Design a Class. Design classes are classes whose specifications have been completed to such a degree that they can be implemented.
Department of Computer Engineering
Design Classes: Sources
Department of Computer Engineering
Design Classes: Anatomy Design classes have complete specifications: complete set of attributes including: name; type; default value when appropriate; visibility; operations: name; names and types of all parameters; optional parameter values if appropriate; return type; visibility.
Department of Computer Engineering
Design Classes: Well-formedness The public operations of the class define a contract with its clients. Completeness - the class does no less than its clients may reasonably expect. Sufficiency - the class does no more than its clients may reasonably expect. Primitiveness - services should be simple, atomic, and unique.
Department of Computer Engineering
Design Classes: Well-formedness (Contd.) High cohesion : each class should embody a single, well-defined abstract concept; all the operations should support the intent of the class. Low coupling : a class should be coupled to just enough other classes to fulfill its responsibilities; only couple two classes when there is a true semantic relationship between them; avoid coupling classes just to reuse some code.
Department of Computer Engineering
Inheritance and Aggregation Subclasses should always represent "is kind of" rather than "is role played by" - always use aggregation to represent "is role played by".
Department of Computer Engineering
Multiple Inheritance Multiple inheritance allows a class to have more than one parent. Of all the common OO languages only C++ has multiple inheritance. Design guidelines: the multiple parent classes must all be semantically disjoint; there must be an "is kind of" relationship between a class and all of its parents; the substitutability principle must apply to the class and its parents; the parents should themselves have no parent in common; use mixins - a mixin is a simple class designed to be mixed in with others in multiple inheritance; this is a safe and powerful idiom.
Department of Computer Engineering
Templates Templates allow you to "parameterize" a type create a template by defining a type in terms of formal parameters; instantiate the template by binding specific values for the parameters. Of all the commonly used OO languages, only C++ and Java currently support templates. Explicit binding uses a dependency stereotyped «bind»: show the actual values on the relationship; each template instantiation can be named.
Department of Computer Engineering
Templates: Example
Department of Computer Engineering
Nested Classes Defined as a class inside another class. The nested class exists in the namespace of the outer class - only the outer class can create and use instances of the nested class. Nested classes are known as inner classes in Java, and are used extensively for event handling in GUI classes.
Department of Computer Engineering
Reference Arlow, J., Neustadt, I., UML 2 and the Unified Process: Practical Object-Oriented Analysis and Design, 2
Ed. Addison-Wesley,