Beruflich Dokumente
Kultur Dokumente
Overview
Introduction Motivation Background FR, NFR Integration
Classpects Use Cases and Their Sequence Digrams Q-SIG
Conclusion
2
Introduction
NFRs: global constraints
FRs: requirements on the function of the system
Motivation
Approaches for NFR design
NFR framework AOP NFR specific approaches
Background
NFR-Framework
Chung et.al, 1989-99
Treat NFRs as softgoals that need to be
satisficied
Softgoal can not be absolutely fulfilled Satsficing satisfying a requirement in a variety of degree without necessarily optimizing.
e.g.. Somewhat, negatively, positively, very positively
Consists of
SIG (Softgoal Interdependency Graph) Catalogues for each NFR
5
Background
Classpects
Leverage the advantage of both class and aspects
Improve the compositionality of aspect modules From 2-layered structure in AOP to hierarchical structure of n-layers
Aspects (now classpects) can advise other classpects
Background
Classpects
Example (in Eos-U, classpect implementation language)
public class SafetyRoomMalOI{ SafetyRoomMal srm; Attribute: the classpect public SafeRoomMalOI(SafeRoomMal srm){ advises SafetyRoomMal this.srm = srm; } Constructor public void safteyfun (){ Advise: now inside a /* body of the method */ } named method so that it before execution{public * could be advised later if safeRoomMal.*(*)) necessary && returns (ret) && args(): call safetyFun(); Pointcut: now calls the }
advise method
Framework
Creating SIG A SIG describing the NFR of the system Creating SIG claspects (skeleton) Synthesizing Classpects that implements the NFRs Discovering classes for claspects Correspondence between the classpects that describe NFR and classes that describe FR Integrating NFR with FR Design document that captures both NFR and FR
8
A classpect A is applied to the classpect B Two classpects A1 and A2 are applied to classpect A
A1(B)
<<classpect>> Performance
Space (Account)
A(B1)
Example
Safety (Room. Malfunction)
public class SafeRoomMal{ 1 Room rm; 2 public SafeRoomMal(Room rm){ 3 this.rm = rm; 4 } 5 public void safteyfun(){ 6 inform facility manager 7 } 8 before execution{(public *Room.*(*)) 9 && returns (ret) && args(): 10 call safetyFun(); }
inform user
11
Example
Safety (Room. Malfunction.OI) Safety (Room. Malfunction. Motion Detector)
public class SafeRoomMalOI{ SafeRoomMal srm; /*CONSTRUCTOR*/ public void safteyfun (){ all ceiling lights on and inform user } public class SafeRoomMalMD{ /* POINTCUT*/ SafeRoomMal srm; }
/*CONSTRUCTOR*/
public void safteyfun (){ inform user and set room as occupied }
/* POINTCUT*/
}
inform user set room as occupied
12
Example
Observation
The code is skeletal
Text information from the SIG
Need to incorporate info from functional analysis
13
Discovering Classes
To match the claspects with classes
Use the same vocabulary Unless NFR and FR analysis done by the same person, not reliable
Account class may have different methods from NFR AND FR perspective
Use use-cases to find which classes may be affected Use the requirement document in such a way that Often the NFR is mentioned along with the class that it applies to
14
Integration
Room class
Roomm +id : Integer +lights : sequence(idl) +user : String +occupied : Boolean +fm : String +lightintensity : Byte +setLightIntensity() +occupied() : boolean +setOccupied() +lightIntensity() : Byte +turnLights(in light : Single) +checkSafety() : bool
public class SafeRoomMalOI{ SafeRoomMal srm; /*CONSTRUCTOR*/ public void safteyfun (){ all ceiling lights on and inform user } /* POINTCUT*/ }
public void safteyfun (){ for all i in srm.rm.lights{ srm.rm.turnOnLights(i); } println (``This room"+ srm.rm.id+ ``has a malfunction"); }
15
16
Room
Notice
|a=true|
FUNCTIONAL
|a=false| safety
safety
S1
S2
S3
PAR
NONFUNCTIONAL
17
Design Alternatives
As NFRs compete for resources, we need to find the best set of design decisions to satisfy all NFRs
18
Use Pin
Id/passwd
Another ID
A D D S
B D S S
Result D S S
D=denied S=Satisfied
20
21
The OR decomposition technique has to be changed since it is useless for deciding among alternatives.
22
0.7
The objective is to get the design alternatives that get the highest value for the root
Solution (contd) Downward arrowsdecomposition Upward arrows-design alternatives AND decompostion-all must add up to 1 The contribution of a child to its parent is the value of the child multiplied by the arrow value that connects them The value of a node is the sum of the contribution from each child. All leaf nodes have value 1
23
0.7 C -0.6
0.7
0.7 G
Conclusion
Bridged the gap between requirement analysis and implementation for NFRs
Maintained separation of concerns
Ease of traciblity