Giter Site home page Giter Site logo

msgphp / user-bundle Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 244 KB

A new Symfony user bundle

Home Page: https://github.com/msgphp/msgphp

License: MIT License

PHP 100.00%
cli cqrs doctrine domain-driven-design event-sourcing message-driven php php7 security symfony-bundle twig user-management uuid

user-bundle's Introduction

NOT ACTIVELY SUPPORTED ANY MORE!!

msgphp/* repositories are not actively developed/supported anymore.

Use in production on your own risks.

If you want to do some hotfixes - please do PR directly in target repository instead of this monorepository.

Message Driven PHP

Build Status Code Coverage

MsgPHP is a project that aims to provide reusable domain layers for your application. It has a low development time overhead and avoids being overly opinionated.

It follows Semantic Versioning, yet during development phase a package can be marked @experimental to indicate "BC breaks" could be introduced.

Domain Layers

The domain layer is a collection of entity objects and related business logic that is designed to represent the enterprise business model. The major scope of this layer is to create a standardized and federated set of objects, that could be potentially reused within different projects. (source)

Currently supported domain layers are:

On the roadmap are:

  • Organization
  • File
  • Taxonomy
  • ...

Design-Time Considerations

  • The base domain package (msgphp/domain) integrates with YOUR domain layer (it's dependency free by design)
  • You inherit from the default domain layers, if used
  • The first-class supported ORM is Doctrine ORM
  • The first-class supported message bus is Symfony Messenger

Message Based

Each domain layer provides a set of messages to consume it. Typically the messages are categorized into command-, event- and query-messages.

The main advantage is we can intuitively create an independent flow of business logic. It provides consistency in handling our business logic by dispatching the same message in e.g. web as well as CLI.

$anyMessageBus->dispatch(new CreateSomething(['field' => 'value']));

A command-message is dispatched and picked up by its handler to do the work. This handler on itself dispatches a new event-message (e.g. SomethingCreated) to notify the work is done.

A custom handler can subscribe to the SomethingCreated event to further finalize the business requirements (e.g. dispatch another commmand-message).

class MakeSomethingWork
{
    private $bus;

    public function __construct(YourFavoriteBus $bus)
    {
        $this->bus = $bus;
    }

    public function __invoke(SomethingCreated $event)
    {
        // do work, or better delegate work:
        $this->bus->dispatch(new LetSomethingWork($event->something));
    }
}

Documentation

Contributing

See CONTRIBUTING.md

user-bundle's People

Contributors

abunch avatar bbuehrle avatar dmerchier avatar gwendolenlynch avatar pascalwacker avatar ro0nl avatar sanderdlm avatar tacman avatar zhil avatar

Stargazers

 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.