identifying components and patterns using the n 2 chart to refine compositional structure

19
Page 1 Informatics Institute University of Oslo M. Naci Akkøk, 21. May 2004 Motivation Motivation CBSE has gained in importance and deserves its own tools, techniques and methods (T/Ms) T/Ms that are originally from the OO world are being used in CBSE, though many claim that CB OO How would we like using T/Ms meant for the procedural paradigm (PP) in OO software engineering (OOSE)? If the prospect is not attractive, it is time to start designing T/Ms that are native to the CB paradigm Identifying Components and Patterns Using The N 2 Chart to Refine Compositional Structure

Upload: ryder

Post on 25-Feb-2016

32 views

Category:

Documents


2 download

DESCRIPTION

Identifying Components and Patterns Using The N 2 Chart to Refine Compositional Structure. Motivation. CBSE has gained in importance and deserves its own tools, techniques and methods (T/Ms) T/Ms that are originally from the OO world are being used in CBSE, though many claim that CB  OO. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 1Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

MotivationMotivation CBSE has gained in importance and deserves its own

tools, techniques and methods (T/Ms) T/Ms that are originally from the OO world are being

used in CBSE, though many claim that CB OO

How would we like using T/Ms meant for the procedural paradigm (PP) in OO software engineering (OOSE)?

If the prospect is not attractive, it is time to start designing T/Ms that are native to the CB paradigm

Identifying Components and Patterns Using The N2 Chart to Refine

Compositional Structure

Page 2: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 2Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

The goal is to improve Component-Based Software Engineering (CBSE) process & product quality by

understanding the nature of components and component-based systems, and

applying this understanding to devising tools, techniques and methods (T/Ms) that facilitate CBSE or any phase/activity of CBSE

We aim at facilitating design-level reasoning in CBSE using the N2 Chart – a diagrammatic modeling language (DML) that is “native” to the CB paradigm

NATIVE to CB Mereological

The GoalThe Goal

Mereology: A philosophical/foundational view that

studies the world in terms of parts that make up a whole.

Page 3: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 3Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Diagrammatics – especially diagrammatic reasoning (Kulpa 1994)

Cognitively informed modeling, f. ex. Gurr, C. and K. Tourlas: “On the Design and Use of Diagrams” in Software Engineering in ICSE 2000, the 22nd International Conference on Software Engineering, 2000. Limeric, Ireland: ACM Press. p. 509-518. NOTE: Not cited in paper!

Linguistic pragmatics (not cited in the paper, but used by Gurr-Tourlas and many others)

The N2 Chart (Lano 1977, originally from TRW) CBSE, UML

Related WorkRelated Work

Page 4: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 4Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Practically all diagrammatic modeling languages (DMLs) used in CBSE are UML-based today

DMLs in CBSE:DMLs in CBSE:UML V1.5UML V1.5

Component ComponentInterface 1

Interface 2

#1#1

UML V1.5 implementation level component (standard)

Page 5: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 5Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Note that all three classes make up the single component.

DMLs in CBSE:DMLs in CBSE:UML V1.5UML V1.5 #2#2

Componentspecification

Client ofComponent

Componentimplementation

Usagecontract

Realizationcontract

Interface 2

Interface 1

Technology platform specific (reminds EJB-style components, see next slide).

UML V1.5 component notation including component specification

(can be used at design-level).

Page 6: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 6Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Technology platform (EJB) specific component notation used elsewhere (popular, see [4], [6], [10]).

DMLs in CBSE:DMLs in CBSE:UML V1.5UML V1.5 #3#3

<<EJBSessionHomeInterface>>

<<EJBRemoteInterface>>

<<EJBImplementation>>

<<EJBSessionBean>>

<<instantiate>>

<<EJBRealizeHome>>

<<EJBRealizeRemote>>

Also implementation-bound

Not cited in the paper

Page 7: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 7Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Catalysis. See [7].

DMLs in CBSE:DMLs in CBSE:UML V1.5UML V1.5 #4#4

Assumes specific programming-language constructs for value and control flow:

Event Assignment

ComponentC1

ComponentC3

ComponentC2

ComponentC4val1 val2

event

action()

Published event fromcomponent C2 triggers anaction() in the component C3(possibly a method of C3)

Pair of values val1and val2 always keptin sync

Page 8: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 8Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Single symbol for single design/specification level decomposable component. Finally!

DMLs in CBSE:DMLs in CBSE:UML V2.0UML V2.0 #5#5

Class ClassName

: C1

: C2

: C3

pin

rin

pin

po1

po2

po3

po4

po5ClassName

Provided interface

Required interface

Port

pin

rin

LEGEND

Page 9: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 9Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

We see a move from OO to CB notation in UML This is notably due to a need for addressing

design/specification level components in a platform independent manner,

This is admittedly also because SDL founders (mostly through Ericsson) are amongst the authors of the major UML 2.0 proposals to OMG

The fact that components are addressed and the way they are addressed (not only at implementation level but also at design/specification level) is nevertheless important

DMLs in CBSEDMLs in CBSE commentscomments

Page 10: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 10Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

The N2 Chart is native to CBSE (used in systems engineering). Matrix and node notations are:

DMLs in CBSEDMLs in CBSE NN22 Chart Chart(Lano, 1977, TRW)(Lano, 1977, TRW)

C1 C2 C1 C3

C2 C3C1 C2

C1 C3 C2 C3...

...

...

.........

C1

C2

C3

...

Input to C2

Input to C2

Outputfrom C3

Outputfrom C3

C1

C2

C3

C4

i13

i24

i31

i41 i52

iin

iout

RULE 1: Construct NxN matrix with N components on the diagonal

RULE 2: Interface from CX to CY is one-way and in the off-diagonal cell (X, Y)

RULE 3: All inputs to a component are on its column

RULE 4: All outputs from a component are on its row

LAYOUT is party of the rules!

Designed to facilitate design reasoning!

Page 11: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 11Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Facilitates identifying critical component and tightly coupled components

The NThe N22 Chart: Chart: AdvantagesAdvantages

ALSO facilitates reasoning about (not included in paper):

Distribution schemes Cyclic dependencies Etc.

A DML that is native to CBSE.Designed to facilitate design-level

reasoning

...

...

...

CC

...

...

...

CP

CQ

CR

Page 12: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 12Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Step 1. Identify candidate components. Use (for example) Abbott’s text analysis approach to identify objects, but look for things that perform – for example by looking at things responsible for actions in “doing verbs” and “transitive verbs”.

Step 2. Draw an initial N2 Chart. Step 3. Refine by reducing tightly coupled group of

components to single components. Step 4. Rearrange as needed. Step 5. Fully reduced, the design may contain a

design pattern.

The RefinementThe RefinementProcessProcess

The N2 Chart can help identify the “correct” components that make up the target system

through refining an initial set of components

In step 3 many other concerns will have to be taken into accountin whether to reduce or not.

Page 13: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 13Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

Using brain-storming (and use-cases to a lesser degree, no Abbott-style text analysis) candidate components are found in 3 passes, each time re-evaluating whether the list is complete or not:

ExampleExample Step #1Step #1

A Conference Center Portal example: helps participants register to conferences, organizers publicize, organize

and mediate conferences, and providers offer and manage their services.

It summarizes many aspects of a number of application types.

Notice the change in the kind of com-ponents iden-tified in the three passes

Organizer, provider, participant, invitation, calendar, reservation resources (rooms, catering etc)

Invitation manager, reservation manager, resource manager, calendar manager, reservation

Conference (the whole conference), conference center portal (i.e., the CCP itself), and booking (confirming/finalizing reservation)

Page 14: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 14Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

ExampleExample Step #2Step #2

The initial N2 Chart (abstracted).

C1

C2

C3

C4

iin-3

i1-3

i2-4

i3-1

C5

C6

C7

C8

i2-3

i3-4

i2-1

i3-2

i4-2 i4-3

i1-8

i4-6

i6-5

i7-6

i8-7

i5-out

i7-8

i6-8

Notice tightly-coupled groups of components

Note that reducing C7 and C8 is a decision that has to take into account other concerns

Note that there should be three sets of inputs and outputs. Only one (user’s) is taken into account

Page 15: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 15Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

ExampleExample Step #3Step #3

The N2 Chart after 1st set of reductions.

C1

C[2]

iin-3

C5

C6

C[7]

i1-3

i[2]-1

i1-8

i4-6

i6-5

i7-6

i5-out

i6-8

RED. 1

RED. 2

RED. 3

C[2]

C[7]

i[2]-1

C2, C3, C4

C7, C8

i2-1 and i3-1

Reduction table

Page 16: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 16Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

ExampleExample StepsSteps #3 and #3 and 44

The N2 Chart after 2nd set of reductions and a rearrangement.

C[1]

C5

C[6]i6-5

i5-out

i[1]-[6]

iin-3

C[1]

C5

C[6]

i5-out

i[1]-[6]

iin-3

i6-5

Page 17: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 17Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

ExampleExample Step 5Step 5

The CB design pattern candidate (including all sets of inputs/outputs).

End-user(mgr.)

Provider(mgr.)

Mediator(mgr.)

iin-u iin-m iin-p

iu-m

im-p

iu-out

im-out

ip-out

This is a CB design-pattern candidate

It indicates a need for a component that manages the needs of the end-users, another that manages the needs of the mediators, and a third that manages the needs of the providers

Page 18: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 18Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

ConclusionsConclusions #1#1

Quality is never independent of how well the software engineering “tools” are, how well the toolmakers

understand the nature of software engineering and its needs, and how well the software engineers master these

“tools”.

The DML presented (based upon a somewhat modified version of the N2 Chart) is a very simple DML but is nevertheless capable of facilitating design-level reasoning

The claim is that this is possible because the N2 Chart is native to the CBSE (i.e., is mereological): it represents what needs to be represented

This translates to a “tool that matches its paradigm”: match between the world delineated by the paradigm and its representation (also conceptual manipulation)

This stance assumes that choice of a paradigm (in modeling) dictates “what we choose to see and how we choose to see it”

Page 19: Identifying Components and Patterns Using The N 2  Chart to Refine Compositional Structure

Page 19Informatics InstituteUniversity of OsloM. Naci Akkøk, 21. May 2004

ConclusionsConclusions #2#2

A single paradigm should not be a religion that dictates all aspects and phases of

all types of software development.

Alistair Cockburn’s “Crystal” categorizes software engineering projects, and which types of software engineering projects lend themselves to which types of software development methods

Similarly, a paradigm should be chosen with respect to the type of software and with respect to the phase or activity within the development project

Component-based software development, at the design phase and in specification-related activities, needs tools that facilitates upon design-level reasoning

The same tool(s) may not be effective in other phases of development or in projects other than CBSE projects