Open forficate opened 4 years ago
Agree with this in general. There's no real reason why there needs to be a CommandAPISet` that groups command APIs. This class could probably go altogether.
Then rather call createCommandApi
on the EventSourcedClient
for each CommandAPI
.
It's not like on the KStream side where they form a single topology. Each client is separate per aggregate.
Then for the Spring stuff:
I'm Ok with the builder pattern though. In this particular case (i.e. as it currently is) it's not prescribed, as there is a addCommands(final CommandSpec<K, C> spec)
method.
EventSourcedClient
Essentially returns a big map of
<String,Object>
.This means if you have the below class:
To pass in the constructor arg you need to:
Again this means we are pulling values based on strings.
It also doesn't play to nice with Java like frameworks, take spring boot:
It'd be nice if we could loose the builder stuff with
addCommands
and just do: