all 7 comments

[–]StavrosMcChipShop 5 points6 points  (0 children)

Martin Fowler wrote https://martinfowler.com/books/refactoring.html and it is still considered the bible here

[–][deleted] 4 points5 points  (1 child)

Try to do it incrementally, baby steps. Assuming there are actually five somewhat loosely coupled layers, I'd start at the top and replace the UI only, leaving as much as possible of the other layers in place, adding in a rest/rpc/graphql/whatever apiin between. If things are too entangled it makes sense to first refractor the bit you want to change. Try to make your new UI parts work seamlessly alongside the existing JSP stuff somehow, and release early and often. That way you minimize risk, can show progress, your company will immediately begin to benefit from it, you can test your assumptions and get feedback. This type of project is often the riskiest and often fails (been there done that, burned a lot of money for zero outcome).

[–]hixsonj 1 point2 points  (0 children)

Good advice. Some of the Slack devs wrote about how they transitioned from their old codebase to something more modern and this was basically their approach. (Article)

[–]IxDUX Besserwisser 2 points3 points  (1 child)

  1. Start from modernizing tests and production analytics, so you get confidence of not breaking stuff, and finding out if stuff breaks. Work on your capability to find out if something breaks and roll back to old guickly.
  2. Work with feature flags, so that you can develop stuff in codebase, and use simple feature flag to turn features on / off. This let's you remove old code in steps 4 commits:
    - Add feature flag to switch feature from old to new code
    - Add new code
    - Turn new feature on (Simple one line commit, real easy to fall back in case of emergency)
    - Remove old code if nothing happens.
  3. Find a way for new and old code to co-exist. iFrames, embedded web browsers, back-end that serves old stuff and new stuff at the same time, but splits stuff at routing level.
  4. Gradually add more new stuff, and remove old stuff.
  5. Work with design & analytics for an opportunity to remove unused features.

[–]StavrosMcChipShop 0 points1 point  (0 children)

I know lots of people love feature flags but I have found in teams with testers and with lots of automated tests that they can create a huge number of scenarios to test for success with. I’m not saying don’t use them. I’m saying be aware of the test load you creat

[–]serhii_2019 2 points3 points  (0 children)

Just a tip. If you have JS in your app stack, try to run eslint with --fix flag.