Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

46
Theme UML Extending UML to treat aspects Presented by Moran Birenbaum
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    218
  • download

    2

Transcript of Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Page 1: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme UMLExtending UML to treat aspects

Presented by Moran Birenbaum

Page 2: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 3: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Design and Aspects

The analysis and design of a system are at least as important as the implementation itself.

As with systems in any programming paradigm, aspect-oriented systems need to be designed with good software engineering practices in mind.

Aspect-oriented design has similar benefits for design as aspect-oriented code has for code.

Page 4: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

UML is a standard language for object oriented analysis and design specifications.

UML is composed of 3 models:– Structural Diagrams– Behavior Diagrams– Model Management Diagrams

UML – A quick Review

Page 5: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

פריסתהתוכנהעל גביהחומרה

PackagePackageDiagramDiagram

“חבילות עבודה”

:מקרא

מודלסטטי

מודלדינמי

מודלניהולי

SequenceSequenceDiagramDiagram

פונקציונליות,אינטראקציה

ActivityActivityDiagramDiagram

לוגיקה,זרימה

ComponentComponentDiagramDiagram

ארכיטקטורתהתוכנה

StateStateChartChart

התנהגות

ישויות,קשרים,ClassClassיחסים

DiagramDiagramUse CaseUse Case

ModelModel

שחקנים,תרחישים,

אופניפעולה

דרישות מערכתדרישות מערכת

DeploymentDeploymentDiagramDiagram

ארכיטקטורת מערכתארכיטקטורת מערכת

Page 6: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 7: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Design and aspectsWhy is UML not ‘good enough’ for aspects?

• UML was not designed to provide constructs to describe aspects.

• Trying to design aspects using object-oriented modeling proved as problematic as trying to

implement aspects using objects.

• We need special support for designing aspects.

Page 8: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme

Provides support for how to both identify aspects in a set of requirements, and how to model them in UML style designs.

Themes are more general than aspects. We view each piece of functionality, or requirement, or aspect or concern a developer might have as a separate theme to be catered for in the system.

Themes may be related to each other, in the same way as requirements or features or aspects are related to other parts of the system. Such relationships may cause overlaps in the themes.

Page 9: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme

The Theme approach is made up of two portions:

Theme/Doc - Which is a set of heuristics for visualization and analysis of software requirements documentation.

Theme/UML - Which is a way to write aspects as UML.

Page 10: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme/Doc

Theme/Doc provides support for identifying crosscutting behavior from descriptions in a requirements document.

First step: Identify Actions and Entities– Identifying a set of "sensible" key-actions in a requirements document.

Second step: Classify Actions– Simplifies the view by deciding which actions are major or minor.

Third Step:Associate Requirements with Crosscutting Actions– Examines the linkages between the major actions. – Examines the shared requirement to determine whether it highlights a

crosscutting relationship between the actions.

Page 11: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme/DOC

Forth Step: Look at Themes– After themes have been identified and refined, they can

be viewed using the theme view.– translating the Theme/Doc views into Theme/UML.

Fifth Step: Augment Themes– Theme views are augmented to add in design decisions. – In order to give the developer a chance to consider

whether the decisions were appropriate.

Page 12: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme/UML - Motivation

Problem - There is a well documented problem in the software engineering field relating to a structural mismatch between the specification of requirements for the software systems and the specification of object oriented software system.

Causes - This mismatch happens because the interest during the requirements phase is different from the interest during object oriented design and implementation.

Result – A single requirement being scattered across the design units and a single design unit supporting multiple requirements (tangling).

Solution: Theme/UML

Page 13: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Theme/UML

Designing system based on the object oriented model, but extending this model by adding new decomposition capabilities.

Each model contains a design of an individual requirements.

Composition of design models are specified in composition relationship, by identifying overlapping concepts in different models and specifying how models should be integrated.

Page 14: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 15: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Library Management System - LMS

The system handles addition, removal, ordering and search for books and periodicals (resources).

The system handles borrowing and returning resources. The system can impose fines for a late return. Technical requirements:

– management services are available concurrently.– Changing entities services should only run one at a time and lock

query services.– Multiple query services should be allowed to run concurrently.

Page 16: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 17: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 18: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

The Model

Design for each requirement a different package.

Within each individual package use object oriented techniques – All UML design models may be included.

The decomposition encapsulates Requirements so scattering is removed.

Tangling is also removed since each requirements are separated into different models.

Page 19: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Decomposing Design Models

For object oriented design models, matching the structure of requirements means dividing the design models to separate packages to match the structure.

Those packages are called Design Subjects. Various kinds of requirements can be designed in design

subjects:– Features– Crosscutting requirements – like distribution– And so on…

Advantages: comprehensibility, traceability, evolution and reuse.

Page 20: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Design Subjects By Features

Page 21: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Design Subjects By Crosscutting Requirements

Synchronization

Page 22: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 23: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Composing Design Models

After decomposing the designs we will have to compose them in some stage later in order to understand the design of the system as a whole.

Composition relationship – A relation between two design models specifying how those design models are to be composed.

Different kind of composition may be attached to a composition relationship.

Composition of design subjects results in a new design subject containing the integrated elements of the “input” design subjects. The input design subjects remains unchanged.

Page 24: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Types Of Composition Relationship

• This composition relationship is used when an existing design subjects need to be changed.

• A new requirement indicates that the behavior specified in the existing design subject is no longer appropriate.

• An existing design subject is changed by creating a new design subject that contains the design of the appropriate behavior to support the new requirement.

• Then override the existing design subject with the new design subject.

Override Integration

Page 25: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Example

Page 26: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Types Of Composition RelationshipMerge Integration

• This composition relationship is used when different design subjects contain specifications for different requirements of a

computer system.

• This may appear when reusing design subjects from previous versions of the system or from an outside source.

•The full system design is obtained by merging the design of the separate design subjects.

Page 27: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Merge Integration

Merge with reconciliation required

• Explanation by an example:

•In the LMS merging AddResource and RemoveResource.

•A conflict is encountered since AddResource and RemoveResource have different specifications.

•The conflict is solved by giving a precedence to one of the merged designs.

•The precedence determined by the developers.

Page 28: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Example

Page 29: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Merge IntegrationMerging Corresponding Operations

•Merging the specifications of operations in the result implies that all corresponding operations are added to the merged subject.

•Merge integration means that an invocation of one of the corresponding operation results in the invocation of all corresponding operations.

•Where operations have a return type, the default behavior is that the value returned by the last operation run is returned.

•The order of the execution is set arbitrarily, but can be determined by a collaboration indicating the order.

Page 30: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Example

Input

Page 31: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Output

Page 32: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 33: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Composition Patterns

Crosscutting requirements has behavior that will affect multiple classes in different design models in a uniform way.

For design models that support crosscutting requirements, composition of those models with other models is likely to follow a pattern.

Example : Synchronization in LMS.

For these kind of requirements, subject oriented design model defines a mechanism called composition pattern.

Page 34: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Composition Patterns

The use of templates as placeholders for elements with which the crosscutting functionality will interact supports the independent design for such functions.

Example: Template – Synchronization

Function - AddResource

The composition patterns model extends standard composition relationship with a bind[] attachment that defines the elements that replace the templates within the composition pattern.

Ordering of the parameters in the bind[] attachment matches the ordering of the templates in the pattern’s template box.

Page 35: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 36: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Example

Page 37: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Synchronize Library

Page 38: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 39: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

UML Metamodel Extensions

UML is defined using a metamodel, which defines the syntax and semantics of the UML and described itself in UML.

Similarly the syntax and semantics of composition relationship is described.

Page 40: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Composable Elements

Design elements that may participate in a composition relationship.

The impact of integration on design elements depends on the kind of elements they are.

Divided into two types:– Primitives – Elements whose full specifications are

composed with other primitives. Example : Attributes, Operations, Associations.

– Composites – Elements that contain other elements and cannot be considered as primitives.

Example : Subjects and Classifiers.

Page 41: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Composable Elements

Page 42: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Composition Relationship

Defined between composable elements.

Elements composed with their corresponding elements.

Elements are said to “correspond” when they “match” the purpose of composition, where correspondence matching specification is a part of the composition relationship.

Composition relationship is a sub class of the Relationship metaclass.

Page 43: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.
Page 44: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

Summary

Standard object oriented design does not align well with requirements causing scattering and tangling.

Subject oriented design is described as a means of achieving alignment between requirements and object oriented design to solve this problem.

We decompose by requirements and than compose them by

composition relationship. Each subject can be designed separately .

Page 45: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.

References

Theme home page at:http://www.dsg.cs.tcd.ie/index.php?category_id=353

Theme/UML home page at: http://www.dsg.cs.tcd.ie/~sclarke/ThemeUML/

Siobhan Clarke “Extending standard UML with model composition semantics”

http://webcourse.cs.technion.ac.il/234321

Page 46: Theme UML Extending UML to treat aspects Presented by Moran Birenbaum.