#1 2015-08-15 04:27:16

mariomoretti
Member
From: italy
Registered: 2012-01-29
Posts: 88

audit trail and good old DeLorean!

Hi AB,

we may agree on fact that audit trail is an half DELorean : it permits to move only to the past.

In some situations i need to determine the future.

So i've thought to do a new class with

   an array storing only properties to be changed , one row for each future date.
   an EndOfValidityDate , storing the last date of validity of properties actually stored in properties.
   a StartOfValidityDate (optional)
   methods to manage them

obviously i need a OnAfterRead event on server side , to verify EndOfValidityDate and , if the case, apply pending changes. It could be fired only for classes with audit trail enabled or, also, be independent from it, but associated to the class, to avoid unneeded calls.
I've looked , without success, for it. Can you help me , please ?
tx

Offline

#2 2015-08-15 11:22:33

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: audit trail and good old DeLorean!

IMHO it sounds like an anti-pattern.
Such a feature would break the persistence pattern, and put some business logic at the DB layer.

All this "DeLorean" mechanism should better stay out of the framework, and be implemented, on server side, in the service logic.

Offline

#3 2015-08-15 20:56:27

mariomoretti
Member
From: italy
Registered: 2012-01-29
Posts: 88

Re: audit trail and good old DeLorean!

ok,

I'll redefine creation methods.
tx

Offline

Board footer

Powered by FluxBB