Aspect Oriented Programming Flashcards

1
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
\_\_\_\_ 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
A

c. After returning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
\_\_\_\_ 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
A

d. Before

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
\_\_\_\_\_ advice executes if a method exits by throwing an exception.
Select one:
a. After returning
b. After
c. Before
d. Around
e. After throwing
A

e. After throwing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
\_\_\_\_\_ 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
A

b. After

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
\_\_\_\_\_ 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
A

c. Around

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

b. after, after throwing, after returning, around, before

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

b. Action taken at a particular join point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

d. A modularization of a concern that cuts across multiple objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

d. A point during the execution of a program, such as the execution of a method or the handling of an exception

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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

A

d. A predicate or expression that matches join points to determine when code should run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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.

A

b. The modularization of cross cutting concerns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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).

A

c. Exposes the proceed(..) method in order to support around advice in @AspectJ aspects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly