OOS SQUARE Component Diagram SQUARE Lab UML 2
OOS SQUARE Component Diagram SQUARE Lab *UML 2 and the Unified Process Second Edition을 인용하여 작성됨
What is a component? OOS SQUARE v The UML 2. 0 specification [UML 2 S] states, “ A component represents a modular part of a system that encapsulates its contents and whose manifestation is replaceable within its environment” v A component is a modular and replaceable part of as system that encapsulates its contents. v Interfaces allow you to connect components in a flexible way 2
What is an interface? (1/2) OOS SQUARE v An interface specifies a named set of public features. v Interfaces separate the specification of functionality from its implementation by a classifier such as a class or subsystem. Usage Realization 3
What is an interface? (2/2) OOS SQUARE v The attributes and operations in an interface should be fully specified and should include the following: 1. 2. 3. 4. The complete operation signature (name, types of all parameters, and return type) The semantics of the operation-this can be recorded as text or pseudo code The name and type of the attributes Any operation or attribute stereotypes, constraints, and tagged values. v If the implementation language doesn’t directly support interfaces, just use abstract classes. 4
Advantages and disadvantages of interfaces OOS SQUARE v Designing to contracts frees the model from implementation dependencies and therefore increases its flexibility and extensibility v Flexibility can lead to complexity – so take care 5
Interfaces and component-based development OOS SQUARE v Interfaces are the key to component-based development (CBD) v Component-based development is about constructing software from plug-in parts. v If you want to create flexible component-based software for which you can plug in new implementations at will, you must design with interfaces. v Because an interface only specifies as contract, it allows for any number of specific implementations, provided each abides by that contract 6
- Slides: 10