prooph / event-sourcing

Provides basic functionality for event sourced aggregates.

Home Page:http://getprooph.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move 'aggregateId' up

oqq opened this issue · comments

The aggregateId method from EventProducerTrait and EventSourcedTrait are not related to that traits, but to the abstract AggregateRoot class which uses this traits.

So we should move this method up.

Already done in this PR: https://github.com/prooph/event-sourcing/pull/73/files
But suspended until we release the next major version

cc @prolic

not sure about this change. pinging @Xerkus (author of the traits)

The method is needed by the ClousureAggregateTranslator

And the primary goal of the traits is that you can use them without the need to extend from AggregateRoot, hence the method must be present in the AR class using the traits ...

Here is why it is included in traits: #62 (comment)

By adding it to both traits we ensure presence of aggregateId if AggregateRoot or one of the traits is used.

You can safely remove them and that won't be a BC break btw. Abstract methods are implemented in users code.