[FLOW3-general] APO: inter-type properties for Entities

Martin Eisengardt MEP_Eisen at web.de
Mon Oct 18 17:21:52 CEST 2010


Hi all.


Is there any way to let an aspect introduce properties in existing types? AspectJ defines inter-type behaviour not only for interfaces but for properties too. I know that there is no problem simply storing attributes via the AOP\ProxyInterface. But If I do it this way on enties those properties never will become persistent. It is because the class scheme does not know them and so they won't ever be respected.

Currently I am declaring the properties in the entity classes and declare aspects that do the needed stuff. However that smells. I would like to declare the properties an aspect needs within the aspect itself.

Practical example: There will be a module let you vote if you like an object or not (similar to the facebook "I like it" button). Objects to be voted on may be the Blog article or some record in a shop. The vote module only needs to introduce a "votable" interface and the "good"/"bad" counters in the objects without thinking which type of object that is. The votable interface will be implemented by an aspect.


Greetings
Martin


More information about the FLOW3-general mailing list