Font Size: a A A

Techniques For Separation Of Crosscutting Concerns

Posted on:2008-11-06Degree:DoctorType:Dissertation
Country:ChinaCandidate:L L HeFull Text:PDF
GTID:1118360212997678Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
One of the most important principles of software engineering is the principle of separation of concerns, which was proposed by Dijkstra in 1976. Dijkstra's viewpoint is summarized as"deal with one import issue at a time". The importance of separation of concerns is well known, but there are still some concerns, known as crosscutting concerns, in software system: whose implementation cannot be captured cleanly inside modular units, but crosscuts the existing decomposition of the software, scattering and tangling. In the mid-1990, a new paradigm, Aspect oriented programming, emerged. Aspect-oriented programming offers developers an extra abstraction'Aspect'to group the code dealing with a crosscutting concern, then the software can be decomposed into cleanly encapsulated modules.The success and popularity of Aspect-oriented programming has raised the important issue of how an already existing software system can be transformed into an Aspect oriented one. The core of the problem is how to identify the crosscutting concerns from the legacy system, extract the code of the concerns and put it into an Aspect. It is a two-stage process: 1. Aspect Mining; 2. Aspect Refactoring. Under this context this paper makes the researches on the bellowing Aspects:Aspect mining or Aspect identification is a reverse engineering process aimed at finding potential Aspect in existing non-aspect oriented code. It can be conducted in two ways, a bottom up approach without knowledge about the system, or a top down approach searching for code that implements some known crosscutting concerns. Usually, up-to-date documentation is often unavailable, and no one could tell what kind of crosscutting concerns are there in the given legacy system. The only thing that could depend on is the source code itself. Reasoning about the source code or about data that is acquired by executing or manipulating the code, searching for symptoms of crosscutting concerns, engineers then may find out the potential Aspects. Code scattering and code tangling are two symptoms which indicate the existence of crosscutting concerns. In OO system, member methods implement the minimal function. Member methods are the targets to be analysized to find out connotative crosscutting concerns. There are two kinds of implementation of crosscutting concerns in well-structured system:"function definition"and"function reference". The implementation codes of crosscutting concerns of"function definition"are encapsulated in one or more methods, while the implementation codes of"function reference"are the statements that call the methods which implement the function of crosscutting concerns, and related program elements.We propose an Aspect mining approach based on the concept lattice named AMUCO. It is a kind of bottom up Aspect mining approach which applies concept lattice to static direct invocation relationship among member methods of object-oriented systems to characterize code scattering. The assumption behind this approach is that the behavior from the same concern often has a similar mode of invocation. Candidate Aspects are contained in the bottom side of concept lattice. Candidate Aspects are provided by method sets. The method(s) from the same set is (are) the implementation of the same crosscutting concern. Experiment shows that scattered method(s) that implement some crosscutting concerns can be found by AMUCO. For that method, who implements a different side of target concerns without the same naming rules, AMUCO can identify them as a candidate crosscutting concerns.We propose another Aspect mining technique named AMUCA, which use both clustering analysis and association rule mining for Aspect mining. AMUCA has the same assumption and granularity with AMUCO; it discovers Aspects at the level of methods, but use a different mining algorithm, and a different crosscuts identification technique. Candidate Aspects, including advice declaration, pointcuts and advice body, are generated automatically after clustering and association rule mining. Experiment shows the same candidate Aspects can be gotten using AMUCA on the same case.CHAMELEON algorithm is used in the AMUCA approach because it has stronger ability in finding clusters that are of diverse shapes, densities, and sizes. But when dealing with large multidimensional data in the context of Aspect mining, CHAMELEON costs too much time. ICHAMELEON, the improvement of CHAMELEON, is proposed to solve the problem. ICHAMELEON combine historical clustering result with "incremental" data items, which keeps the dynamic clustering characteristic of CHAMELEON and is highly efficient in terms of time complexity. Experimental results on large high-dimensional data sets show the efficiency of ICHAMELEON compared with CHAMELEON.The techniques mentioned above identify program elements which participate in a crosscutting concern based on source code characteristics. The identified elements are sets of member methods. The methods in one set constitute the"function definition"type of implement of crosscutting concerns. The methods are"seeds"for further Aspect mining to find out all of the elements (classes, methods, fields, or statements) that implement target crosscutting concerns, which constitute the"function reference"type of code of crosscutting concerns.We propose a novel approach for searching Aspect code based on class-relation diagram (CRD). It is a top-down Aspect mining technique by using the given"seeds"of target system. A CR diagram is a directed diagram, and it provides a structural representation of legacy system. It can be used to find and document the implementation code of crosscutting concerns. Two kinds of approach and process are detailed in this paper according to the character of implementation code of crosscutting concerns. An Aspect refactoring approach based on class relation diagram is provided to extract the implementation code into Aspect. A five-step encapsulating process is built according to the five sub-structures defined in AspectJ's Aspect. Two kinds of encapsulating process are used according to the two different types of Aspect searching approach.The whole process for mining the implementation code of crosscutting concern from object-oriented legacy system and refactoring them to Aspect is detailed in this thesis. Both the bottom-up and top-down Aspect mining approaches are used in the mining process, and all elements that implement the crosscutting concerns can be found out. Two approach, AMUCO and AMUCA, are proposed aimed to find out"function definition"type of implement in object-oriented system, but they can be used on the Aspect mining of legacy system written in an imperative language with a few modification, because the similarity defined here are based on the static direct invocation relationship between member methods.The study results of the thesis are of both theoretical and practical benefit to further researches on separation of crosscutting concerns methods, and migration of legacy system to Aspect oriented one.
Keywords/Search Tags:Separation of concerns, Crosscutting concerns, Aspect, Aspect-oriented programming, Legacy system, Aspect mining, Aspect Refactoring, Concept lattice, Association rule, Class relationship graph, Joinpoints, Pointcuts, Join-point model, Advice
PDF Full Text Request
Related items