Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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/

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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/

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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/

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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/

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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.

Slide 24

Slide 24 text

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/

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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?

Slide 28

Slide 28 text

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