I have been working on a website with PHP + Kohana for more than a year. There are ~100K – 150K lines of codes (CSS + JS + PHP), and there are ~150 PHP files (application classes and helper modules, not including the Kohana’s system & module files).
Because of some reasons, I need to transfer the whole projects to Java (with Play! framework). It obviously will take not a short period of time to finish the transfer, so I plan to do it step by step, say replacing the modules, controllers and models one by one, then update the view files. During the transfer, the server needs to be able to handle PHP and JAVA simultaneously. But I have no idea how to do it.
Does anyone have experience to transfer PHP projects to Java? A list of steps, references, advices and suggestion is highly appreciated.
Doing the whole thing at once, and having no way to test until you finish, is going to be a nightmare. As you’re going, you’ll learn better techniques and have changes of direction, that are going to be really hard to apply to the whole code base.
Any web application that large is going to break down into core features (say 20%), and additional bits (say 80%). Before you start any coding at all, work out what the core features of the system are by discarding anything that’s superfluous. Keep going, ruthlessly cutting things, until you have it down to a small subset of the features that hangs together.
Code an application that does those core features, get that working perfectly, and test it to destruction. In the process you’ve probably learned a lot about how you should have written it, so take the time to refactor the core code to work in exactly the way you want. If you need to experiment with different ways of doing things, now is the time. Make sure it passes every test you can think of, and make sure it keeps passing those tests through the next bit.
Once you have that core not just working but working in the right way, then you can start expanding it to include some of the extra features. The bigger the system gets the more awkward it will be to change things, so if at any point you find you need to change how the system is architected then focus on that in favour of adding new bits.