what is the most efficient way to rename/refactor the name of my MVC
I have my MVC ready, but now, there is a requirement to rename them to a new name, from top level down(including View, Controller, ActiveRecord model na开发者_如何学JAVAmes). What's the most efficent way to refactor all of them?
For example, rename from "Car" MVC to "Train" MVC without change the functionalities inside, only change the names. (the "Car" model also have some associations to other ActiveRecord models)
Unfortunately, there's no magic solution, you need manually change the class names in each of the files, and anywhere in code you reference those names. Find and Replace is your friend.
Having been through the procedure a couple of times, I think it's better to do the work of changing all the names rather then trying to mask different underlying names with routes or aliases - you'll just end up with confusing code in the long term.
精彩评论