10
AOP issues

AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Embed Size (px)

Citation preview

Page 1: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

AOP issues

Page 2: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Class/Aspect Table

A1 A2 A3 A4 A5

C1

C2

C3

C4

C5

Page 3: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Loose Coupling Classes/Aspects

• When we evolve a class, how many aspects do we have to change?

• When we evolve an aspect, how many classes are affected? Ideally none. Classes oblivious of aspects.

Page 4: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Techniques for loose coupling of aspects/classes

• AP: structure-shy programming

• AC: put crosscutting into adapters

• Doug: BOP: each method encapsulates the condition when it is applicable. More kinds of cond. lead to better separation of concerns

• parameterize: decouple aspects from classes

Page 5: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

variables in pointcut designators

• more efficient: can generate faster code

• pointcuts separated from advice. Abstract pointcuts.– x from first arg, x from second arg. Extra layer

of abstraction– virtual class = type defined by predicate.

Exported variables become virtual fields

Page 6: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

other reasons for differential programming than evolution

• behavior variation

– kind specific: oo

– context-dependent

• state dependent: predicate over arguments

• perspective dependent: person takes different roles; overlapping predicates; predicate dispatch; multi-way association

• application dependent:depends on calling context; jumping aspect; only trace from caller x. Generic usage pattern; open implementation example: too many windows. previous decision point

• environment dependent:network bandwidth changes dynamically; network-aware application; QuO; access to global system functions inside predicates. Variation of state.

Page 7: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Service Business

• does doug have introductions?

• enabler bundles: Party, Address, Addressing, ProductOffering, BusinessInstance

• consolidation bundle: assigns values to fields of ProductOffering objects, BusinessInstance

Page 8: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Service Business

• delivery bundle

Page 9: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Design: Service Business

• enabler bundles:

– PartyB: Party and LabeledPartyGraph

– AddressB: Address, Addressing

– ProductB: ProductOffering

– EventB: EnablerEvent

– EligibilityB:

• consolidation bundle:

– AgreementB: Agreement

• delivery bundles:

Page 10: AOP issues. Class/Aspect Table Loose Coupling Classes/Aspects When we evolve a class, how many aspects do we have to change? When we evolve an aspect,

Design: Service Business

• delivery bundles:– EventB: DeliveryEvent, EventTracking– AccountB: FeeComp, InterestComp, Position– AvailabilityB: Availability– RiskB: uses Availability