Coder Social home page Coder Social logo

ddd-php's Introduction

DDD PHP

DDD in PHP is a simple project (a folder structure) for your project build with Domain Driven Design.

Latest Stable Version Total Downloads

Installation

The recomanded way to install DDD in PHP is through Composer:

{
    "require": {
        "black/ddd-php": "@stable"
    }
}

Protip: You should browse the black/ddd-php page to choose a stable version to use, avoid the @stable meta constraint.

Why?

First, I want to create a folder structure for my continuous project based on semantic. This small library is a good start for my project and, even if some parts of this integration versus DDD rules are questionable, this library will work for a lot of projects.

Usage

This project is a simple folder structure with interfaces (with simple contracts). Follow this structure and your project will follow DDD (not exactly true but your design will be fine).

Why you should not use this library in your project?

For a lot of good reasons like :

  • Repository interface is in Domain\Model with 4 basics functions. If you want to add CQRS pattern over this interface, you will need a Read and a Write side so you can't scale with this interface.

  • Repository::find() need a ValueObject. Create a concrete ValueObject implementing ValueObjectInterface and job is done... Or not You can't accept all ValueObject for find so you will write a condition for testing the $id and use or throw an InvalidArgumentException.

So my advice (after 17 months) is: Do you want to create a DDD project? If yes, follow the rules of this package and you will create a DDD project but you should not implement this in your project.

Contributing

This project is a work in progress so don't hesitate to see CONTRIBUTING file and submit your PR.

Credits

This README is heavily inspired by Hateoas library by the great @willdurand. This guy needs your PR for the sake of the REST in PHP.

Alexandre "pocky" Balmes [email protected]. Send me Flattrs if you love my work, buy me gift or hire me!

License

DDD in PHP is released under the MIT License. See the bundled LICENSE file for details.

ddd-php's People

Contributors

pocky avatar

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.