Aspect Oriented Programming Flashcards
Match the following their definitions.
Cross cutting concern
Aspect
Advice
Pointcut
Join Point
Parts of a program that rely on or must affect many other parts of the system.
A modularization of a concern that cuts across multiple objects.
Parts of a program that rely on or must affect many other parts of the system.
Action taken by an aspect at a particular join point
A predicate that matches join points
The correct answer is: Cross cutting concern – Parts of a program that rely on or must affect many other parts of the system., Aspect – A modularization of a concern that cuts across multiple objects., Advice – Action taken by an aspect at a particular join point., Pointcut – A predicate that matches join points., Join Point – A point during the execution of a program, such as the execution of a method or the handling of an exception.
\_\_\_\_ advice executes after a join point completes normally: for example, if a method returns without throwing an exception. Select one: a. After throwing b. Around c. After returning d. After e. Before
c. After returning
\_\_\_\_ advice executes before a join point, but does not have the ability to prevent execution flow proceeding to the join point (unless it throws an exception). Select one: a. After b. After throwing c. After returning d. Before e. Around
d. Before
\_\_\_\_\_ advice executes if a method exits by throwing an exception. Select one: a. After returning b. After c. Before d. Around e. After throwing
e. After throwing
\_\_\_\_\_ advice executes regardless of the means by which a join point exits (normal or exceptional return). Select one: a. Around b. After c. After returning d. After throwing e. Before
b. After
\_\_\_\_\_ advice surrounds a join point such as a method invocation. This is the most powerful kind of advice. Select one: a. After returning b. Before c. Around d. After throwing e. After
c. Around
What are the different types of Advice?
Select one:
a. after, after exception, after returning, around, before
b. after, after throwing, after returning, around, before
c. during, after, after throwing, after returning, around
d. Lucy from Peanuts
b. after, after throwing, after returning, around, before
What do you mean by Advice?
Select one:
a. A point during the execution of a program, such as the execution of a method or the handling of an exception
b. Action taken at a particular join point
c. A predicate or expression that matches join points to determine when code should run
d. A modularization of a concern that cuts across multiple objects
b. Action taken at a particular join point
What do you mean by Aspect?
Select one:
a. Action taken at a particular join point
b. A predicate or expression that matches join points to determine when code should run
c. A point during the execution of a program, such as the execution of a method or the handling of an exception
d. A modularization of a concern that cuts across multiple objects
d. A modularization of a concern that cuts across multiple objects
What do you mean by join point?
Select one:
a. A modularization of a concern that cuts across multiple objects
b. Action taken at a particular join point
c. A predicate or expression that matches join points to determine when code should run
d. A point during the execution of a program, such as the execution of a method or the handling of an exception
d. A point during the execution of a program, such as the execution of a method or the handling of an exception
What is a pointcut?
Select one:
a. Action taken at a particular join point
b. A point during the execution of a program, such as the execution of a method or the handling of an exception
c. A modularization of a concern that cuts across multiple objects
d. A predicate or expression that matches join points to determine when code should run
d. A predicate or expression that matches join points to determine when code should run
What is AOP?
Select one:
a. Autowiring into a field.
b. The modularization of cross cutting concerns.
c. Reading from a properties file.
d. Providing integration for Spring and Hibernate.
b. The modularization of cross cutting concerns.
What is ProceedingJoinPoint?
Select one:
a. A join point that always represents a method execution
b. The object being advised by one or more aspects. Also referred to as the advised object.
c. Exposes the proceed(..) method in order to support around advice in @AspectJ aspects
d. An object created by the AOP framework in order to implement the aspect contracts (advise method executions and so on).
c. Exposes the proceed(..) method in order to support around advice in @AspectJ aspects