diff --git a/concepts/aggregate.md b/concepts/aggregate.md new file mode 100644 index 0000000..e9bedfc --- /dev/null +++ b/concepts/aggregate.md @@ -0,0 +1,26 @@ +--- +title: Aggregate Concept +headline: Event Sourcing Concepts +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Aggregate

+ +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). + + + + + diff --git a/concepts/command-handler.md b/concepts/command-handler.md new file mode 100644 index 0000000..f72d481 --- /dev/null +++ b/concepts/command-handler.md @@ -0,0 +1,14 @@ +--- +title: Command Handler Concept +headline: Command Handler +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Command Handler

+ +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. + diff --git a/concepts/commands.md b/concepts/commands.md new file mode 100644 index 0000000..f5b4d66 --- /dev/null +++ b/concepts/commands.md @@ -0,0 +1,17 @@ +--- +title: Commands Concept +headline: Commands +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Commands

+ +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. + + diff --git a/concepts/event-bus.md b/concepts/event-bus.md new file mode 100644 index 0000000..ccc17a7 --- /dev/null +++ b/concepts/event-bus.md @@ -0,0 +1,12 @@ +--- +title: Event Bus Concept +headline: Event Bus +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Event Bus

+ +Event Bus dispatches incoming events to handlers and provides ways for registering those handlers. + diff --git a/concepts/events.md b/concepts/events.md new file mode 100644 index 0000000..9f69c25 --- /dev/null +++ b/concepts/events.md @@ -0,0 +1,13 @@ +--- +title: Events Concept +headline: Events +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Events

+ +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. diff --git a/concepts/failure.md b/concepts/failure.md new file mode 100644 index 0000000..f97d084 --- /dev/null +++ b/concepts/failure.md @@ -0,0 +1,18 @@ +--- +title: Failure Concept +headline: Failure +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Failure

+ +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. + diff --git a/concepts/identifiers.md b/concepts/identifiers.md new file mode 100644 index 0000000..386c120 --- /dev/null +++ b/concepts/identifiers.md @@ -0,0 +1,18 @@ +--- +title: Identifiers Concept +headline: Identifier +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Identifiers

+ +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. diff --git a/concepts/index.md b/concepts/index.md new file mode 100644 index 0000000..03b874e --- /dev/null +++ b/concepts/index.md @@ -0,0 +1,20 @@ +--- +title: Basic Concepts Overview +headline: Spine Basic Concepts +bodyclass: docs +layout: docs +type: markdown +sidenav: doc-side-concepts-nav.html +--- +

Spine Basic Concepts

+ +
+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. + + + + diff --git a/concepts/process-manager.md b/concepts/process-manager.md new file mode 100644 index 0000000..ff5c6fe --- /dev/null +++ b/concepts/process-manager.md @@ -0,0 +1,17 @@ +--- +title: Process Manager Concept +headline: Process Manager +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Process Manager

+ +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. diff --git a/concepts/projection.md b/concepts/projection.md new file mode 100644 index 0000000..dad0aa9 --- /dev/null +++ b/concepts/projection.md @@ -0,0 +1,13 @@ +--- +title: Projection Concept +headline: Projection +bodyclass: docs +layout: docs +sidenav: doc-side-concepts-nav.html +type: markdown +--- +

Projection

+ +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. \ No newline at end of file