Closed Florian-Schoenherr closed 4 years ago
@Florian-Schoenherr I think that the original issue was not accurately written. There is not missing ctor. It's that the Starter's generated code for Event Sourcing used a non-existing ctor because the code generator is wrong. This is probably more due to Event Sourcing code gen being tested less than StateStore gen. If @danilo-ambrosio agrees this issue can be closed as a non-issue.
/cc @danilo-ambrosio
@VaughnVernon but this still wouldn't make sense. This isn't generated:
dispatcher
ends up in Definition.parameters
, so ActorFactory
will never find any ctor. Or should there be an instantiator
inside Definition
by then?
Maybe I just don't get it right now, so yes, if @danilo-ambrosio finds something or some version of this issue should be in xoom instead, this can be closed.
@Florian-Schoenherr Please discuss and coordinate with @danilo-ambrosio. He told me that the fix could be done rather easily, but he didn't indicate how. I leave it to you two to work out.
There is an assumption that Journals should have a constructor which just takes a dispatcher:
(this is used in schemata:) (this is inside the xoom-api:) Goes here, so dispatcher is in parameters:
The dispatcher ends up inside
Definition.parameters
and gets send toActorFactory.actorFor
and gets handled like this:This would only work if every Journal built by
DefaultJournalActorBuilder
has a ctor with just one parameter like in:..maybe even every
StoreActorBuilder
implementation needs this, then. I don't know the specifics, maybe this needs to be build another way (change theDefinition
, so it's not just "parameters
", which then just get used to look if the count of parameters is the same, but do it somehow else, more declarative). Or if the Journals need this dispatcher ctor, maybe put something in the Journal interface.I found this out because of related issue: https://github.com/vlingo/vlingo-xoom-starter/issues/3 They just use this, which doesn't seem wrong to me, please correct me if I'm wrong:
refs: ActorFactory InMemoryJournalActor JDBCJournalActor