event-centric / EventCentric.Core

Event Sourcing and CQRS in PHP
MIT License
126 stars 9 forks source link

Extract `UnitOfWork` interface #14

Open Ocramius opened 10 years ago

Ocramius commented 10 years ago

The UnitOfWork abstracts a fairly complex API, but there is no contract (or multiple contracts) for it, which makes composition not possible.

tPl0ch commented 10 years ago

@Ocramius that's also true for the Aggregate wrapper object.

Ocramius commented 10 years ago

Thanks for pointing it out.

@mathiasverraes in general, I think you should never use final unless it's a utility class or there is an interface for the implementation.

Marking it final without a contract will make composition useless, defeating the actual purpose of final (IMO)

mathiasverraes commented 10 years ago

I agree, there's a lot of these kinds of details that need work. Extensibility hasn't been a concern so far, as I'm changing the design too much. Keeping the ticket open as a reminder to take a good look at extension points later.