In Part 1 we created a simple library called KantanLogicthat we can use to manage application logic in lieu of other popular libraries. Our library has these main features:
- Uses Success and Failure result objects for the class output
- Handles error conditions gracefully
- Has consistent behavior for the main class and all dependency classes
In our last example, we have a class called CreateAccount that creates a user account and sends a welcome email. When using KantanLogic, the service looks like this: