Skip to content

Composer package where you can find useful and reusable classes that can help you modeling your project 😁

Notifications You must be signed in to change notification settings

TheColvinCo/common-domain-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

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 interesting AggregateRoot. 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.

About

Composer package where you can find useful and reusable classes that can help you modeling your project 😁

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages