AdrianCitu / aoplib4j

aop library for Java
0 stars 0 forks source link

Defensive copy aspect #90

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is inspired from the Item 24(Make defensive copies when needed) of 
Effective Java (first edition).

The aspect can have multiple variants:
1. a generic aspect that for the execution of all the (non void)public methods 
will call the clone method on the object returned by the method.

2. annotate the methods with the @DeffCopy annotation (annotate the interface 
methods); at the execution of the annotated methods, call the clone method or 
instantiate a user defined class (passed as parameter to the @DeffCopy) that 
will make the copy of the object.

2. put the annotation @DeffCopy  on the classes and then intercept all the 
execution of the (public only ?) methods that have as return object annotated 
classes (the pointcut is something like: (@DeffCopy *) *(..))

This is a feature; will contain all the bugs associated.

Original issue reported on code.google.com by adyc...@gmail.com on 17 Jul 2010 at 9:09

GoogleCodeExporter commented 8 years ago

Original comment by adyc...@gmail.com on 17 Jul 2010 at 9:09

GoogleCodeExporter commented 8 years ago

Original comment by adyc...@gmail.com on 22 Jan 2011 at 5:18