-
Notifications
You must be signed in to change notification settings - Fork 105
Review abstraction levels of services #61
Comments
This would be really welcoming, since moving parts of controller logic into the service and if necessary in further classes to get a good encapsulation and readability. For example take
|
Dear @anjeyy , I would like to make this code refactor if possible. |
@alstiefel @dfischer-tech @f11h @jhagestedt @mlaue-tech @mschulte-tsi @tence @kreincke @ascheibal @BugBuster1701 Is it possible to accept me as a contributor, please? Even though I am a beginner in open source project, I would be very grateful for you acception. Thanks in advance! |
Hi @damirseit, |
Yes, thank you very much! I already made a pull request. Would be extremely grateful for your feedback. Thanks in advance! |
Current Implementation
The services currently expose a mixture of abstraction levels in their APIs that provide an incoherent set of operations and lead to a fractured programming model. Take the TAN redemption use case for example. The programming model currently looks as follows:
save(…)
.That's a very low level interaction model and it's error prone fro a couple of reasons:
Suggested Enhancement
save(…)
on the service, look for which state transitions they apply to the entity beforehand and turn those use cases into service methods. All code that does not need any references to other Spring beans could go into entities ("If you need to call two setters in a row you're missing a method.").Expected Benefits
Again, happy to provide a POC for this in a PR.
The text was updated successfully, but these errors were encountered: