上游充通大粤 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