SpringSource/spring-data-neo4j — pull request #78 by lassewesth (2012-08-31 10:25:52+00:00)
Title: DATAGRAPH-285 preview

Michael, just a preview to get feedback on.

This is what I think we need. We already have transaction hooks from Neo4j itself, but those are not reflected on save because of caching. I assume removing that caching would be too painful, performance wise.

So this offers application events for the save-lifecycle, to start with. A user could use it to inject or extract audit information, and any injections would be reflected as part of the call to save. That was the problem in the ticket (https://jira.springsource.org/browse/DATAGRAPH-285).

Fairly basic so far, only two hooks: pre-save and post-save. Need to complete those obviously, and probably also need to roll it out to all creating/ updating methods in the template.

Was this what you imagined too?

The idea of callbacks: I looked into SD Mongo, callbacks there are just used as a software engineering nice-to-have, where each method is encapsulated as a command effectively, and they can then apply e.g. events and logging in one place. We could do something similar with a bit of refactoring, but it is perpendicular to the user story of reflecting these cross-cutting events.