Docsity

Object-Oriented Design: Understanding Packages and Their Role in UML, Slides of Object Oriented Analysis and Design

Partial preview of the text

Download Object-Oriented Design: Understanding Packages and Their Role in UML and more Slides Object Oriented Analysis and Design in PDF only on Docsity!

Department of Computer Engineering

Sharif University of Technology

Object-Oriented Design

Lecturer: Raman Ramsin

Lecture 10 : Analysis Packages

Department of Computer Engineering

Sharif University of Technology

Analysis Workflow: Packages  The analysis workflow consists of the following activities:  Architectural analysis  Analyze a use case  Analyze a class  Analyze a package

Department of Computer Engineering

Sharif University of Technology

Package Visibility and Stereotypes  Package elements may have visibility:  visibility is used to control the coupling between packages;  there are two levels of visibility:  public (+) - elements are visible to other packages;  private (-) - elements are completely hidden.  Package stereotypes:  «Framework»- a package that contains model elements that specify a reusable architecture;  «modelLibrary»- a package that contains elements that are intended to be reused by other packages.  A package defines an encapsulated namespace:  use qualified names to refer to elements in other packages, for example: Library::Users::Librarian

Department of Computer Engineering

Sharif University of Technology

Packages: Example

Department of Computer Engineering

Sharif University of Technology

Package Dependencies  A dependency relationship between packages indicates that the client package depends in some way on the supplier package.  «use» (default) - an element in the client package uses a public element in the supplier package.  «import» - public elements of the supplier namespace are added as public elements to the client namespace. Elements in the client can access all public elements in the supplier by using unqualified names.  «access» - public elements of the supplier namespace are added as private elements to the client namespace. Elements in the client can access all public elements in the supplier by using unqualified names.  «trace» - the client is a historical development of the supplier. This usually applies to models rather than elements.  «merge» - public elements of the supplier package are merged with elements of the client package. Only used in metamodeling.

Department of Computer Engineering

Sharif University of Technology

Package Dependencies

Department of Computer Engineering

Sharif University of Technology

Package Generalization  Very similar to class generalization;  The child packages:  inherit elements from their parent package;  can add new elements;  can override parent elements.

Department of Computer Engineering

Sharif University of Technology

Architectural Analysis and Package Analysis  identify subsystem architecture;  partition cohesive sets of analysis classes into analysis packages;  layer analysis packages according to their semantics;  attempt to minimize coupling by:  minimizing package dependencies;  minimizing the number of public elements in all packages;  maximizing the number of private elements in all packages.

Department of Computer Engineering

Sharif University of Technology

Finding Analysis Packages

Department of Computer Engineering

Sharif University of Technology

Eliminating Cyclic Package Dependencies