Aspect Oriented Programming[1]  (AOP) lets you decorate classes and methods 
with extra behavior. Assuming that you're working with Neo4j in an embedded 
application, you'd use a library like AspectJ [2][3] to add "advice" to the 
Node.delete (actually the NodeImpl class) to perform your logic before the 
actual method is called, giving you the opportunity to *not* call the actual 
method. 

Personally, I always find it a bit scary to use AOP, but when it works it seems 
magical. 

Cheers,
Andreas

[1] http://en.wikipedia.org/wiki/Aspect-oriented_programming
[2] http://en.wikipedia.org/wiki/AspectJ
[3] http://www.eclipse.org/aspectj/

On May 24, 2011, at 12:41 PM, Jose Angel Inda Herrera wrote:

> El 5/24/2011 9:12 AM, Andreas Kollegger escribió:
>> Hi Jose,
>> 
>> Perhaps the event framework[1] would suit your purpose. The 
>> TransactionEventHandler [2] includes operations for intercepting a 
>> transaction before it is committed.
>> 
>> Otherwise, to intercept the Node.delete call itself, you'd have to look into 
>> using AOP.
>> 
>> Cheers,
>> Andreas
>> 
>> [1] http://wiki.neo4j.org/content/Event_framework
>> [2] 
>> http://components.neo4j.org/neo4j/1.4.M02/apidocs/org/neo4j/graphdb/event/TransactionEventHandler.html
>> 
>> On May 24, 2011, at 6:59 AM, Jose Angel Inda Herrera wrote:
>> 
>>> how could include a function in the Node class I check if a node is
>>> being removed or not. for example, have an attribute in the class that
>>> implements a node when it is created, and when it is called the delete
>>> function to change the value attribute and thus can control whether to
>>> delete or not. I need help on this
>>> _______________________________________________
>>> Neo4j mailing list
>>> User@lists.neo4j.org
>>> https://lists.neo4j.org/mailman/listinfo/user
>> _______________________________________________
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
> thanks andreas, but you can explain to me that is AOP and how using
> thanks and cheers
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to