7 Replies Latest reply on Sep 23, 2010 1:32 PM by fbascheper

    Proposal to rename ValidAuditTimeStrategy

    fbascheper

      Hi,

       

      I have been thinking about this some time, but I believe we need a better name for the ValidAuditTimeStrategy.

      Of course, this affects both the class name and the envers configuration option.

       

      I think we need to do this ASAP (before 3.6.0 goes CR or even GA), because it will cause less incompatibility issues.

      We could keep the old configuration option for compatibility reasons, but that may not be necessary since you marked this as experimental.

       

      There are a couple of reasons why I dislike this name

      * It suggests that AuditTimes can be invalid. I cannot image how this could be the case.

      * We already have AuditStrategy and DefaultAuditStrategy. So it would we logical that the name should end with AuditStrategy.

      * The strategy is based on the use of a revision end column, not on anything like time(stamp)s.

       

       

      I propose to rename this strategy to RevisionEndColumnAuditStratigy.

       

       

      What do you think? If you agree, I could create an issue with a patch to fix this.

       

       

      Kind regards,

      Erik-Berndt Scheper

       

       

      BTW Could you take a look at my revised patch for HHH-5371?

      If this could be integrated before I create a patch to rename the audit strategy, than that would spare me the time to revise the patch for HHH-5371 again.

        • 1. Re: Proposal to rename ValidAuditTimeStrategy
          adamw

          I agree that the ValidTime may be misleading, and in fact I was also looking for a better name but failed to come up with one.

          And what do you think about StartEndRevisionAuditStrategy, as in fact both revisions are used (not only the end-revision)?

           

          Adam

          • 2. Re: Proposal to rename ValidAuditTimeStrategy
            fbascheper

            Indeed: it can be difficult to find a good name for things such as strategies. Names should be distinctive, short and still describe its intented usage.

             

            Of course, you're right that the start-revision is used by what's now called 'ValidAuditTimeStrategy', but this is also the case for the DefaultAuditStrategy. The use of an end-revision is what sets this strategy apart from the DefaultAuditStrategy. And not the fact that it uses a start-revision: that's what they have in common.

             

             

            That's why I believe adding 'Start' to the Strategy doesn't add extra value.

             

             

            I think that the difference between RevisionEndAuditStratigy or EndRevisionAudityStrategy is arbitrary. Personally I like EndRevisionAudityStrategy better.

             

            The reason I originally proposed the name RevisionEndColumnAuditStrategy (had you spotted the typo  ...) is that this strategy adds the revision-end column (not end-revision) to the audit tables.

             

            But on second thoughts, I like EndRevisionAudityStrategy better.

             

            Kind Regards,

            Erik-Berndt

            • 3. Re: Proposal to rename ValidAuditTimeStrategy
              fbascheper

              Since you agreed thit ValidTime is misleading, I've created Hibernate issue HHH-5560 (Envers ValidAuditTimeStrategy needs a better name) for this.

              • 4. Re: Proposal to rename ValidAuditTimeStrategy
                adamw

                And what do you think about ValidityAuditStrategy?


                Thanks for creating the issue btw

                 

                Adam

                • 5. Re: Proposal to rename ValidAuditTimeStrategy
                  fbascheper

                  That looks good to me.

                  • 6. Re: Proposal to rename ValidAuditTimeStrategy
                    hernanbolido

                    Hello!

                     

                    This feature is a great improvement!

                    I would like to know if it's possible to switch from the original envers strategy to the new one and what are the necessary changes to achive that.

                    It would be great to have something like a strategy migration guide in the documentation...

                    Maybe the changes are trivial and this doesn't make sense... but I don't know.

                    What do you think?

                     

                    Regards. Hernán.

                    • 7. Re: Proposal to rename ValidAuditTimeStrategy
                      fbascheper

                      Hi,

                       

                      I'm working on a bit more documentation of this feature, and the relevant trade-offs.

                       

                      It should be possible to switch, but you only after you've added the new columns, and updated the values

                       

                      I'm still thinking about a migration strategy. If you have a good idea then you're very welcome.

                      Maybe it should be a separate program that generates

                      * alter table statements

                      * update statements for all audit tables (and audit join tables)

                       

                      The latter should be a repeatable process in the sense that all data is available.

                       

                      Regards,

                      Erik-Berndt