An approach for Framework Construction and Instantiation Using Pattern Languages Rosana Teresinha...
-
Upload
amanda-waters -
Category
Documents
-
view
220 -
download
1
Transcript of An approach for Framework Construction and Instantiation Using Pattern Languages Rosana Teresinha...
An approach for Framework Construction and Instantiation Using Pattern Languages
Rosana Teresinha Vaccare Braga
Paulo Cesar MasieroICMC-USP: Institute of Mathematical and Computer Sciences of the
University of São Paulo
São Carlos – SP – Brazil
ACIS International Conference on Computer Science, Software Engineering, Information Technology, e-Business, and Applications (CSITeA’02)
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
1 – Introduction and Motivation
Software Reuse: – Software Patterns: capture experience acquired during
software development, synthesizing it in a problem/solution pair.
– Pattern languages: organization of the knowledge about a specific domain into specific patterns that can be systematically applied in the development of systems in the same domain.
– Frameworks: set of abstract and concrete classes that can be customized to produce specific applications.
Problem: complexity to build and use frameworks
1 – Introduction and Motivation
Relationship between frameworks and pattern languages:– Pattern languages can be used to:
• document the framework• Support the framework design and implementation• Guide the transformation of the framework into a concrete application
Our proposal: – an approach to develop a framework from a pattern
language, and– to use this pattern language to instantiate the framework to
specific applications
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
2 - Approach for Framework Construction and Instantiation
Specific Systems
Pattern Language
Development
Experience in a specific domain
STEP 1
Specific System
Specific System
Wizard
Programminglanguage
STEP 3
WizardDevelopment
Pattern Language
Pattern Language
Programminglanguage
Requirements of a Specific Application
STEP 4 (a)
White-box-driven
Instantiation"Cookbook"
White-box Framework
Pattern Language
Wizard-driven
Instantiation
Requirements of a Specific Application
STEP 4 (b)Design-
patterns/metapatterns
STEP 2
Programminglanguage
White-boxFramework
Development
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
3 - Pattern Language Development
Objective: building a pattern language to capture the domain functionality and to guide the development of applications in the domain
Based on practical experience in the domain, domain analysis, or reverse engineering of existing systems
3 - Pattern Language Development
Steps:– 1) Produce an analysis model of the domain– 2) Define the patterns of the pattern language
• Look at recurring analysis patterns that are implicit in the model• Look at other pattern languages for equivalent domains• Try to isolate each pattern according to specific functions
performed• Try to create optional patterns when there are optional functions
– 3) Analyze interaction among patterns• Illustrate this information with a diagram• Do the cross-reference in the “Following patterns” section
GRN: A Pattern Language for Business Resource Management
Quantify the Resource (2)
Store the Resource (3)
Rent the Resource (4)
Reserve the Resource (5)
Trade the Resource (6)
Quote the Trade (7)
Check Resource Delivery (8)
Maintain theResource (9)
Quote the Maintenance (10)
Identify Maintenance Tasks (14)
Identify Maintenance Parts (15)
Itemize the Resource Transaction (11)
Pay for the Resource Transaction (12)
Identify the Resource Executor (13)
Identify the Resource (1)
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
4 - White-box Framework Development
Objective: building a set of classes to support the development of applications in the same domain of the pattern language
The classes belonging to patterns of the pattern language have the corresponding implementation in the framework
4 - White-box Framework Development
Steps:– 1) Identify the framework hot-spots, using the
pattern language.– 2) Design the framework, based on the list of hot
spots and on the pattern language.– 3) Implement the framework– 4) Document the mapping between the pattern
language and the framework, to ease future instantiation
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
5 – Wizard Development
Objective: creating a tool with a graphical user interface that follows the pattern language concepts
Specific applications can be implemented by following the wizard instructions, i.e., the pattern language is interactively applied by filling in the wizard screens
5 – Wizard Development
Data about the patterns, variants, classes, etc. can be stored in a meta-database and retrieved by the wizard
Information filled in by the user is also stored in a database.
Automatic adaptation of the framework to the specific application
Example of GREN-Wizard screen Example of GREN-Wizard report
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
6 – Framework Instantiation
Objective: Adapt the framework to specific applications, obtaining an executable code
Types of instantiation:– Using the white-box version of the framework– Using the wizard
6 – Framework Instantiation
– Instantiation using the white-box version of the framework
• Pattern language usage to obtain the analysis model of the application to instantiate
• Mapping from the analysis model to the framework classes
• Implementation of the application • Validation of the application
6 – Framework Instantiation
– Instantiation using the wizard• Pattern language usage to obtain the analysis model
of the application to instantiate• Usage of the Wizard to fill in the patterns applied and
respective roles played by each class in each pattern• Implementation of the application (done by the
wizard)• Validation of the application
Example of application generated using GREN-Wizard
Contents
1- Introduction and motivation 2- Overview of the approach 3- Pattern Language Development 4- White-box Framework Development 5- Wizard development 6- Framework instantiation 7- Concluding remarks
7 - Concluding Remarks
The approach here proposed intends to promote software reuse, allowing developers to better understand and use frameworks
Instantiation is eased because:– The framework architecture is related to the patterns of
the pattern language– No technical knowledge about the framework
implementation details is necessary to derive new applications from it.
7 - Concluding Remarks
Not all types of pattern languages could help framework construction and instantiation.
Candidate pattern languages: – those that concern problems to be solved during analysis
of systems in the domain
Information systems are an example of a domain that is suitable for this approach.
Concluding Remarks (continued)
During the framework usage in the development of specific applications and because of the application domain evolution, new hot spots may be necessary.– In this case, the pattern language must also be
updated, including new patterns or changing existing ones.
Contact
Rosana: [email protected] Paulo: [email protected]
LABES (Software Engineering Lab at ICMC-USP) http://nt-labes.icmc.sc.usp.br (in Portuguese only)
My WEB page: www.icmc.sc.usp.br/~rtvb/ingles.html
An approach for Framework Construction and Instantiation Using Pattern Languages
Rosana Teresinha Vaccare Braga
Paulo Cesar MasieroICMC-USP: Institute of Mathematical and Computer Sciences of the
University of São Paulo
São Carlos – SP – Brazil
ACIS International Conference on Computer Science, Software Engineering, Information Technology, e-Business, and Applications (CSITeA’02)
P a t t e r n 2 : Q U A N T I F Y T H E R E S O U R C E C o n t e x t
Y o u h a v e i d e n t i f i e d a r e s o u r c e t h a t y o u r a p p l i c a t i o n d e a l s w i t h a n d i t s r e l e v a n t q u a l i t i e s . A n i m p o r t a n t i s s u e t o b e c o n s i d e r e d n o w i s t h e f o r m o f r e s o u r c e q u a n t i f i c a t i o n . T h e r e a r e c e r t a i n a p p l i c a t i o n s i n w h i c h i t i s i m p o r t a n t t o t r a c e s p e c i f i c i n s t a n c e s o f a r e s o u r c e , b e c a u s e t h e y a r e t r a n s a c t e d i n d i v i d u a l l y . F o r e x a m p l e , a b o o k i n a l i b r a r y c a n h a v e s e v e r a l c o p i e s , e a c h l e n t t o a d i f f e r e n t r e a d e r . S o m e a p p l i c a t i o n s d e a l w i t h a c e r t a i n q u a n t i t y o f t h e r e s o u r c e o r w i t h r e s o u r c e l o t s . I n t h e s e a p p l i c a t i o n s , i t i s n o t n e c e s s a r y t o k n o w w h a t p a r t i c u l a r i n s t a n c e o f t h e r e s o u r c e w a s a c t u a l l y t r a n s a c t e d . F o r e x a m p l e , a c e r t a i n w e i g h t o f s t e e l i s s o l d . I n o t h e r a p p l i c a t i o n s , t h e r e s o u r c e i s d e a l t w i t h a s a w h o l e , a s f o r e x a m p l e a c a r t h a t g o e s t o m a i n t e n a n c e o r a d o c t o r t h a t e x a m i n e s a p a t i e n t .
P r o b l e m
H o w d o e s t h e a p p l i c a t i o n q u a n t i f y t h e b u s i n e s s r e s o u r c e ?
F o r c e s
K n o w i n g e x a c t l y w h a t i s t h e f o r m o f q u a n t i f i c a t i o n a d o p t e d b y t h e a p p l i c a t i o n i s i m p o r t a n t d u r i n g a n a l y s i s . A w r o n g d e c i s i o n a t t h i s p o i n t m a y c o m p r o m i s e f u t u r e e v o l u t i o n .
. . .
S t r u c t u r e T h e r e a r e f o u r s l i g h t l y d i f f e r e n t s o l u t i o n s f o r t h i s p r o b l e m ,
d e p e n d i n g o n t h e f o r m o f q u a n t i f i c a t i o n . F i g u r e s 4 t h r o u g h 7 s h o w t h e f o u r Q U A N T I F Y T H E R E S O U R C E s u b - p a t t e r n s . W h e n i t i s i m p o r t a n t t o d i s t i n g u i s h a m o n g r e s o u r c e i n s t a n c e s , u s e I N S T A N T I A B L E R E S O U R C E s u b - p a t t e r n ( F i g u r e 4 ) . W h e n t h e r e s o u r c e i s m a n a g e d i n a c e r t a i n q u a n t i t y , u s e t h e M E A S U R A B L E
R E S O U R C E s u b - p a t t e r n ( F i g u r e 5 ) .
h a s
1 *
R e s o u r c e I n s t a n c en u m b e rl o c a t i o ns t a t u si s A v a i l a b l e
R e s o u r c ei d C o d ed e s c r i p t i o n
c a l c u l a t e q t t y o f a v a i l a b l e i n s t a n c e s F i g u r e 4 : I N S T A N T I A B L E R E S O U R C E s u b - p a t t e r n
h a s
1*
R e s o u r c ei d C o d ed e s c r i p t i o nq u a n t i t y i n s t o c kr e - s u p p l y l e v e l! # l i s t r e s o u r c e s t o b e r e - s u p p l i e d
M e a s u r e U n i t yi d C o d ed e s c r i p t i o n
F i g u r e 5 : M E A S U R A B L E R E S O U R C E s u b - p a t t e r n
P a r t i c i p a n t s . . . E x a m p l e
. . .
F o l l o w i n g p a t t e r n s A f t e r y o u Q u a n t i f y t h e R e s o u r c e , e x a m i n e y o u r a p p l i c a t i o n t o v e r i f y w h e t h e r i t i s i m p o r t a n t t o k n o w a b o u t t h e r e s o u r c e s s t o r a g e . I f s o , t r y t o a p p l y S T O R E T H E R E S O U R C E ( 3 ) . I f n o t , p r o c e e d e x a m i n i n g y o u r a p p l i c a t i o n t o v e r i f y w h i c h k i n d o f r e s o u r c e t r a n s a c t i o n s a r e d o n e . I f t h e a p p l i c a t i o n c o n c e r n s r e s o u r c e l o c a t i o n o r r e n t a l , y o u s h o u l d a p p l y R E N T T H E R E S O U R C E ( 4 ) . I f t h e a p p l i c a t i o n c o n c e r n s r e s o u r c e t r a d i n g , i . e . , r e s o u r c e p u r c h a s e o r s a l e , y o u s h o u l d a p p l y T R A D E T H E R E S O U R C E ( 6 ) . I f t h e a p p l i c a t i o n d e a l s w i t h r e s o u r c e r e p a i r , y o u s h o u l d a p p l y M A I N T A I N T H E
R E S O U R C E ( 9 ) .
Example of Hot Spots tableHot spot number
Name Description Type Source in the pattern
language
Pat #
1 Resource Qualification
A resource can have a type, but this is optional. It can also have multiple types or nested types.
PARTIC_ CHOICE
Participants, Variants
1
2 Resource Quantification
A resource can be unique, can have multiple instances, can be managed in quantities or in lots
PARTIC_ CHOICE
Participants, Structure, Variants (sub-patterns)
2
3 Resource Storage
It can or cannot be desirable that the application manages the resource storage
PATTERN_OPTION
Language Graph+ Context
3
4 Resource Rental
The application may or may not concern resource rental
PATTERN_OPTION
Language Graph + Context
4