Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T....

22
Concern Architecture View and Aspect- Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa

Transcript of Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T....

Page 1: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Concern Architecture View and Aspect-Oriented Design

Mika Katara and Shmuel KatzTampere U. T. Technion, Haifa

Page 2: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Designing Aspects and Describing Connections among Aspects

Not supported on architecture/design level Need incremental design of aspects Must understand potential interactions

For correctness For reuse in building blocks For evolution and maintenance As an aspect-oriented view of system

architecture

Page 3: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

One Context: Viewtypes A perspective on software architecture Defined using elements and relationships Can have several styles that define

recurring forms Client-server Pipeline

Reference: Clements, et.al, Documenting Software Architectures: Views and Beyond

Page 4: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Here: a software architecture viewpoint

The organization of the aspects themselves

Only one way to view

Page 5: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Abstract definitions Concern: conceptual matter of interest

(security, performance monitoring,…) A name “inherited” from a group of requirements

Aspect: software design treating part of a concern, usually cross-cutting

Combined aspect: Cluster of related aspects that treat a concern

Remodularization/refactoring to isolate common denominators in separate aspects

Page 6: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

What is an aspect? A Mapping: Design Design Two parts:

Required: the part of the `source’ design giving join points and needed assumptions used

Provided/Defines: the augmentations that give the result of applying the aspect

Example: Aspect A uses (formal) class C, and defines a subclass D with new method m

Parametric in C; bind C to actual required class

Page 7: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Preview: Record Aspect

Page 8: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Composing aspects For A and B, if there is no binding among

their required parts (directly or indirectly), either order is OK; they are independent

BUT, if the required part of B is bound to part of A, then B is applied later, and B depends on A

Uses Superimposition concepts and mechanisms (see references and explanation in paper)

A collection of aspects and dependencies ordering their composition treat each concern

Page 9: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Two types of dependency Between aspects that together treat

the same concern Order, compose, and modularize

Between unrelated aspects…identify potential conflicts and “stress points” Can identify relations among concerns

Page 10: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Example: monitoring execution and preventing overflow

If monitoring adds integer counters, and overflow must treat every integer, monitoring must be done first, even though they treat different concerns.

If different variables are treated, or monitoring doesn’t affect integers, they may be independent.

If monitoring must treat everything else, overflow should be applied first

Can also have mutual application Policy: identify overlapping subaspects: when

(treatment of) one concern is modified, the other may be influenced

Page 11: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Concern Diagram: a new view

Contain aspects, dependencies among them, groupings into concerns

Concerns have overlapping, contain common aspects

Architectural viewpoint that identifies potential conflicts, concentrates effort when changes are made

Page 12: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Instantiation for UML Describe an aspect as a stereotype of

a package where any element can be denoted required or provided

Elements includes class, method, state, transition, link, use case, actor, etc.

Add new UML diagram type to treat concern diagram for selected subsets of aspects, concerns, and elements

Page 13: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Symmetric or Asymmetric View?

Could have everything be a concern, each realized by aspects that are then ordered by dependencies and bound

Could have an underlying object system that treats some concerns, others in an aspect layer that uses this notation

Page 14: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Extended example: digital sound recorder

Slices that correspond to Playing a message, Recording a new message, Activating an alarm clock

are complex and hide any overlap Instead: describe aspects separately, use

concern diagram to show overlap Slices are results of combinations of simpler

aspects (themselves aspects or superimpositions)

Page 15: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Basic Classes and Aspects Classes: hardware wrappers and low level

software Microphone, Speaker, Display, Timer, Battery,.. UserInterface, AudioController, AudioBlock

Here, these are all required in the descriptions of the aspects

Here, all high-level functionality is in aspects

Other divisions are possible

Page 16: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Sound Recorder (cont.) Typical aspects

GUI Memory management Record (Added parts over GUI and

Memory) Output creation

Typical concerns Playing, Recording, Activating alarm

Page 17: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Concern Diagram

Page 18: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Record Aspect

Page 19: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

State machines and sequence diagrams in aspects

Page 20: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

GUI Aspect

Page 21: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Recording slice (combined aspect, with no requires part)

Page 22: Concern Architecture View and Aspect-Oriented Design Mika Katara and Shmuel Katz Tampere U. T. Technion, Haifa.

Conclusions Combinations of collections of aspects

are needed to treat concerns Parametric UML aspects with requires

and provides Concern diagrams identify common

denominators and stress points One (valuable) view in a multiview

approach Still needed: clear development path,

correctness criteria, semantics