EdPug - July 2018
Scott Pringle
Lead Software Developer & Technical Team Lead
@ People's Postcode Lottery
Former DDDEdinburgh Organiser
An event is an action recognized by software, that may be handled by the software
https://en.wikipedia.org/wiki/Event_(computing)#Description
An Event is the encapsulation of a recorded action within an application
Me, probably plagiarising someone...
<?php
namespace Acme\Demo\Event;
use Acme\Demo\Entity\User;
use Acme\Demo\Entity\Transaction;
class UserRefundRequestedEvent
{
/**
* @var User
*/
private $user;
/**
* @var Transaction
*/
private $transaction;
public function __construct(User $user, Transaction $transaction)
{
$this->user = $user;
$this->transaction = $transaction;
}
public function getUser(): User
{
return $this->user;
}
public function getTransaction(): Transaction
{
return $this->transaction;
}
}
{
"timestamp": "2018-07-18T19:00:00Z",
"payload": {
"user": {
"forename": "Scott",
"surname": "Pringle",
"id": 1
},
"transaction": {
"timestamp": "2018-06-01 11:55:00",
"totalCost": "1099",
"items": [],
"shipping": "99"
}
},
"type": "UserRefundRequested",
"version": 1,
"identifier": "7683ba44-bd0a-49ac-82b7-ce41b38d4a2a"
}
http://cloudevents.io
{
"eventTime": "2018-07-18T19:00:00Z",
"data": {
"user": {
"forename": "Scott",
"surname": "Pringle",
"id": 1
},
"transaction": {
"timestamp": "2018-06-01 11:55:00",
"totalCost": "1099",
"items": [],
"shipping": "99"
}
},
"eventType": "UserRefundRequested",
"eventTypeVersion": 1,
"cloudEventsVersion": "0.1",
"source": "ProducerUri/Component",
"eventID": "7683ba44-bd0a-49ac-82b7-ce41b38d4a2a",
"schemaURL": "OptionalUrlForData", # Soap did something good...
"contentType": "application/json",
"extensions": {
"key1": "value1",
}
}
Domain Event
Command
Actor
Aggregate
Event Storming
Consequence of Event Processing, e.g.
Twitter: @Luciam91