How to manage object revisions in Grails?

前端 未结 1 477
悲哀的现实
悲哀的现实 2021-02-12 23:27

I need to implement a revision system for articles in my grails web app. After searching grails forum, stackoverflow, grails plugins and googling internet, I ha

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-12 23:36

    Since I didn't get any answers during the days following my question, we have started investigating all of the options and came to the following results/conclusions :

    1. Envers plugin : while Envers is a well-established way to handle object revisions and auditing with Hibernate (as pointed out by Vadeg), there is no such out-of-the-shelf solution for grails. Envers plugin is stricly useless and a dead-never-born project. Therefore, using Envers with GORM is still not possible directly BUT I believe that there is a space for an Envers Plugin (maybe part of grail 2.0 ?) since Envers is now integral part of Hibernate core modules. However, we didn't have time to implement such a solution (which is by far the best one when you have enough time and resources ahead of you)...so we dropped it.

    2. Gvers plugin : Surprisingly this plug-in is working like a charm even if it seems that no one is using it in GRAILS world (even the plugin creator that has an invalid email!). Seems risky to go with it but if your requirements are low (like a basic versioning system), you should go with it..

    3. Built-In System : except if you are building a CMS system with very specific needs OR at the contrary something very simple, I would not go for it in any other cases. Weceem is very-well implemented with plenty of examples for CMS content revisions, but even for this, it's a pity that they don't use Envers instead. No need to reinvent the wheel...better to improve existing Ferrari, no?

    4. VCS System : one friend has suggested me to use existing solutions that are built especially for this kind of tasks : Version control System of course!! Actually GIT seems to be the perfect candidate : fast, reliable, alomst-free repositories available at your disposal. Actually this is perfect solution. My only problem : well, I don't know how to use Git (and even less its API) and again I don't have time.

    Bottom Line

    I will certainly use Gvers but if you are familiar with Git or if you feel comfortable with GORM and Hibernate, go for building a grail plugin (either based on Git or Envers)

    0 讨论(0)
提交回复
热议问题