Giter VIP home page Giter VIP logo

phpmolecules's Introduction

phpMolecules – Architectural Abstractions for PHP

A set of libraries to help developers work with architectural concepts in PHP. Member of the xMolecules family. Goals:

  • Express that a piece of code (namespace, class, method...) implements an architectural concept.
  • Make it easy for the human reader to determine what kind of architectural concepts a given piece of code is.
  • Allow tool integration (to do interesting stuff like generating persistence or static architecture analysis to check for validations of the architectural rules.)

Expressing DDD Concepts

Example:

use PHPMolecules\DDD\Attribute\{Entity, ValueObject, Repository};

#[Entity]
class BankAccount { /* ... */ }

#[ValueObject]
class Currency { /* ... */ }

#[Repository]
class Accounts { /* ... */ }

When we take Ubiquitous Language serious, we want names (for classes, methods, etc.) that only contain words from the domain language. That means the titles of the building blocks should not be part of the names. So in a banking domain we don't want BankAccountEntity, CurrencyVO or even AccountRepository as types. Instead, we want BankAccount, Currency and Accounts – like in the example above.

Still, we want to express that a given class (or other architectural element) is a special building block; i.e. uses a design pattern. PHPMolecules provide a set of standard annotations for the building blocks known from DDD.

Expressing Architecture

phpMolecules provides annotations to mark a package as a layer (or ring):

TODO: port documentation from jMolecules.

Installation

To use phpMolecules in your project just install it with Composer from Packagist:

composer require xmolecules/phpmolecules

Release Instructions

Create a new Git version tag and push it:

git tag --sign vX.Y.Z
git push --tags

phpmolecules's People

Contributors

hschwentner avatar odrotbohm avatar shochdoerfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

phpmolecules's Issues

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.