https://github.com/open-solid/domain
Business domain building blocks
https://github.com/open-solid/domain
ddd domain-events event-sourcing
Last synced: 4 months ago
JSON representation
Business domain building blocks
- Host: GitHub
- URL: https://github.com/open-solid/domain
- Owner: open-solid
- License: mit
- Created: 2024-04-30T04:21:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-27T13:35:02.000Z (over 1 year ago)
- Last Synced: 2025-12-12T22:20:31.385Z (6 months ago)
- Topics: ddd, domain-events, event-sourcing
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Domain Building Blocks
## Installation
```bash
composer require open-solid/domain
```
## Usage
### Domain Events
Domain events are significant occurrences within a software system that
reflect changes in the state of the domain. These events are used to
capture and communicate changes, allowing different parts of the system
to react accordingly.
For example, in an e-commerce application, a domain event might be
"OrderPlaced" when a customer completes a purchase. This event can then
trigger other actions such as updating inventory, sending a confirmation
email, or processing payment. Domain events help to decouple systems,
making them more modular and easier to maintain, as each component can
independently respond to changes without being tightly integrated.
```php
[new UserRegisteredSubscriber()],
]),
),
]);
$bus = new NativeDomainEventBus(new NativeLazyMessageBus($nativeMessageBus));
$bus->publish(new EntityUpdated('uuid'));
// do something in between ...
$bus->flush();
```
## License
This software is published under the [MIT License](LICENSE)