Test 5 Flashcards

1
Q

AOP

A

Aspect-Oriented Programming (AOP) complements OO programming by allowing the developer to dynamically modify the static OO model to deal with cross cutting concerns

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

Cross-cutting concerns

A

Concerns which “cross-cut” the class structure, lowering cohesion and increasing coupling.

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

CCC Consequences

A

Code Tangling

Code Scattering

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

Code Tangling

A

1) Code for CC is mixed with the business logic.

2) Reduces cohesion

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

Code Scattering

A

1) Code is duplicated because it is needed in multiple places
2) Reduces coupling

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

Lock handling Problem

A

1) Business logic code (put and get) is mixed with concurrency control code resulting in code tangling and poor cohesion
2) Have to add locking code correctly to every business logic code resulting in code scattering
3) Failure to do so would lead to hard to find bugs
4) Need a single, global lock resulting in extra coupling

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

Lock handling Pros

A

1) Avoids code scattering and tangling
2) Lock is localised as a private instance variable
3) Reusable simply by writing a new concrete aspect

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

AOP and Design Patterns Pros

A

1) Greater modularisation of concerns
2) Avoid code tangling and scattering
3) Easier software evolution
4) Greater code reuse
5) Easier management (easier to split tasks)
6) Cheaper implementation of new features

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

AOP and Design Patterns Cons

A

1) Program flow is hard to follow
2) Tendency to use CCC everywhere, leading to poor designs
3) Everybody on the team needs to be up to speed with AOP
4) Tools limited to those which support AOP language in use

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

AspectJ

A

1) Java AOP framework
2) Classes and aspects are written separately
3) “woven” together at bytecode generation time
4) Nothing in class code referes to the aspects

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

AspectJ advice kinds

A

before - code to be executed before join point
after - code to be executed after join point
around - replaces the code
pointcut - shows where the CC should be applied

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

AOP and Design Patterns

A

1) Observer and Singleton are the only ones who have any benefits
2) Pure fabrications have no sensible inheritance relationships outside the pattern
3) Combing patters will make AOP solutions more problematic

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

Advice

A

Additional code that you want to apply to your existing model

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

Join point

A

Place where CCC crosscuts the code

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

Point cut

A

Point of execution in the application at which cross-cutting concern needs to be applied

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

Aspect

A

The combination of the point-cut and the advice