Skip to content

Commit

Permalink
Creating a draft version of Basic Concepts section for further review…
Browse files Browse the repository at this point in the history
… and edits (see documentation PR #9).
  • Loading branch information
meizabel committed Mar 29, 2019
1 parent 0edd9d2 commit 09057dd
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 0 deletions.
26 changes: 26 additions & 0 deletions concepts/aggregate.md
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).





14 changes: 14 additions & 0 deletions concepts/command-handler.md
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.

17 changes: 17 additions & 0 deletions concepts/commands.md
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.


12 changes: 12 additions & 0 deletions concepts/event-bus.md
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.

13 changes: 13 additions & 0 deletions concepts/events.md
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.
18 changes: 18 additions & 0 deletions concepts/failure.md
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.

18 changes: 18 additions & 0 deletions concepts/identifiers.md
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.
20 changes: 20 additions & 0 deletions concepts/index.md
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.




17 changes: 17 additions & 0 deletions concepts/process-manager.md
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.
13 changes: 13 additions & 0 deletions concepts/projection.md
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.

0 comments on commit 09057dd

Please sign in to comment.