-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating a draft version of Basic Concepts section for further review…
… and edits (see documentation PR #9).
- Loading branch information
Showing
10 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Aggregate Concept | ||
headline: Event Sourcing Concepts | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Aggregate</h2> | ||
|
||
Aggregate is the main building block of a business model. | ||
From the application point of view it consists of the following: | ||
1. Commands which arrive to it. | ||
2. Events which appear in response to these commands. | ||
3. How these events influence the state of an aggregate. | ||
|
||
[Aggregates](http://martinfowler.com/bliki/DDD_Aggregate.html) guarantee consistency of data modifications in response to commands they receive. | ||
|
||
Aggregate is the most common case of Command Handler. It modifies its state and produces one or more events in response to a command. These events are used later to restore the state of the aggregate. | ||
|
||
In Spine, aggregates are defined as [defined as Java classes](/java/aggregate.md), and their states are [defined as protobuf messages](/biz-model/aggregate-states.md). | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Command Handler Concept | ||
headline: Command Handler | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Command Handler</h2> | ||
|
||
Command Handler is an object which receives commands, modifies the state of the application, and generates events if the modification was successful. | ||
|
||
For more details, refer to [Java](/java/index.md) section. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Commands Concept | ||
headline: Commands | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Commands</h2> | ||
|
||
Commands are messages that instruct an entity within Spine framework to perform a certain action. Compared with events, command is not a statement of fact. They are a request, and, thus, can be refused. | ||
|
||
A typical way to convey refusal is to throw an error or failure. | ||
|
||
In Spine, commands are defined as a Protocol buffer messages. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
title: Event Bus Concept | ||
headline: Event Bus | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Event Bus</h2> | ||
|
||
Event Bus dispatches incoming events to handlers and provides ways for registering those handlers. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Events Concept | ||
headline: Events | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Events</h2> | ||
|
||
Event is something that happened in the past. All changes to an application state are captured as a sequence of events. Events are the main “database” of the application. | ||
|
||
In Spine, events are defined as Protocol buffer messages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Failure Concept | ||
headline: Failure | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Failure</h2> | ||
|
||
Failure is a state of business logic which can be handled by the end user. | ||
Consider the following examples of failures: | ||
* “credit card validation declined”, | ||
* “order cannot be empty”, | ||
* “insufficient funds”. | ||
|
||
In Spine, failures are defined as Protocol buffer messages. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Identifiers Concept | ||
headline: Identifier | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Identifiers</h2> | ||
|
||
Spine framework supports the following types of identifiers: | ||
|
||
* Integer, | ||
* Long, | ||
* String, | ||
* A generated Java class implementing the `Message`. | ||
|
||
We recommend you to select Identifiers for your IDs and encourage using message-based IDs to avoid possible performance issues. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Basic Concepts Overview | ||
headline: Spine Basic Concepts | ||
bodyclass: docs | ||
layout: docs | ||
type: markdown | ||
sidenav: doc-side-concepts-nav.html | ||
--- | ||
<h2 class="top">Spine Basic Concepts</h2> | ||
|
||
<div id="toc" class="toc hide-block"></div> | ||
This section introduces key concepts of Spine framework and its parts, helps you get a deeper understanding of how it works and provides some usage notes when creating Spine-based cloud application. | ||
|
||
We assume that you are familiar with the basics of Domain-Driven Design. | ||
|
||
Below you can find a typical Spine Event Engine application architecture; its building blocks are described below. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Process Manager Concept | ||
headline: Process Manager | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Process Manager</h2> | ||
|
||
Process Manager is an independent component that reacts to domain events in a cross-aggregate eventually consistent manner. It serves as a centralized processing unit that maintains the state sequence and defines the next processing step based on intermediate results. | ||
|
||
[Process manager](/java/process-manager.md) can be both Command Handler and Event Handler. | ||
|
||
Note: A constructor for Process Manager can have no parameter at all. | ||
|
||
Tip: We recommend to use process ID when integrating with side services. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
title: Projection Concept | ||
headline: Projection | ||
bodyclass: docs | ||
layout: docs | ||
sidenav: doc-side-concepts-nav.html | ||
type: markdown | ||
--- | ||
<h2 class="top">Projection</h2> | ||
|
||
Projection is an Event Handler which transforms multiple events data into a structural representation. | ||
|
||
Projections are the main building blocks of the Query side of the application. |