the code? •What is the di ff erence between stationId and customerId? Should they be equal when they have the same values? •Is Lending always a lending? Or maybe it can be just a reservation that is never used? Do I get this information from the Lending class? •Does Lending class tell me what can I do with the reservation? •Does Lending class tell me what does it mean that the lending was fi nished? •Is extending reservation for more than 5 minutes really an exceptional situation?
wrapping the original value And has a function that unfolds the original value, applies some other function, and creates the new wrapped value of the same type
of functions and work fl ows instead of state •Have referential transparency in mind •Model your class hierarchies so that they correspond to the true domain and codomain of your business function •Avoid side e ff ects like exceptions and mutability •Keep your domain pure - move IO to the outside layer of your onion •Use monadic types to improve readability and robustness