Aspect-Oriented Programming
Explain the term Aspect-Oriented Programming in detail?
Expert
Aspect-Oriented Programming: Detection of certain program properties may involve instrumenting many entities such as classes and methods that are spread across the entire program—for example, detecting whether every connection open() call is followed by a connection close() call, or whether for all the classes that extend (or inherit from) a given base class the initialize() method is invoked within its constructor. A problem with detecting such properties is the amount of manual effort that is required to instrument the program.Manual instrumentation of the code to verify such properties is difficult and error-prone. Also, the instrumentation has to be done all over again for newer versions of the software.
Aspect-oriented programming (AOP) alleviates these problems by treating the instrumentation for such properties as a cross-cutting concern.
AOP languages such as AspectJ and AspectC++ support expressions that can encapsulate such concerns in special classes called aspects. An aspect can change the behavior of the program by applying additional behavior called advice at various join points in a program. You can specify a query that detects whether a given join point matches. Such a query is called a pointcut. An aspect can also make structural changes to other classes, such as adding members or parents.
For example, the following aspect specification can be used to check whether there are an equal number of calls to the fopen() and fclose() methods when the program ends. A model checker can capture the exception raised by the assertion violation when “counter > 0”.
Many AOP languages support method executions and field references as join points. The developer can write a pointcut to match, for example, all field-set operations on specific fields, and code to run when the field is actually set. Some languages also support extensions of specific classes with new method definitions. AOP languages vary based on the join points they expose, the language they use to specify the join points, the operations permitted at the join points, and the structural enhancements that can be expressed.
We used AOP, and in particular AspectC++, for code instrumentation in order to check many of the properties in our SAFM case study (Figure shown below). We analyzed several versions of the software, and the ease of instrumentation that the AOP techniques provided saved a lot of time and effort.
Coriolis principle for mass flow meter: This meter employs the Coriolis Effect to measure the quantity of mass moving via the element. The substance to be calculated runs via a U-shaped tube which is caused to vibrate in a perpendicular direction to f
Normal 0 false false
Building the Boeing 787 Boeing's newest commercial jet aircraft, the wide-bodied 787 jet, is a bold bet on the future of both airline travel a
What should I write I don't have any question
Write an AWK program which takes the following input _le and processes it. $cat data.txt John Do 111-1111 English 90 Maths 80 Alice Do 222-2222 English 90 Maths 90 Chemistry 93 The input _le has _rst 3 _elds _xed as _rst name, last name, and student id. After the s
What were the goals and motives of Radical Republicans?
Normal 0
You are to identify and research 3 different Requirements Management Tools. You will write a 3 page paper containing the following components: 1. For each RM tool, describe its major characteristics (or capabilities). 2.
18,76,764
1945988 Asked
3,689
Active Tutors
1441601
Questions Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!