Download the PHP package wwwision/dcb-example without Composer

On this page you can find all versions of the php package wwwision/dcb-example. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dcb-example

Dynamic Consistency Boundary Example

Simple example for the Dynamic Consistency Boundary pattern described by Sara Pellegrini.

The purpose of this package is to explore the idea, find potential pitfalls and to spread the word.

tl;dr Have a look at the Behat Tests to see this in action.

Background

Dynamic Consistency Boundary (aka DCB) allow to enforce hard constraints in Event-Sourced systems without having to rely on individual Event Streams. This facilitates focussing on the behavior of the Domain Model rather than on its rigid structure. It also allows for simpler architecture and potential performance improvements as multiple projections can act on the same events without requiring synchronization.

Read all about this interesting approach in the blog post mentioned above or watch Saras talk on YouTube (Italian with English subtitles). This package models the example of this presentation (with a few deviations) using the wwwision/dcb-eventstore package and the wwwision/dcb-eventstore-doctrine database adapter.

Important Classes / Concepts

Considerations / Findings

I always had the feeling, that the focus on Event Streams is a distraction to Domain-driven design. So I was very happy to come across this concept. So far I didn't have the chance to test it in a real world scenario, but it makes a lot of sense to me and IMO this example shows, that the approach really works out in practice (in spite of some minor caveats in the current implementation).

Usage

Install via composer:

Now you should be able to run the example script via

And you should get ...no output at all. That's because the example script currently satisfy all constraints. Try changing the script to test, that the business rules are actually enforced, for example you could add the line:

to the end of the file, which should lead to the following exception:

Alternatively, you could have a look at the Behat Tests:

Tests

This package comes with 16 Behat scenarios covering all business features. You can run the tests via

Acknowledgment

Most of the implementation of these packages are based on the great groundwork done by Sara Pellegrini, so all praise belong to her!

Contributions

I'm really curious to get feedback on this one. Feel free to start/join a discussion, issues or Pull requests.


All versions of dcb-example with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
webmozart/assert Version ^1.11
wwwision/dcb-eventstore Version ^4
wwwision/dcb-eventstore-doctrine Version ^4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wwwision/dcb-example contains the following files

Loading the files please wait ....