将自定义持久层迁移到 hibernate3

发布于 2024-09-16 10:55:54 字数 669 浏览 9 评论 0原文

因此,很快,我将参与迁移,将本地持久层(大约任何好的、流行的 ORM)迁移到 hibernate3。然而,在这种迁移发生的同时,开发人员将努力在当前持久层之上实现新的业务逻辑,从而阻碍迁移!有人对如何最好地管理大约 1MLOC 的迁移有建议吗?

我有一些初步的想法,但我想要输入。

  1. 最初,hibernate 迁移可能需要成为主要开发线的一个分支,专门用于将当前系统转换为使用 hibernate。
  2. 在某些时候,开发应该切换到 hibernate 分支,或者应该将 hibernate 分支合并回主开发线。
  3. 尽管每个开发人员可能拥有完成新逻辑所需的特殊业务特定知识,但一些开发人员可能需要完全专注于迁移任务。

还有其他人执行过如此大规模的任务吗?我认为也许可以为每个开发人员提供某种配给量,例如新逻辑与迁移工作的 80/20、60/40 时间。通过这种方式,每个开发人员都可以拥有自己的代码领域,并且所有人都将接触到新的范例,以防止那些被排除在所有迁移工作之外、突然暴露于休眠状态的开发人员的生产力突然停止。

那么,哪个可能会更好呢?

仅负责迁移的开发人员核心单位

所有开发人员之间的开发分配分配以进行迁移

哪一个更好,为什么?

So, very soon, I will be part of a migration that will move a home-rolled persistence layer (circa any good, popular ORM) to hibernate3. However, at the same time that this migration happens, developers will be working to implement new business logic atop the current persistence layer, hence working against the migration! Does anyone have suggestions as to how best to manage a migration of about 1MLOC?

I have some initial thoughts, but I'd like input.

  1. Initially, the hibernate migration will likely need to be a branch of the main development line devoted solely to converting the current system to use hibernate.
  2. At some point, development should either switch to the hibernate branch, or the hibernate branch should be merged back into the main development line.
  3. Some developers will likely need to be pretty-solely devoted to the task of migration, although each developer may have special business-specific knowledge necessary for completing new logic.

Has anyone else performed a task of this magnitude? I'm thinking that perhaps some kind of rationing amount could be given to each developer, such as 80/20, 60/40 time for new logic vs. migration work. In this way, each developer can own their domain of the code, and all will be exposed to the new paradigms to prevent a sudden halt in productivity for developers left out of all migration work, suddenly exposed to hibernate.

So, then, which would likely be better?

A core unit of developers tasked solely with migration

or

A rationed split of development across all developers for migration

Which of these would be better, and why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清君侧 2024-09-23 10:55:54

我过去做过这样的迁移,情况非常相似:这是一个巨大的关键项目(迁移时有超过 120 名开发人员),该项目使用自己的持久性框架(不是 ORM,更多一个非常接近 JDBC 的数据映射器),我们在开始一年后引入 Hibernate,在构建阶段的中期,没有停止开发。

我们是这样做的:

  • 我们专门派了一支特警队(10 人,在紧张的 3 周内)来启动迁移,
  • 我们在一个单独的分支机构中进行了迁移,我们不能打扰
  • 我们从最深<的逻辑上开始的施工 团队。 /strong> 对象图的部分:(所有“参考数据”,如客户、银行帐户、金融工具等,即主要读取到处使用的数据)。
    • 我们为所有未经过充分测试的现有 DAO 编写了测试
    • 我们映射了业务对象,我们使用 Hibernate API 和 HQL 重写了 DAO 方法

  • ,并在一些极其关键的部分上做了进一步的处理,
  • 我们在周末合并了代码,进行所有可能的回归测试(0回归:)
  • 我们培训了施工团队并创建了一些新的开发规则
    • Hibernate 成为新开发的规则(如果可能的话)
    • 有机会迁移现有持久性代码

并且它有效。

I've done such a migration in the past, the situation was very similar: it was a huge critical project (more than 120 developers at the time of the migration), the project was using its own persistence framework (not an ORM, more a data mapper very close to JDBC), we introduced Hibernate 1 year after the start, in the middle of the construction phase, without stopping developments.

Here is how we did it:

  • we dedicated a swat team (10 people during 3 intense weeks) to initiate the migration
  • we did it in a separate branch, we couldn't disturb the construction team
  • we logically started with the deepest parts of objects graphs: (all the "reference data" like customers, bank accounts, financial instruments, etc, etc, i.e. mostly read data used everywhere).
    • we wrote tests for all existing DAOs that weren't enough tested
    • we mapped the business objects, we rewrote DAO methods using Hibernate API and HQL
  • and went a bit further on some extremely critical parts
  • we merged the code during a week end, doing all the possible regression testing (0 regression :)
  • we trained the construction team and created some new development rules
    • Hibernate became the rule (if possible) for new developments
    • migration of existing persistent code was done on opportunity

And it worked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文