如何在Grails中管理对象修订版本? [英] How to manage object revisions in Grails?

查看:144
本文介绍了如何在Grails中管理对象修订版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的 grails 网络应用中为文章实施修订系统。在搜索grails论坛,stackoverflow,grails插件和谷歌搜索网络之后,我最终得到了3个选项:

选项1 - 使用 grails Envers插件(请参阅 http://code.google.com / p /的grails-envers-插件/ )。有没有人使用过它?或者使用不带插件的 Envers (参见这里)但是我怎样才能使它工作与GORM?

选项2 - 使用 Gvers插件我在这里找到了: https://github.com/ziftytodd/gvers 。我从来没有听说过任何人使用它,所以有谁曾经使用它成功?

选项3 - 内置机制 Weceem 为Weceem CMS的任何内容创建了一个版本控制系统。我可以从这个伟大的应用程序的代码和设计的逻辑中得到我的灵感,但它似乎是矫枉过正,我不喜欢使用非标准的解决方案。

所以我的问题是,你建议我做什么?您是否曾经使用过这些选项?



非常感谢您的洞察力。

解决方案

由于我在问题后的日子里没有得到任何答案,我们已经开始调查所有选项,并得出以下结果/结论:
$ b $ Envers插件:尽管Envers是一种用Hibernate处理对象修订和审计的正确方法(正如Vadeg指出的那样),但是,没有这种Grails的现成解决方案。 Envers插件是非常无用的,也是一个永无止境的项目。因此,使用Envers和GORM仍然是不可能的,但是我相信Envers插件(可能是grail 2.0的一部分)有空间,因为Envers现在是Hibernate核心模块的组成部分。然而,我们没有时间去实施这样的解决方案(当你有足够的时间和资源时,这是迄今为止最好的解决方案)......所以我们放弃了它。
  • Gvers插件:令人惊讶的是,即使看起来没有人在GRAILS世界中使用它(即使插件创建者具有无效电子邮件!)。看起来风险很大,但如果你的要求很低(就像一个基本的版本控制系统),你应该使用它。

  • 在系统中:除非您正在构建具有非常特定需求的CMS系统,或者相反很简单,否则我不会在其他任何情况下使用它。 Weceem很好地实施了大量CMS内容修订示例,但即使如此,可惜他们并未使用Envers。没有必要重新发明轮子......更好地改进现有的法拉利,不是吗?
  • VCS系统:有朋友建议我使用专门为此类任务构建的现有解决方案:版本控制系统当然!其实 GIT 似乎是最佳人选:快速,可靠,无异议的存储库可供您使用。其实这是完美的解决方案。我唯一的问题:好吧,我不知道如何使用Git(甚至更少的API),并且我没有时间。




  • 底线



    我一定会使用 Gvers ,但如果您熟悉 Git 或者如果您对 GORM Hibernate 感到满意,则可以创建一个grail插件(基于 Git Envers 强>)


    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 have ended up with 3 options:

    Option 1 - Using the grails Envers plugin (see http://code.google.com/p/grails-envers-plugin/). Has anyone used it successfully? Or using Envers without the plugin (see here) but how can I make it work with GORM?

    Option 2 - Using the Gvers plugin I have found out here: https://github.com/ziftytodd/gvers. I never heard anyone using it, so is there anybody who have ever used it successfully?

    Option 3 - Built -in mechanism. Weceem has created a versioning system for any content of the Weceem CMS. I can draw my inspiration from the logic of the code and design of this great application but it seems like overkill and I don't really like using non-standard solutions.

    So my question, what do you advise me to do ? Have you ever used any of these options ?

    Thank you very much for your insights.

    解决方案

    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)

    这篇关于如何在Grails中管理对象修订版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆