Giter VIP home page Giter VIP logo

common-domain-php's Introduction

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.

common-domain-php's People

Contributors

aaronidas avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gonsandia xus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.