Aspectual Component Implementation - PowerPoint PPT Presentation

About This Presentation
Title:

Aspectual Component Implementation

Description:

Op(){expectedOp(); getHost()} getHost() ConnectorPackage. HostPackage ... to be mapped to Op() Johan's solution 1 based on. Mira's inner class solution. ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 7
Provided by: karllie
Category:

less

Transcript and Presenter's Notes

Title: Aspectual Component Implementation


1
Aspectual Component Implementation
  • Examples

2
ConnectorPackage
ComponentPackage
MyHost toModify()part.Op()// override
aux()super.toModify() part
Component
Participant expectedOp() Op()expectedOp()
getHost() getHost()
ParticipantAnonymousExtended expectedOp()aux()
getHost()MyHost.this main()new
MyHost().toModify()
outer.super.toModify() simulated with aux() is
not elegant
Johans solution 1 based on Miras inner class
solution. Modification interface is represented
also by abstract class, not by Method argument
as proposed by Mira.
HostPackage
Host // to play role of participant
toModify() // to be mapped to Op()
3
ConnectorPackage
ComponentPackage
MyHost toModify()part.Op()
aux()super.toModify() part
Component
Participant expectedOp() Op()expectedOp()
getHost() getHost()
ParticipantAnonymousExtended expectedOp()aux()
getHost()MyHost.this main()new
MyHost().toModify()
Problem when we have a Host-object and want to
get modified behavior, need to create a MyHost
object.
Does it work with multiple participants? With
multiple hosts? Looks like.
HostPackage
Host toModify()
4
ConnectorPackage
ComponentPackage
MyHost toModify1()part1.Op()//overrride
aux1()super.toModify1() part1
Component
Participant expectedOp() Op()expectedOp???()
getHost() getHost()
ParticipantAnonymousExtended expectedOp1()aux1(
) getHost()MyHost.this main()new
MyHost().toModify1()
part2
ParticipantAnonymousExtended expectedOp2()aux2(
) getHost()MyHost.this main()new
MyHost().toModify2()
More complex connector one host but multiple
methods are modified. Which expectedOp should be
called in the participant? Is this why Miras
implementation is more complex?
toModify2()part2.Op()//override aux2()super.to
Modify2()
5
ConnectorPackage
ComponentPackage
MyHost toModify()part.rOp(toModify)
part
Component
Participant rOp(Method expOp)
expOp.invoke() getHost() getHost()
ParticipantAnonymousExtended getHost()MyHost.th
is main()new MyHost().toModify()
HostPackage
Host // to play role of participant
toModify() // to be mapped to rOp()
Miras modified inner class solution.
6
Implementations
  • Implement Datastructure/Counter/Lock example
  • without reflection
  • with reflection
  • apply to both Queue and Stack
  • Implement ShowRWAccess example simulate
    inheritance between components and connectors in
    Java
  • without reflection
  • with reflection
  • map readOp to two methods of two different
    application classes
Write a Comment
User Comments (0)
About PowerShow.com