From 41dd9ef98f91d44efbc57cb61cb5bf6b3a5ae3ea Mon Sep 17 00:00:00 2001 From: David Badura Date: Thu, 14 Dec 2023 14:00:47 +0100 Subject: [PATCH 1/6] improve docs --- docs/pages/index.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/pages/index.md b/docs/pages/index.md index de9670efc..f377acc5a 100644 --- a/docs/pages/index.md +++ b/docs/pages/index.md @@ -7,13 +7,13 @@ A lightweight but also all-inclusive event sourcing library with a focus on deve * Everything is included in the package for event sourcing * Based on [doctrine dbal](https://github.com/doctrine/dbal) and their ecosystem * Developer experience oriented and fully typed -* [Snapshots](snapshots.md) system to quickly rebuild the aggregates -* Allow to [Split-Stream](split_stream.md) for big aggregates -* [Pipeline](pipeline.md) to export,import and migrate events -* [Projectionist](projection.md) to manage versioned projections -* [Upcast](upcasting.md) old events -* [Scheme management](store.md) and [doctrine migration](migration.md) support -* Dev [tools](watch_server.md) such as a realtime event watcher +* Automatic [snapshot](snapshots.md)-system to boost your performance +* [Split](split_stream.md) big aggregates into multiple streams +* Build-in [pipeline](pipeline.md) to export, import and migrate event streams +* Versioned and managed lifecycle of [projections](projection.md) +* Smooth [upcasting](upcasting.md) of old events +* Simple setup with [scheme management](store.md) and [doctrine migration](migration.md) +* Dev [tools](watch_server.md) like realtime event watcher * Built in [cli commands](cli.md) with [symfony](https://symfony.com/) * and much more... @@ -27,3 +27,7 @@ composer require patchlevel/event-sourcing * [Symfony](https://github.com/patchlevel/event-sourcing-bundle) * [Psalm](https://github.com/patchlevel/event-sourcing-psalm-plugin) + +!!! tip + + Start with the [quickstart](./getting_started.md) to get a feeling for the library. From 5c30be89a264bdc3433aae3ea647edc6b07706e2 Mon Sep 17 00:00:00 2001 From: David Badura Date: Mon, 15 Jan 2024 17:15:32 +0100 Subject: [PATCH 2/6] fix getting started --- docs/pages/getting_started.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/pages/getting_started.md b/docs/pages/getting_started.md index 2567d0daa..a004e15b4 100644 --- a/docs/pages/getting_started.md +++ b/docs/pages/getting_started.md @@ -57,9 +57,11 @@ final class GuestIsCheckedOut ## Define aggregates -Next we need to define the aggregate. So the hotel and how the hotel should behave. -We have also defined the `create`, `checkIn` and `checkOut` methods accordingly. -These events are thrown here and the state of the hotel is also changed. +Next we need to define the hotel aggregate. +How you can interact with it, what events happen and what the business rules are. +For this we create the methods `create`, `checkIn` and `checkOut`. +In these methods the business checks are made and events are recorded. +Otherwise we still need apply methods to change the state. ```php use Patchlevel\EventSourcing\Aggregate\AggregateChanged; @@ -298,10 +300,10 @@ $mailer = /* your own mailer */; $serializer = DefaultEventSerializer::createFromPaths(['src/Domain/Hotel/Event']); $aggregateRegistry = (new AttributeAggregateRootRegistryFactory)->create(['src/Domain/Hotel']); -$store = new DoctrineDbalStore( +$eventStore = new DoctrineDbalStore( $connection, $serializer, - $aggregateRegistry + $aggregateRegistry, ); $hotelProjector = new HotelProjector($connection); @@ -313,25 +315,22 @@ $projectorRepository = new ProjectorRepository([ $projectionStore = new DoctrineStore($connection); $projectionist = new DefaultProjectionist( - $store, + $eventStore, $projectionStore, - $projectorRepository + $projectorRepository, ); $eventBus = SyncProjectionistEventBusWrapper::createWithDefaultLockStrategy( DefaultEventBus::create([ - new SyncProjectorListener($projectionist), + new SendCheckInEmailProcessor($mailer), ]), - $projectionist + $projectionist, ); $repositoryManager = new DefaultRepositoryManager( $aggregateRegistry, - $store, - SyncProjectionistEventBusWrapper::createWithDefaultLockStrategy( - $eventBus, - $projectionist - ) + $eventStore, + $eventBus, ); $hotelRepository = $repositoryManager->get(Hotel::class); @@ -353,7 +352,7 @@ use Patchlevel\EventSourcing\Schema\DoctrineSchemaDirector; $schemaDirector = new DoctrineSchemaDirector( $connection, new ChainSchemaConfigurator([ - $store, + $eventStore, $projectionStore ]) ); From 2802ae449610b5492933500fd85b1b51a651633f Mon Sep 17 00:00:00 2001 From: David Badura Date: Thu, 1 Feb 2024 14:37:48 +0100 Subject: [PATCH 3/6] sync readme.md with index.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 03df125a5..afab71fdb 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ A lightweight but also all-inclusive event sourcing library with a focus on deve * Everything is included in the package for event sourcing * Based on [doctrine dbal](https://github.com/doctrine/dbal) and their ecosystem * Developer experience oriented and fully typed -* [Snapshots](https://patchlevel.github.io/event-sourcing-docs/latest/snapshots/) system to quickly rebuild the aggregates -* Allow to [Split-Stream](https://patchlevel.github.io/event-sourcing-docs/latest/split_stream/) for big aggregates -* [Pipeline](https://patchlevel.github.io/event-sourcing-docs/latest/pipeline/) to export,import and migrate events -* [Projectionist](https://patchlevel.github.io/event-sourcing-docs/latest/projection/) to manage versioned projections -* [Upcast](https://patchlevel.github.io/event-sourcing-docs/latest/upcasting/) old events -* [Scheme management](https://patchlevel.github.io/event-sourcing-docs/latest/store/) and [doctrine migration](https://patchlevel.github.io/event-sourcing-docs/latest/migration/) support -* Dev [tools](https://patchlevel.github.io/event-sourcing-docs/latest/watch_server/) such as a realtime event watcher +* Automatic [snapshot](https://patchlevel.github.io/event-sourcing-docs/latest/snapshots/)-system to boost your performance +* [Split](https://patchlevel.github.io/event-sourcing-docs/latest/split_stream/) big aggregates into multiple streams +* Build-in [pipeline](https://patchlevel.github.io/event-sourcing-docs/latest/pipeline/) to export, import and migrate event streams +* Versioned and managed lifecycle of [projections](https://patchlevel.github.io/event-sourcing-docs/latest/projection/) +* Smooth [upcasting](https://patchlevel.github.io/event-sourcing-docs/latest/upcasting/) of old events +* Simple setup with [scheme management](https://patchlevel.github.io/event-sourcing-docs/latest/store/) and [doctrine migration](https://patchlevel.github.io/event-sourcing-docs/latest/migration/) +* Dev [tools](https://patchlevel.github.io/event-sourcing-docs/latest/watch_server/) like realtime event watcher * Built in [cli commands](https://patchlevel.github.io/event-sourcing-docs/latest/cli/) with [symfony](https://symfony.com/) * and much more... From 220cd661ce24c0257ff42fdcd1a19c516cd386d0 Mon Sep 17 00:00:00 2001 From: David Badura Date: Thu, 1 Feb 2024 14:49:25 +0100 Subject: [PATCH 4/6] wording --- docs/pages/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/getting_started.md b/docs/pages/getting_started.md index a004e15b4..dfc5b1846 100644 --- a/docs/pages/getting_started.md +++ b/docs/pages/getting_started.md @@ -61,7 +61,7 @@ Next we need to define the hotel aggregate. How you can interact with it, what events happen and what the business rules are. For this we create the methods `create`, `checkIn` and `checkOut`. In these methods the business checks are made and events are recorded. -Otherwise we still need apply methods to change the state. +Last but not least, we need the associated apply methods to change the state. ```php use Patchlevel\EventSourcing\Aggregate\AggregateChanged; From a7f6202a162fc09309b72de3a222a4b0d360fa1c Mon Sep 17 00:00:00 2001 From: David Badura Date: Thu, 1 Feb 2024 15:02:34 +0100 Subject: [PATCH 5/6] wording Co-authored-by: Daniel Badura --- docs/pages/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/getting_started.md b/docs/pages/getting_started.md index dfc5b1846..1a22fec50 100644 --- a/docs/pages/getting_started.md +++ b/docs/pages/getting_started.md @@ -58,7 +58,7 @@ final class GuestIsCheckedOut ## Define aggregates Next we need to define the hotel aggregate. -How you can interact with it, what events happen and what the business rules are. +How you can interact with it, which events happen and what the business rules are. For this we create the methods `create`, `checkIn` and `checkOut`. In these methods the business checks are made and events are recorded. Last but not least, we need the associated apply methods to change the state. From 8ba72a4e74564752ccd1b3ba0f1b20b7439fd5b2 Mon Sep 17 00:00:00 2001 From: David Badura Date: Thu, 1 Feb 2024 15:02:42 +0100 Subject: [PATCH 6/6] wording Co-authored-by: Daniel Badura --- docs/pages/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/getting_started.md b/docs/pages/getting_started.md index 1a22fec50..b84a936a1 100644 --- a/docs/pages/getting_started.md +++ b/docs/pages/getting_started.md @@ -60,7 +60,7 @@ final class GuestIsCheckedOut Next we need to define the hotel aggregate. How you can interact with it, which events happen and what the business rules are. For this we create the methods `create`, `checkIn` and `checkOut`. -In these methods the business checks are made and events are recorded. +In these methods the business checks are made and the events are recorded. Last but not least, we need the associated apply methods to change the state. ```php