Could spring services be reduced to commands (according to the Command design pattern)? I see this as a more flexible approach, and certainly one which increases the cross-cutting of concerns, than putting all functionality into one service class.
Good? Bad? I know that this will undoubtedly increase the number of classes the app will be dealing with, but I don’t mind.
You’re still making a distinction where none needs to be made. Anything can be injected–you can call the entity whatever you want. A controller, a service, a command could all be injected with entities that implement a known interface, like a command interface implementing a
runmethod, or whatever.There are a myriad ways to do this in Spring. You could layer AOP advice. You could inject lists of “commands”. Intercept calls and/or web requests, composite collections of services, …
Until you provide an example of what you are actually trying to do, it’ll be tough to provide anything beyond generalities. Web searches turn up resources like this, which is just one way of doing it.