Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making the long road short: How to migrate lega...

Making the long road short: How to migrate legacy enterprise Java apps to Spring Boot

Mark Heckler

May 24, 2018
Tweet

More Decks by Mark Heckler

Other Decks in Programming

Transcript

  1. Making the long road short How to migrate legacy enterprise

    Java apps to Spring Boot Mark Heckler Principal Technologist/Spring Developer Advocate www.thehecklers.com [email protected] [email protected] @mkheck
  2. @mkheck @springframework @springboot Who am I? • Author • Speaker

    • Architect & Developer • Java Champion • Seeker of a better way
  3. @mkheck @springframework @springboot Steps involved Review dependencies Review code &

    supporting scripts Create Spring Boot project w best approximation Convert database scripts (if applicable) Bring over static/public files (web UI/front end logic) Create Spring interfaces+classes that correspond to EE program structure (but not package structure) Copy/paste & get to work on the back end (bring coffee…a lot of coffee) Clean up the front end Test end to end
  4. @mkheck @springframework @springboot Review code & supporting scripts Get the

    “lay of the land” Understand capabilities exposed/provided by the application Create your plan for conversion/re-creation
  5. @mkheck @springframework @springboot Create Spring Boot project with best approximation

    We’ll start with Web (!), JPA, H2, & use Kotlin to really tighten things up
  6. @mkheck @springframework @springboot Convert database scripts persistence(.xml) is key! javax.persistence.schema-generation.database.action

    javax.persistence.schema-generation.*-script-source (create, drop, sql-load) create & drop scripts -> schema(-*).sql (under /resources) sql-load scripts -> data(-*).sql (under /resources) (Note: visibility into DB essential in case of issues)
  7. @mkheck @springframework @springboot –Calvin Coolidge, 30th US President (1923-1929) “Nothing

    in this world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent.”
  8. @mkheck @springframework @springboot Convert database scripts <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> <property

    name="javax.persistence.schema-generation.create-source" value="script"/> <property name="javax.persistence.schema-generation.drop-source" value="script"/> <property name="javax.persistence.schema-generation.create-script-source" value="sql/create.sql"/> <property name="javax.persistence.schema-generation.drop-script-source" value="sql/drop.sql"/> <property name="javax.persistence.sql-load-script-source" value="sql/load.sql"/>
  9. @mkheck @springframework @springboot Create Spring interfaces+classes Correspond to EE program

    structure… but not necessarily package structure Domain classes, repositories, controllers, etc. “Scaffolding”
  10. @mkheck @springframework @springboot Copy/paste & get to work Bring ☕

    ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕ ☕