
Extract Pure Functions – code cast
Blog post series
This blog post is part of a series about legacy coderetreat and legacy code techniques you can apply during your work. Please click to see more sessions about legacy code.
Code Cast
This is a code cast in Java.
In the first episode we wrote some characterization tests with the purpose to create a basic safety net. Now we continue to refactor the code, starting from there. We already have some tests running and we want to have methods that do only one thing; we want to apply the Single Responsibility Principle. A really good tool that can help is using pure functions. We extract functions, make them static and then make sure the function does not have any side effects. These functions help me clean the code and help me start structurig the code according to clear responsibilities. At a later time we will extract all these functions that have similar responsibilities to a new class.
Read here more about this concept in my blog post.
This 3-day advanced workshop is aimed to improve the knowledge of experienced programmers on how to evolve a software system. It is a practical workshop, with coding exercises and discussions around design options.
Evolutionary Design is the practice of growing a system in a natural way, by adding the minimum amount of code to satisfy the business needs in an iterative and incremental approach. When done right, the code structure changes continuously to optimize for change, thus allowing a constant speed of development for longer periods of time.
Recent Comments