Share
Embed
Improving Legacy Applications with Spring
Slides for the webinar "Improving Legacy Applications with Spring". The code is available on http://github.com/mdeinum/legacy-app.
Marten Deinum
May 12, 2015
Transcript
28 slides
-
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Improving Legacy Applications with Spring Marten Deinum, Consultant, Conspect Consulting & ICT @mdeinum -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 2 Marten Deinum Spring Community Rockstar @mdeinum | [email protected] § Father § Husband § Experienced Java/JEE Consultant § Pragmatist Author Open Source Enthusiast -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - History § JDK 1.0 was released in 1996 • ~ 20 years old § First JEE (or J2EE 1.2) released in 1999 • ~ 16 years old § J2EE Design and Development by Rod Johnson in 2002 • Led to the Spring Framework we know today § Spring 1.0 was released in 2004 • ~ 12 years old § A lot of application have been build in that time period • Some of those still exist • Code is still being used 3 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 4 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software § Has proven itself (battle tested) § Has proven business value § It exists and we have to deal with it • Ignore • Hide • Full Rebuild • Incremental Redesign 5 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Architecture 6 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Architecture 7 Domain Presentation Service Data Access Presentation Service Data Access Domain DTO -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Architecture 8 Presentation Service Data Access Presentation Service Data Access Presentation Service Data Access -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Architecture 9 -
Demo Unless otherwise indicated, these slides are © 2013-2014
Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - How to Improve 11 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 12 Legacy Software - Structured Monolith “If you can't build a structured monolith, what makes you think microservices are the answer? Simon Brown -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 13 Legacy Software - Structured Monolith -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Structured Monolith § Write integration tests! 14 -
Demo Unless otherwise indicated, these slides are © 2013-2014
Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Structured Monolith § Write integration tests! § Single Responsibility Principle • A [class|component|service] should have one, and only one, reason to change. • Classes that change together are packaged together. • Classes that are used together are packaged together. 16 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Structured Monolith § Write integration tests! § Single Responsibility Principle • A [class|component|service] should have one, and only one, reason to change. • Classes that change together are packaged together. • Classes that are used together are packaged together. § Protect your Internals § Use package protected classes § Expose only the public API 17 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Structured Monolith 18 Integration Core User Event web security ws -
Demo Unless otherwise indicated, these slides are © 2013-2014
Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Structured Monolith § Write integration tests! § Single Responsibility Principle § Protect your internals § Decouple using events § Use the right abstractions and framework features 20 -
Demo Unless otherwise indicated, these slides are © 2013-2014
Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Structured Monolith § Write integration tests! § Single Responsibility Principle § Protect your internals § Decouple using events § Spring 4.2 has some nice improvements in this area https://spring.io/blog/2015/02/11/better-application-events-in-spring- framework-4-2 § Use the right abstractions and framework features 22 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Independent Services 23 "Physalia physalis, Tayrona national park, Colombia" by Biusch - Own work. -
Demo Unless otherwise indicated, these slides are © 2013-2014
Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Independent Services § Spring Remoting • HttpInvoker, Burlap, Hessian, RMI, JMS, AMQP • Remote Procedure Call (RPC) § Spring Integration • JMS with Objects • JMS with XML Marshalling • AMQP (JSON) 25 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Legacy Software - Lessons Learned § Have a plan and prioritize § Use automated tests § Take small steps § Upgrading Spring might not be as hard as you think § Upgrading a JDK might not be as hard as you think § Know your frameworks / libraries § Use the right abstractions 26 -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Questions? -
Unless otherwise indicated, these slides are © 2013-2014 Pivotal Software,
Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 28 Learn More. Stay Connected. Twitter: twitter.com/mdeinum YouTube: spring.io/video LinkedIn: nl.linkedin.com/in/mdeinum GitHub: github.com/mdeinum