PHPackages                             carlosbuenosvinos/ddd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. carlosbuenosvinos/ddd

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

carlosbuenosvinos/ddd
=====================

Domain-Driven Design PHP helper classes (Application Services, Transactions, Domain Events, etc.

1.6.0(9y ago)665193.1k↓35.2%103[2 PRs](https://github.com/dddinphp/ddd/pulls)4MITPHPCI failing

Since Jan 11Pushed 5y ago60 watchersCompare

[ Source](https://github.com/dddinphp/ddd)[ Packagist](https://packagist.org/packages/carlosbuenosvinos/ddd)[ Docs](https://leanpub.com/ddd-in-php)[ RSS](/packages/carlosbuenosvinos-ddd/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (11)Used By (4)

carlosbuenosvinos/ddd
=====================

[](#carlosbuenosvinosddd)

[![Build Status](https://camo.githubusercontent.com/3850fada18e1b41c8527f3e0f23537c6d84be7b1fc7cac8345fbe19cb25cf86d/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f646464696e7068702f6464642e7376673f6272616e63683d6d6173746572)](http://travis-ci.org/dddinphp/ddd)

This library will help you with typical DDD scenarios, for now:

- Application Services Interface
- Transactional Application Services with Doctrine and ADODb
- Data Transformers Interface
- No Transformer Data Transformers
- Domain Event Interface
- Event Store Interface
- Event Store Doctrine Implementation
- Domain Event Publishing Service
- Messaging Producer Interface
- Messaging Producer RabbitMQ Implementation

Sample Projects
===============

[](#sample-projects)

There are some projects developed using carlosbuenosvinos/ddd library. Check some of them to see how to use it:

- [Last Wishes](https://github.com/dddinphp/last-wishes): Actions to run, such as tweet, send emails, etc. in case anything happen to you.

Application Services
====================

[](#application-services)

Application Service Interface
-----------------------------

[](#application-service-interface)

Consider an Application Service that registers a new user in your application.

```
$signInUserService = new SignInUserService(
    $em->getRepository('MyBC\Domain\Model\User\User')
);

$response = $signInUserService->execute(
    new SignInUserRequest(
        'carlos.buenosvinos@gmail.com',
        'thisisnotasecretpassword'
    )
);

$newUserCreated = $response->getUser();
//...

```

We need to pass in the constructor all the dependencies. In this case, the User repository. As DDD explains, the Doctrine repository is implementing a generic interface for User repositories.

```
