Releases: cloudcreativity/ddd-modules
Releases · cloudcreativity/ddd-modules
v2.0.0
Upgrading
Refer to the Upgrade Guide here.
What's Changed
- Feature: add context method to the failed result exception by @lindyhopchris in #7
- Feature: queueable commands by @lindyhopchris in #6
- Refactor: rename pipeline construct args to middleware or rules for clarity by @lindyhopchris in #8
- Refactor: tidy up event bus middleware by @lindyhopchris in #10
- Refactor: rename bus middleware interface and improve type-hint by @lindyhopchris in #9
- Feature: add abort method to result object by @lindyhopchris in #12
- Internal vs external queued work by @lindyhopchris in #11
- Refactor: rename unit of work namespace and add chapter on the unit of work pattern by @lindyhopchris in #13
- Refactor: switch to using a hexagonal architecture by @lindyhopchris in #14
- Drop interface and trait suffixes by @lindyhopchris in #15
- Build: add PHP 8.4 to automated tests by @lindyhopchris in #16
- Feature: Upgrade to PHPStan v2 and stricter rules by @lindyhopchris in #17
- Feature: More Hexagonal Architecture updates by @lindyhopchris in #18
Full Changelog: v1.2.0...v2.0.0
v2.0.0-rc.3
Upgrading
composer require "cloudcreativity/ddd-modules:^2.0.0-rc.3"
Changelog
Added
- The result class now has a
Result::fail()
static method to create a failed result. This is an alias of the existingResult::failed()
method. - BREAKING The
Entity
interface (and therefore theAggregate
interface too) now has agetIdOrFail()
method on it. Although technically breaking, if you are using theIsEntity
orIsEntityWithNullableId
traits then this method is already implemented. - New
AggregateRoot
interface so that an aggregate root can be distinguished from a regular aggregate or entity.
Changed
- Remove deprecation message in PHP 8.4.
Full Changelog: v2.0.0-rc.2...v2.0.0-rc.3
v2.0.0-rc.2
Upgrading
composer require "cloudcreativity/ddd-modules:^2.0.0-rc.2"
Changelog
Added
- The
Uuid
identifier class now has agetBytes()
method - Can now get a nil UUID from the
Uuid::nil()
static method.
Changed
- Made resolution of inner handlers lazy in all buses. In several the handler was immediately resolved, so that the handler middleware could be calculated. Buses that support handler middleware now first pipe through the bus middleware, then resolve the inner handler, then pipe through the handler middleware. This allows inner handler constructor injected dependencies to be lazily resolved after the bus middleware has executed. This is important when using the setup and teardown middleware for bootstrapping services that may be injected into the inner handler. Buses that now lazily resolve inner handlers are:
- Command bus
- Query bus
- Inbound integration event bus
- Outbound integration event bus
- Queue bus
Full Changelog: v2.0.0-rc.1...v2.0.0-rc.2
v2.0.0-rc.1
What's Changed
This is a large refactoring, as we move to a hexagonal architecture. For a full discussion of this and how to upgrade, refer to the Upgrade Guide.
Additionally, there is the changelog.
Full Changelog: v1.2.0...v2.0.0-rc.1
Status
Although this is marked as a pre-release, it is considered stable enough to use. We only plan bug fixes - there are no plans for additional refactoring.
v1.2.0
Changelog
Added
- New integration event middleware:
NotifyInUnitOfWork
for notifiers that need to be executed in a unit of work. Note that the documentation for Integration Events incorrectly showed theExecuteInUnitOfWork
command middleware being used.SetupBeforeEvent
for doing setup work before an integration event is published or notified, and optionally teardown work after.TeardownAfterEvent
for doing teardown work after an integration event is published or notified.LogInboundEvent
for logging that an integration event is being received.LogOutboundEvent
for logging that an integration event is being published.
Deprecated
- The following integration event middleware are deprecated and will be removed in 2.0:
LogInboundIntegrationEvent
: useLogInboundEvent
instead.LogOutboundIntegrationEvent
: useLogOutboundEvent
instead.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
Changelog
Added
- Allow an outbound integration event handler to implement a
publish()
method. Thehandle()
method is still supported, butpublish()
makes more sense to describe what the handler does with the event it has been given.
Fixed
- Added missing UUID 7 and 8 methods to the UUID factory interface.
- The
Result::error()
method now correctly returns the first error message even if it is not on the first error in the list.
Full Changelog: v1.0.0...v1.1.0
v1.0.0
Changelog
Removed
- BREAKING The following deprecated interfaces have been removed:
Bus\CommandInterface
useToolkit\Messages\CommandInterface
instead.Bus\QueryInterface
useToolkit\Messages\QueryInterface
instead.Bus\DispatchThroughMiddleware
useToolkit\Messages\DispatchThroughMiddleware
instead.Infrastructure\Log\ContextProviderInterface
useToolkit\Loggable\ContextProviderInterface
instead.
What's Changed
- Feature: final changes for the 1.0 release by @lindyhopchris in #5
Full Changelog: v1.0.0-rc.2...v1.0.0
v1.0.0-rc.2
Changelog
Added
- New
FailedResultException
for throw result objects that have not succeeded.
Changed
- BREAKING: The
UnitOfWorkAwareDispatcher
now queues deferred events to be dispatched before the unit of work commits. Previously it queued them for after the commit. This changes allows communication between different domain entities to occur within the unit of work, which is the correct pattern. For example, if an entity or aggregate root needs to be updated as a result of another entity or aggregate dispatching a domain event. It also allows an outbox pattern to be used for the publishing of integration events. This is a breaking change because it changes the order in which events and listeners are executed. Listeners that need to be dispatched after the commit should now implement theDispatchAfterCommit
interface.
Fixed
- The
ExecuteInUnitOfWork
middleware now correctly prevents the unit of work committing if the inner handler returns a failed result. Previously the unit of work would have committed, which was incorrect for a failed result.
Full Changelog: v1.0.0-rc.1...v1.0.0-rc.2
v1.0.0-rc.1
Changelog
Added
- New event bus notifier implementation that was previously missing. This completes the event bus implementation.
- New message interfaces (command, query, integration event) added to the toolkit.
- New loggable context provider interface added to the toolkit.
- Module basename now supports namespaces where an application only has a single bounded context.
Changed
- BREAKING Moved the following interfaces to the
Toolkit\Messages
namespace:MessageInterface
IntegrationEventInterface
- BREAKING Interfaces that type-hinted
Bus\CommandInterface
,Bus\QueryInterface
orBus\MessageInterface
now type-hint the new interfaces in theToolkit\Messages
namespace. - BREAKING Moved the
EventBus
implementation fromInfrastructure\EventBus
toEventBus
. In Deptrac, this namespace is now part of the Application Bus layer. Renamed the publisher handler and publisher handler containers to integration event handler and container - so that they can be used for both the publisher and notifier implementations. - BREAKING Removed the
EventBus\PublishThroughMiddleware
interface. Use theToolkit\Messages\DispatchThroughMiddleware
interface instead.
Removed
- BREAKING removed the
deptrac-layers.yaml
file, in favour of applications including the classes in their own Deptrac configuration.
Full Changelog: v0.6.1...v1.0.0-rc.1
v0.6.1
Changelog
Fixed
- Removed
final
from theDeferredDispatcher
andUnitOfWorkAwareDispatcher
classes so that they can be extended.