Download the PHP package colvin/common-domain-php without Composer
On this page you can find all versions of the php package colvin/common-domain-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download colvin/common-domain-php
More information about colvin/common-domain-php
Files in colvin/common-domain-php
Package common-domain-php
Short Description Domain structure for shared projects
License MIT
Informations about the package common-domain-php
Colvin Common Domain ð ðŠī
Colvin Common Domain is a brand-new composer package ðĶ where you could find Core objects that could help you.
Table of Contents
- Colvin Common Domain ð ðŠī
- Installation âïļ
- Usage ðĐâðŧ
- Application
- Domain ðž
- Infrastructure ðïļ
- Contributing ðĪ
Installation âïļ
Simply run composer req colvin/common-domain-php
. Note you have to be at least in PHP 8 (we are modern people, yup).
Usage ðĐâðŧ
This package has multiple tools which can be useful. We have taken advantage of the Hexagonal Architecture to organise it, so we have the three typical folders: Application, Domain and Infrastructure:
Application
Here we will find the two definitions of Command and Query, used in architectures like CQRS. They are just abstract implementations of
the ActionMessage
abstract class. We will cover it soon.
Domain ðž
Here we'll find the big stuff. We have Exception
, Message
and Model
Folders.
- Exceptions (surprise ðð) store exception definitions.
- In
Message
we find the definitions of:- ActionMessage (used in queries and commands, they are "actions").
- AggregateMessage. This is the big boy, used to model Domain Events.
- Message. The mother of all. It ensures all messages have the same structure.
- In
Model
we can find different useful Value Objects, and an interestingAggregateRoot
. This will be used in our future entities, and it has the ability to record Domain Events. DomainEvent
. There is not much to explain here ðĶŦ
Infrastructure ðïļ
As in every Infrastructure HA folder, here we try to manage the relation with external dependencies. There are useful classes, for example; to serialize and deserialize messages following the JSON Api Standard.
Contributing ðĪ
Pull requests are more than welcome!. For major changes, please open an issue first to discuss what you would like to change.
Please remember to update tests as appropriate.