This document proposes a mechanism called "perscope" to make aspect instantiation models (AIMs) pluggable in aspect-oriented programming languages. Perscope introduces a new keyword to replace existing keywords for defining AIMs, and defines interfaces for third parties to design and implement new custom AIMs. This allows new AIMs to be added without changing the compiler. The document outlines requirements for an extensible, declarative, expressive, efficient and flexible AIM mechanism, provides an example, and describes dynamic and static approaches to implementing perscope. It evaluates perscope by reimplementing existing AIMs and compares it to related work.
CDO is both a development-time model repository and a run-time persistence framework. Being highly optimized it supports object graphs of arbitrary size.
CDO offers transactions with save points, explicit locking, change notification, queries, temporality, branching, merging, offline and fail-over modes, ...
The storage back-end is pluggable and migrations between direct JDBC, Hibernate, Objectivity/DB, MongoDB or DB4O are seamless for CDO applications.
Introduction to AOP, AspectJ, and Explicit Join PointsKevin Hoffman
An introduction to and history of aspect-oriented programming. A short overview of AspectJ, certain challenges such as the state-point separation problem, and how explicit join points (EJPs) help mitigate these problems.
CDO is both a development-time model repository and a run-time persistence framework. Being highly optimized it supports object graphs of arbitrary size.
CDO offers transactions with save points, explicit locking, change notification, queries, temporality, branching, merging, offline and fail-over modes, ...
The storage back-end is pluggable and migrations between direct JDBC, Hibernate, Objectivity/DB, MongoDB or DB4O are seamless for CDO applications.
Introduction to AOP, AspectJ, and Explicit Join PointsKevin Hoffman
An introduction to and history of aspect-oriented programming. A short overview of AspectJ, certain challenges such as the state-point separation problem, and how explicit join points (EJPs) help mitigate these problems.
This is an introductory workshop for machine learning. Introduced machine learning tasks such as supervised learning, unsupervised learning and reinforcement learning.
Aim of this presentation is not to make you masters in Java 8 Concurrency, but to help you guide towards that goal. Sometimes it helps just to know that there is some API that might be suitable for a particular situation. Make use of the pointers given to search more and learn more on those topics. Refer to books, Java API Documentation, Blogs etc. to learn more. Examples and demos for all cases discussed will be added to my blog www.javajee.com.
Talk from JVMLS2014 on Nashorn moving towards a generic execution architecture for dynamic languages on the JVM. Explains the optimistic type architecture that is the basis for this. Also covers the last year's large leaps in performance.
Practical RISC-V Random Test Generation using Constraint Programminged271828
A proof-of-concept random test generator for RISC-V ISA is presented. The test generator uses constraint programming for specification of relationships between instructions and operands. Example scenarios to cover basic instruction randomization, data hazards, and non-sharing are presented. The tool integrates the RISC-V instruction set simulator to enable the generation of self-checking tests. The tool is implemented in Python using a freely-available constraint solver library. A summary of problems encountered is provided and next steps are discussed.
We all have learned SQL and by default we think of storing data in a relational database. Sometimes the passage from SQL to NoSQL requires us to unlearn SQL and this can be challenging. This presentation shows how to use the ANTLR parser to generate NoSQL API calls (for Aerospike) from SQL.
This is an introductory workshop for machine learning. Introduced machine learning tasks such as supervised learning, unsupervised learning and reinforcement learning.
Aim of this presentation is not to make you masters in Java 8 Concurrency, but to help you guide towards that goal. Sometimes it helps just to know that there is some API that might be suitable for a particular situation. Make use of the pointers given to search more and learn more on those topics. Refer to books, Java API Documentation, Blogs etc. to learn more. Examples and demos for all cases discussed will be added to my blog www.javajee.com.
Talk from JVMLS2014 on Nashorn moving towards a generic execution architecture for dynamic languages on the JVM. Explains the optimistic type architecture that is the basis for this. Also covers the last year's large leaps in performance.
Practical RISC-V Random Test Generation using Constraint Programminged271828
A proof-of-concept random test generator for RISC-V ISA is presented. The test generator uses constraint programming for specification of relationships between instructions and operands. Example scenarios to cover basic instruction randomization, data hazards, and non-sharing are presented. The tool integrates the RISC-V instruction set simulator to enable the generation of self-checking tests. The tool is implemented in Python using a freely-available constraint solver library. A summary of problems encountered is provided and next steps are discussed.
We all have learned SQL and by default we think of storing data in a relational database. Sometimes the passage from SQL to NoSQL requires us to unlearn SQL and this can be challenging. This presentation shows how to use the ANTLR parser to generate NoSQL API calls (for Aerospike) from SQL.
2. Aspect Instantiation Models (AIMs)
• What is an aspect?
– Crosscutting behavior + crosscutting state
• What is an AIM?
– 6 keyword in AspectJ: issingleton, pertarget, perthis,
percflow, percflowbelow, pertypewithin.
– Added incrementally to AspectJ
– More AIMs in other AOP languages
• There is a need for custom AIMs
– Challenge: decouple the definition of AIMs from the
evolution of the language
The Open University of Israel
3. Contribution of this Work
• Pluggable Aspect Instantiation Models
– Make AIMs pluggable!
❶ Language extension
– We introduce a new keyword: ‘perscope’
• Replaces the exiting 6 keywords
• Eliminates need for new keywords (hopefully)
❷ Interface for defining AIMs
– Third parties can design and implement new AIMs
❸ Library of AIM Implementations
– Fully implemented in ajc
The Open University of Israel
4. Outline
• Introduction
• Requirements
• Example
• Pluggable Mechanism
• Conclusion
The Open University of Israel
5. Motivation: “caching and auditing”
• Industrial Case Study
– Web application development with AspectJ
– Need for ‘persession’ and ‘perconversation’ AIMs
Cache
Cache
Cache Cache
Cache
The Open University of Israel
6. Current Solution
• Wait for a new release of AspectJ
– May take awhile…
• Modify the current ajc compiler
– Sisyphean, complex task
• Manage the state manually
– Tangled and scattered code
The Open University of Israel
7. Desired Solution
1. Pluggable 5.
Extensible AIM Flexible
Mechanism
2.
Declarative 4.
3. Efficient
Expressive
The Open University of Israel
8. Requirement 1: Extensible
• New AIMs can be introduced
– Perthread Perthread
– Persession
• Pre-defined AIMs can be refined
Per Recent
– Perthread that was started in the last hour
Thread
• Generic AIMs can be offered by
– Third-party providers
– AspectJ developers
The Open University of Israel
9. Requirement 2: Declarative
• Easy to use
– Like AspectJ
• AIMs implementation may vary
independently of their use
– Unlike AspectJ
AspectJ
public aspect MyAspect
perthis(myPointcut()){
}
perscope
public aspect MyAspect
perscope(Perthis, myPointcut()){
}
The Open University of Israel
10. Requirement 2: Declarative
• Easy to use
– Like AspectJ
• AIMs implementation may vary
independently of their use
– Unlike AspectJ
New keyword Class implements AIM
perscope
public aspect MyAspect
perscope(Perthis, myPointcut()){
}
The Open University of Israel
11. Requirement 3: Expressive
• Practical
– Realistically complex AIMs can be defined
– E.g., perconversation
• AspectJ compatible
– Can implement all 6 AspectJ AIMs
The Open University of Israel
12. Requirement 4: Efficient
• Weaving
– Implemented by bytecode weaving
• Runtime performance
– Generate the same bytecode as AspectJ
for the 6 AspectJ AIMs
The Open University of Israel
13. Requirement 5: Flexible
• Static AIM implementation
– Same woven performance as AspectJ
• Dynamic AIM implementation
– Encourages experimenting with AIMs
The Open University of Israel
14. Outline
• Introduction
• Requirements
• Example
• Pluggable Mechanism
• Evaluation
• Conclusion
The Open University of Israel
15. Example: Global Caching
Aspect
public aspect GlobalCaching AspectJ and perscope
extends SimpleCaching {
}
The Open University of Israel
16. Example: Perclient Caching
Aspect Aspect Aspect
Aspect
AspectJ
public aspect PerClientCaching extends SimpleCaching
perthis (cachedOperation(Object)) {
}
perscope
public aspect PerClientCaching extends SimpleCaching
perscope(Perthis, cachedOperation(Object)) {
}
The Open University of Israel
17. Example: Perconversation Caching
Aspect
Aspect
Aspect Aspect
public aspect PerConversationCaching
extends SimpleCaching perscope
perscope(Perconversation,
cachedOperation(Object)){
}
AspectJ
The Open University of Israel
18. Outline
• Introduction
• Requirements
• Example
• Pluggable Mechanism
– Dynamic
– Static
• Evaluation
• Conclusion
The Open University of Israel
19. Dynamic Implementation
• Implement the DynamicPerscope interface
• Specify how the aspect instance should be
bound, retrieved, and queried
public interface DynamicPerscope {
void bindAspect(Object aspekt, Object object);
Object aspectOf(Class<?> aspectType, Object
object);
boolean hasAspect(Class<?> aspectType, Object
object);
}
The Open University of Israel
20. DynamicPerscope: usage
public aspect PerThreadCaching extends SimpleCaching
perscope(Perthread, cachedOperation(Object)) {
}
The Open University of Israel
21. DynamicPerscope: implementation
public class Perthread implements DynamicPerscope {
private static ThreadLocal<Object> theAspect =
new ThreadLocal<Object>();
public void bindAspect(Object aspekt, Object o) {
if (theAspect.get() == null) {
theAspect.set(aspekt);
}
}
public Object aspectOf(Class<?> aspectType, Object o) {
return theAspect.get();
}
public boolean hasAspect(Class<?> aspectType, Object o){
return theAspect.get() != null;
}
}
The Open University of Israel
22. Static Implementation
• Bytecode manipulation
– Harder to implement
– Capable of producing efficient code
• StaticPerscope interface
– Hard-wired weaving code replaced with calls to the
StaticPerscope interface
The Open University of Israel
23. DynamicPerscope vs. StaticPerscope
• DynamicPerscope
– Regular Java code
– Intended for regular infrastructure programmers
• StaticPerscope
– More complex
– More efficient
– Intended for advanced infrastructure programmers
Note: these trade-offs are transparent to the
end user of AIM
The Open University of Israel
24. Outline
• Introduction
• Requirements
• Example
• Pluggable Mechanism
• Evaluation
• Conclusion
The Open University of Israel
25. Evaluation
• Implementing AspectJ built-in AIMs
– Caching example
– Law of Demeter (AspectBench compiler distribution)
• Implementing Non-AspectJ AIMs
– AspectS cflow advice activations
– JAsCo perthread AIM
– persession and perconversation
The Open University of Israel
26. Threats to Validity
• Implemented only for the ajc compiler
– Language feature
• AspectJ AIMs were tested on two examples
– Same bytecode is generated
• AIMs that cannot be implemented using
perscope
– Always true
AspectJ Other AOP
Languages
perscope Custom
The Open University of Israel
27. Outline
• Introduction
• Requirements
• Example
• Pluggable Mechanism
• Evaluation
• Conclusion
The Open University of Israel
28. Related Work
• Perscope vs. JAsCo
– IAspectFactory is used at runtime for aspect instantiation
– With perscope two choices: DynamicPerscope or
StaticPerscope
• Perscope vs. Caesar
– In Caesar aspect instantiated explicitly
– With perscope – implicitly according to aspect declaration
as in AspectJ
The Open University of Israel
29. Conclusion
• With perscope AIMs are pluggable
• New keyword ‘perscope’ is introduced
• Usage of AIMs is declarative
– As in AspectJ
• AIMs may be provided by third-parties
– Different than AspectJ
The Open University of Israel
30. Thank You!
• Questions?
• Contact information:
Software Engineering Research Lab
Open University of Israel
Email:
• lorenz@openu.ac.il
• victortr75@gmail.com
URL:
• http://aop.cslab.openu.ac.il/research/perscope/
The Open University of Israel