简体   繁体   English

如何将Java EE应用程序迁移到rails

[英]How to migrate Java EE application to rails

We are in the process of migrating our CRM app built using (JBoss AS, JDBC, Hibernate, MySQL) into Rails 3.2.x 我们正在将使用(JBoss AS,JDBC,Hibernate,MySQL)构建的CRM应用程序迁移到Rails 3.2.x中

We would like to keep the database schema as it is, so that we have minimal effort while we move into a new web architecture with Rails. 我们希望保持数据库模式不变,这样我们在使用Rails进入新的Web架构时就可以轻松完成。 Are there any tools which will help me generate the models/controllers and handle migrations from a database perspective. 是否有任何工具可以帮助我生成模型/控制器并从数据库角度处理迁移。

What strategy should we use so that we can keep the old application humming in production before we move to the newer Rails app. 我们应该采用什么策略,以便在迁移到新的Rails应用程序之前,我们可以将旧应用程序保持在生产中。

Here is what I think, and what I have done the same past :) 这是我的想法,以及我过去所做的:)

1 - first write the models coupling with your existing DB (I think you are using ActiveRecord with Rails , if not you should :D) 1 - 首先编写与现有数据库耦合的模型(我认为你正在使用带有Rails的ActiveRecord,如果不是你应该:D)

2 - Try your level best to use ActiveRecord and its components, avoid using pure SQL, because later that will create a mess 2 - 尽量使用ActiveRecord及其组件,避免使用纯SQL,因为以后会造成混乱

3 - cover with good unit tests and make sure your models are working with existing DB and all the relations etc. 3 - 覆盖良好的单元测试,并确保您的模型与现有数据库和所有关系等一起工作。

4 - then move to the controller and view layer 4 - 然后移动到控制器和视图层

5 - Golden rule, try to keep Rails conventions as much as possible, because the beauty of rails is that, if you follow the rails way things will "just work" 5 - 黄金法则,尽量保持Rails惯例,因为rails的美妙之处在于,如果你按照rails的方式,事情将“正常工作”

(Since you are using the same database you will not have the headache of data migration). (由于您使用的是同一个数据库,因此您不必担心数据迁移)。

And +1 migrating from Java to Ruby :) 并且+1从Java迁移到Ruby :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM