Professional Documents
Culture Documents
on APPLIED COMPUTER & APPLIED COMPUTATIONAL SCIENCE (ACACOS '08), Hangzhou, China, April 6-8, 2008
Abstract
Aspect oriented technology is created to address the problems (crosscutting) that were not effectively solved
through object oriented techniques, the current research has contributed to fill the gap between Aspect
Oriented Programming (AOP) and other phases of software development life cycle this gap is now decreasing.
In object oriented software design, patterns are tools of software engineers to solve the recurring design
problems while at programming level AOP is the solution to recurring aspects. The proposed Aspect Design
Pattern for non functional requirements considers the aspect at design level and provides a design level
solution that handles the aspects and mainly non functional requirements.
Keywords: Software design patterns, aspect oriented design, non functional requirements
oriented design patterns through aspect oriented better traceability and consistency throughout the
languages. lifecycle, another thing mentioned in figure 2 is the
It has been observed in [7][8] that the aspect identification of aspects at requirement analysis
oriented implementation of GoF design patterns level for this purpose we are using the approach
resulted in better code locality, improved modularity mentioned in [14]. According to which the construct
and traceability. or stereo type of <<extend>> in UML is an indicator
of the crosscutting. Although the requirement
2- Requirement for an Aspect Design analysis phase or identification of aspects at
Pattern requirement level is not the primary focus of this
paper, we have used this approach just to have a
While observing both the design patterns and AOP,
good start point to solve the case under
we can say that the design patterns are at higher
consideration.
level of abstraction and the solution provided by the
AOP is at the lower level of abstraction.
Requirement AO
But both the design patterns and aspects have a Analysis
OO Design
Implementatio
pattern
common characteristic that they provide solution to
(a) Poor Traceability between different phases
recurring problem at two different levels of
abstraction. Adding to it AOP provides solution to Requirement
Aspect design
AO
Analysis Implementatio
the recurring aspects within an application as well as Pattern
example resolved, variants, known uses, see also Class A Class B Class c
Attributes Attributes Attributes
and consequences [16]. All these forms of design Methods/functio Methods/functio Methods/functio
pattern contain the basic categories name, problem
statement, context, description of forces and Aspect
solution. Point cut
Advice
On the basis of the above we have proposed our
Aspect Design Pattern for Non Functional Figure 2: Abstract structure diagram of pattern
Requirement, which mainly constitutes on
Alexandrian form with some of the elements of 5-Case Study
other pattern forms. We have considered the scenario of a shopping cart
Our proposed pattern has the following elements: with a focus on logging (non functional
requirement) for the application of proposed pattern.
• Pattern Name We have used minimum number of classes to
• Problem Statement represent the case study and used the approach given
• Forces in [15] to represent the aspect.
• Context 5.1 Shopping Cart case study
• Participants A customer selects the items she wants to purchase
• Structure and adds to the cart, customer may remove the item
• Implementation from the cart or she can empty the cart. The
customer can add an item to the cart, the cart
• Join Points
operator updates the stock and remove that item
from the total and when customer remove item from
4-Description of Pattern Elements the cart, cart operator adds that item to the stock and
The first element of the pattern template is the when customer empty the cart, cart operator again
pattern name according to the best practices in the update the stock and add all items removed from the
field of design pattern. The name should be short cart to the stock. As any of the above mentioned
and descriptive. Problem statement describes the operation is performed, it is recorded in a log file.
problem for which the pattern is going to provide Concerns
the solution. A force is the element that describes We have identified the following concerns of
rationale behind the use of this pattern in case of our customer and cart operator from the above
proposed pattern the existence of aspect i.e. any mentioned case study
implicit or non functional requirement is the force. Customer is concerned with
Context contains the scenario which illustrates the 1- Add item to cart
situations where this pattern is applicable, as we 2- Remove item from cart
have established in section 2 that the aspects recur in 3- Empty the cart
different applications and behave almost in same Cart Operator is concerned with
manner, so it is quite simple to illustrate such 1-Updating the Stock in case of add, remove, empty
situation or context. Participants are the entities (this concern of the cart operator is crosscutting the
(classes) that can be affected by the presence of an concerns of customer). Whenever there is an update
aspect. The structure element of the aspect design in stock is it has to be recorded in the log file.
pattern describes the abstract structure of the pattern
as depicted in figure 2. Implementation contains the
general implementation of the pattern or may have
some sample code. The last element of the design
pattern is join points which are well defined points
in the execution of a program or a point where the
requirements crosscut each other. Join point is a
construct of aspect oriented languages. The
inclusion of this element makes the pattern unique
because it has incorporated a construct of the aspect
oriented languages into the design pattern. Now the
join points are visible at the design level which will
result in a better tractability between the artifacts of
the design and implementation level.
Figure 3: Use case diagram of the system
References
[1] Gregor Kiczales et al, “Aspect-Oriented [6] Christina et al. “A Theory of Aspects for
Programming”, Proceedings of European Aspect-Oriented Software Development”
Conference on Object-Oriented Programming, Proceedings of the 7th Brazilian Symposium on
1997 Software Engineering, 2003.
[2] Sue et al. “Aspect Oriented Software [7] Jan Hannemann et al. “Design Pattern
Development: Towards A Philosophical Basis”, Implementation in Java and AspectJ”, Proceedings
Technical Report TR-06-01, Department of of the 17th ACM SIGPLAN conference on Object-
Computer Science, King’s College London, 2006 oriented programming, systems, languages, and
[3] Roger S. Pressman,” Software Engineering A applications, 2002
Practitioners Approach” 6th edition pg 267 [8] Ouafa Hachani et al. “Using Aspect-Oriented
[4] IBM Dictionary of Computing International Programming for Design Pattern
Edition. Implementation”,Workshop of the 8th
[5] http://trese.cs.utwente.nl International
Conference on Object-Oriented Information [13] Doug Lea, “Christopher Alexander: an
Systems OOIS, 2002 Introduction for Object Oriented Designers” ACM
[9] Peter Coad, “Object Oriented Pattern”, SIGSOFT Software Engineering Notes, v.19 n.1,
Communication of ACM vol. 35, No. 9 1992 p.39-46, 1994
[10] Christopher Alexander, “The Timeless Way [14] Ruzanna Chitchyan et al. “Survey of Analysis
of Building” Oxford University Press, 1979 and Design Approaches” version 1.0, 2005
[11] Deepak Dahiya et al. “Approaches to Aspect [15] Gefei Zhang, “Toward Aspect-Oriented Class
Oriented Design: A study” ACM SIGSOFT Diagrams” proceedings of the 12th Asia-Pacific
Software Engineering Notes, v.31 n.5, 2006 Software Engineering Conference (APSEC’05)
[12] Oufa Hachani et al. “On Aspect-Oriented [16] Martin Fowler,“Writing Software Patterns”
Technology and Object-Oriented Design Pattern” available at
ECOOP 2003 AAOS Workshop, 2003 http://www.martinfowler.com/articles/writingPatte
rns