hi there,
Just curious, why the approach of errors and if/unless logic instead of raising an exception of the class invariants are not set? i would think it'd be much simpler to use an exception for this and keep the service logic simpler and easier to test (esp for a more complex service). I remember hearing "experts" (like Sandi Metz) say this was ok to use exceptions for business logic rule errors, and this would seem to be one).
Thanks!
I think that it depends on the goals of the service object. If it were only internal interactions then this would make sense. However, if the issue was an error with an external api that you've wrapped your service object around, I would probably prefer this method.
is the same thing as
It's a different way of calling a class method. Does that help?