上海文通大¥ SHANGHAI JLAO TONG UNIVERSITY 9.Object Design: Specifying Interfaces 六海 wnnn SHANG 1日gG
9. Object Design: Specifying Interfaces
上游充通大学 Outline SHANGHAI JIAO TONG UNIVERSITY An Overview of Object Design Interface Specification Concepts Interface Specification Activities Software Engineering
Software Engineering Outline An Overview of Object Design Interface Specification Concepts Interface Specification Activities
上游充通大粤 SHANGHAI JIAO TONG UNIVERSITY 1.An Overview of Object Design Software Engineering
Software Engineering 1. An Overview of Object Design
上游充通大兽 Object Design SHANGHAI JIAO TONG UNIVERSITY Object design is the process of adding details to the requirements analysis and making implementation decisions The object designer must choose among different ways to implement the analysis model with the goal to minimize execution time,memory and other measures of cost. Requirements Analysis:The functional model and the dynamic model deliver operations for the object model Object Design:We decide on where to put these operations in the object model Object design serves as the basis of implementation Software Engineering
Software Engineering Object Design Object design is the process of adding details to the requirements analysis and making implementation decisions The object designer must choose among different ways to implement the analysis model with the goal to minimize execution time, memory and other measures of cost. • Requirements Analysis: The functional model and the dynamic model deliver operations for the object model • Object Design: We decide on where to put these operations in the object model Object design serves as the basis of implementation
上游充通大学 Object Design:Closing the Gap SHANGHAI JIAO TONG UNIVERSITY System Problem Application objects Requr nts gal 1 Solution objects Custom objects Object sign ga off-the-shelf components Systeml design g 一 Machine Software Engineering
Software Engineering Object Design: Closing the Gap
上游充通大粤 SHANGHAI JIAO TONG UNIVERSITY 2.Interface Specification Concepts Software Engineering
Software Engineering 2. Interface Specification Concepts
2.1 Developers play different Roles during SHANGHAI JIAO TONG UNIVERSITY Object Design Class User Call Class 哭子 Developer Class Implementor Realize Class 关 Class Extender Refine Class Software Engineering
Software Engineering 2.1 Developers play different Roles during Object Design Developer Call Class Class Extender Class Implementor Class User Realize Class Refine Class
上海充通大学 Class user versus Class Extender SHANGHAI JIAO TONG UNIVERSITY Developers responsible for Developers responsible for the implementation of Game are the implementation of League are class implementors class users of Game League Game ◇1 Tournament TicTacToe Chess The developer responsible for the implementation of TicTacToe is a class extender of Game Software Engineering
Software Engineering Class user versus Class Extender Game TicTacToe Chess League Tournament 1 * Developers responsible for the implementation of League are class users of Game The developer responsible for the implementation of TicTacToe is a class extender of Game Developers responsible for the implementation of Game are class implementors
上浒充通大学 SHANGHAI JIAO TONG UNIVERSITY 2.2 Specifying Interfaces Requirements analysis activities Identifying attributes and operations without specifying their types or their parameters. Object design:Three activities 1.Add visibility information 2.Add type signature information 3.Add contracts Software Engineering
Software Engineering 2.2 Specifying Interfaces Requirements analysis activities • Identifying attributes and operations without specifying their types or their parameters. Object design: Three activities 1. Add visibility information 2. Add type signature information 3. Add contracts
上海充通大学 1.Add Visibility Information SHANGHAI JIAO TONG UNIVERSITY UML defines three levels of visibility: Private (Class implementor): A private attribute can be accessed only by the class in which it is defined. A private operation can be invoked only by the class in which it is defined. Private attributes and operations cannot be accessed by subclasses or other classes. Protected (Class extender): A protected attribute or operation can be accessed by the class in which it is defined and on any descendent of the class. Public (Class user): A public attribute or operation can be accessed by any class. Software Engineering
Software Engineering 1. Add Visibility Information UML defines three levels of visibility: Private (Class implementor): • A private attribute can be accessed only by the class in which it is defined. • A private operation can be invoked only by the class in which it is defined. • Private attributes and operations cannot be accessed by subclasses or other classes. Protected (Class extender): • A protected attribute or operation can be accessed by the class in which it is defined and on any descendent of the class. Public (Class user): • A public attribute or operation can be accessed by any class