Skip to content

matteobaglini/birthday-greetings-kata-scala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Birthday Greetings Kata Scala edition

This is the Scala porting of a refactoring exercise by Matteo Vaccari. The original idea behind it is to teach you about dependency inversion principle (DIP) and dependency injection (DI). For more info take a look at the original repository.

However the fact that Scala is an hybrid OOP/FP language opens the door to another interesting macro refactoring: from bad imperative style to a pure FP style. In order to reach that goal you have to:

  • remove mutable variable
  • split responsibility in functions and modules
  • push the I/O at the boundary of the system
  • handle failure/negative scenarious with effects
  • handle side-effect
  • put Monads everywhere! :trollface:

How to use this Kata

There are two main ways to work:

  1. Hard way: Refactor the code one tiny step at time until the code is clean and pure. In this case the legacy-java-porting is the pefect starting point. The project includes some tests useful to make sure you don't break the code while you refactor.
  2. Simple way: Implements the logic from scratch. In this case the master branch offer a fresh empty SBT project.

In any case just clone the code and start hacking right away improving the design.

License

This project is licensed under the terms of the MIT license.

Releases

No releases published

Packages

No packages published

Languages