Releases: cloudcreativity/ddd-modules
Releases · cloudcreativity/ddd-modules
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.
Event bus and domain event dispatcher improvements
Upgrading
composer require cloudcreativity/ddd-modules
Changelog
Added
- New
DeferredDispatcher
class for dispatching domain events when not using a unit of work. - New UUID factory interface and class, that wraps the
ramsey/uuid
factory to return UUID identifiers. - GUIDs that wrap UUIDs can now be created via the static
Guid::fromUuid()
method. - New
SetupBeforeDispatch
andTearDownAfterDispatch
bus middleware, that can be used either to setup (and optionally tear down) application state around the dispatching of a message, or to just do tear down work. - The
EventBus
namespace now has a working implementation for publishing integration events. - Can now provide a closure to the
ListOfErrorsInterface::first()
method to find the first matching error. - Added the following methods to the
ListOfErrorsInterface
:contains()
- determines whether the list contains a matching error.codes()
- returns an array containing the unique error codes in the list.
- Added an
ErrorInterface::is()
method to determine whether an error matches a given code.
Changed
- BREAKING - renamed the domain event
Dispatcher
class toUnitOfWorkAwareDispatcher
. - BREAKING - removed the
IntegrationEvents
namespace and moved to theInfrastructure\EventBus
namespace. - BREAKING - the
IntegrationEventInterface
now expects the UUID to be an identifier UUID, not a Ramsey UUID. - The UUID factory from the
ramsey/uuid
package is now used when creating new UUID identifiers.
Fixed
- The unit of work manager now correctly handles re-attempts so that deferred events are not dispatched multiple times.