Skip to content

Releases: cloudcreativity/ddd-modules

v2.0.0-rc.3

13 Oct 15:49
Compare
Choose a tag to compare
v2.0.0-rc.3 Pre-release
Pre-release

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 existing Result::failed() method.
  • BREAKING The Entity interface (and therefore the Aggregate interface too) now has a getIdOrFail() method on it. Although technically breaking, if you are using the IsEntity or IsEntityWithNullableId 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

27 Jul 12:38
Compare
Choose a tag to compare
v2.0.0-rc.2 Pre-release
Pre-release

Upgrading

composer require "cloudcreativity/ddd-modules:^2.0.0-rc.2"

Changelog

Added

  • The Uuid identifier class now has a getBytes() 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

08 May 18:38
Compare
Choose a tag to compare
v2.0.0-rc.1 Pre-release
Pre-release

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

05 Apr 18:54
Compare
Choose a tag to compare

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 the ExecuteInUnitOfWork 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: use LogInboundEvent instead.
    • LogOutboundIntegrationEvent: use LogOutboundEvent instead.

Full Changelog: v1.1.0...v1.2.0

v1.1.0

05 Apr 18:00
Compare
Choose a tag to compare

Changelog

Added

  • Allow an outbound integration event handler to implement a publish() method. The handle() method is still supported, but publish() 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

09 Mar 10:29
Compare
Choose a tag to compare

Changelog

Removed

  • BREAKING The following deprecated interfaces have been removed:
    • Bus\CommandInterface use Toolkit\Messages\CommandInterface instead.
    • Bus\QueryInterface use Toolkit\Messages\QueryInterface instead.
    • Bus\DispatchThroughMiddleware use Toolkit\Messages\DispatchThroughMiddleware instead.
    • Infrastructure\Log\ContextProviderInterface use Toolkit\Loggable\ContextProviderInterface instead.

What's Changed

Full Changelog: v1.0.0-rc.2...v1.0.0

v1.0.0-rc.2

06 Mar 20:16
Compare
Choose a tag to compare

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 the DispatchAfterCommit 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

23 Feb 09:46
Compare
Choose a tag to compare

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 or Bus\MessageInterface now type-hint the new interfaces in the Toolkit\Messages namespace.
  • BREAKING Moved the EventBus implementation from Infrastructure\EventBus to EventBus. 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 the Toolkit\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

09 Feb 13:00
Compare
Choose a tag to compare

Changelog

Fixed

  • Removed final from the DeferredDispatcher and UnitOfWorkAwareDispatcher classes so that they can be extended.

Event bus and domain event dispatcher improvements

07 Feb 18:28
Compare
Choose a tag to compare

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 and TearDownAfterDispatch 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 to UnitOfWorkAwareDispatcher.
  • BREAKING - removed the IntegrationEvents namespace and moved to the Infrastructure\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.