-
Notifications
You must be signed in to change notification settings - Fork 3
/
path---docs-primitives-abe8b4562fe39228b7f6.js.map
1 lines (1 loc) · 44.3 KB
/
path---docs-primitives-abe8b4562fe39228b7f6.js.map
1
{"version":3,"sources":["webpack:///path---docs-primitives-abe8b4562fe39228b7f6.js","webpack:///./.cache/json/docs-primitives.json"],"names":["webpackJsonp","419","module","exports","data","allPostTitles","edges","node","frontmatter","title","lesson","category","chapter","type","fields","slug","postBySlug","html","timeToRead","excerpt","cover","date","tags","pathContext"],"mappings":"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","file":"path---docs-primitives-abe8b4562fe39228b7f6.js","sourcesContent":["webpackJsonp([5874578191020],{\n\n/***/ 419:\n/***/ (function(module, exports) {\n\n\tmodule.exports = {\"data\":{\"allPostTitles\":{\"edges\":[{\"node\":{\"frontmatter\":{\"title\":\"Getting Started\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":1,\"type\":\"docs\"},\"fields\":{\"slug\":\"/getting-started\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Primitives\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/primitives\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Walkthrough Introduction\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/walkthrough-introduction\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Sagas\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/sagas\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Tips and Tricks\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":5,\"type\":\"docs\"},\"fields\":{\"slug\":\"/tips-and-tricks\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Aggregates\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/aggregates\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Aggregate\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-aggregate\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Snapshotting\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/snapshotting\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Articles\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":5,\"type\":\"docs\"},\"fields\":{\"slug\":\"/articles\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Events\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/events\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Commands\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-commands\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Clustering\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/clustering\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Videos\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":5,\"type\":\"docs\"},\"fields\":{\"slug\":\"/videos\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Commands\",\"lesson\":4,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/commands\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Events\",\"lesson\":4,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-events\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Production Readiness\",\"lesson\":4,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/production-readiness\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Specifications\",\"lesson\":5,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/specifications\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Specifications\",\"lesson\":5,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-specifications\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Event Upgrading\",\"lesson\":5,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/event-upgrading\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Subscribers\",\"lesson\":6,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/subscribers\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Aggregate Test\",\"lesson\":6,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-aggregate-test\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Testing Aggregates\",\"lesson\":6,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/testing-aggregates\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Scheduled Jobs\",\"lesson\":7,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/scheduled-jobs\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Aggregate Saga\",\"lesson\":7,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-aggregate-saga\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Akka\",\"lesson\":8,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/akka\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Subscribers\",\"lesson\":8,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-subscribers\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Configuration\",\"lesson\":9,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/configuration\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Projections\",\"lesson\":9,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-projections\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Walkthrough Ending\",\"lesson\":10,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/walkthrough-ending\"}}}]},\"postBySlug\":{\"html\":\"<p>The basic core primitives of Akkatecture are:</p>\\n<ul>\\n<li><a href=\\\"#value-objects\\\">Value Objects</a></li>\\n<li><a href=\\\"#identities\\\">Identities</a></li>\\n<li><a href=\\\"#entities\\\">Entities</a></li>\\n</ul>\\n<p>A <code class=\\\"language-text\\\">ValueObject</code> is an immutable type that is distinguishable only by the state of its properties. That is, unlike an <code class=\\\"language-text\\\">Entity</code>, which has a unique identifier and remains distinct even if its properties are otherwise identical, two <code class=\\\"language-text\\\">ValueObject</code>s with the exact same properties can be considered equal. An <code class=\\\"language-text\\\">Entity</code> always has a globally unique identifier, that is, if two entities have the same identity, they are the same entity, regardless if their member values are different. Akkatecture uses these primitives all over the project, and you are highly encouraged to use them as well, so that your domain design is highly expressive, and readable.</p>\\n<h1 id=\\\"value-objects\\\"><a href=\\\"#value-objects\\\" aria-hidden=\\\"true\\\" class=\\\"anchor\\\"><svg aria-hidden=\\\"true\\\" height=\\\"16\\\" version=\\\"1.1\\\" viewBox=\\\"0 0 16 16\\\" width=\\\"16\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\\\"></path></svg></a>Value Objects</h1>\\n<p>In Akkatecture, the <code class=\\\"language-text\\\">ValueObject</code> abstract class type is used to represent value object. These should be immutable by implementation. There also is the <code class=\\\"language-text\\\">SingleValueObject<></code> generic primitive, that allows for the modelling of domain value objects that are only valued by a single c# dotnet primitive.</p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token keyword\\\">public</span> <span class=\\\"token keyword\\\">class</span> <span class=\\\"token class-name\\\">AccountNumber</span> <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token class-name\\\">SingleValueObject</span><span class=\\\"token operator\\\"><</span><span class=\\\"token keyword\\\">string</span><span class=\\\"token operator\\\">></span>\\n<span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token function\\\">AccountNumber</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">string</span> <span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token keyword\\\">base</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token comment\\\">//do some model validation, null checks etc.</span>\\n <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\\n </div>\\n<blockquote>\\n<p>It is recommended to use <code class=\\\"language-text\\\">value</code> as the parameter name, if you intend to serialize value objects. With Akkatecture's built in serialization converters.</p>\\n</blockquote>\\n<h1 id=\\\"identities\\\"><a href=\\\"#identities\\\" aria-hidden=\\\"true\\\" class=\\\"anchor\\\"><svg aria-hidden=\\\"true\\\" height=\\\"16\\\" version=\\\"1.1\\\" viewBox=\\\"0 0 16 16\\\" width=\\\"16\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\\\"></path></svg></a>Identities</h1>\\n<p>The <code class=\\\"language-text\\\">Identity<></code> value object provides generic functionality to model and validate the identities of e.g. aggregate roots. Its esentially a wrapper around a <code class=\\\"language-text\\\">Guid</code>. It is possible to model your own <code class=\\\"language-text\\\">Identity<></code> by implementing the <code class=\\\"language-text\\\">IIdentity<></code> interface.</p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token keyword\\\">public</span> <span class=\\\"token keyword\\\">class</span> <span class=\\\"token class-name\\\">AccountId</span> <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token class-name\\\">Identity</span><span class=\\\"token operator\\\"><</span>AccountId<span class=\\\"token operator\\\">></span>\\n<span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token function\\\">AccountId</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">string</span> <span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token keyword\\\">base</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\\n </div>\\n<ol>\\n<li>\\n<p>The identity follow the form <code class=\\\"language-text\\\">{class without "Id"}-{guid}</code> e.g. <code class=\\\"language-text\\\">account-c93fdb8c-5c9a-4134-bbcd-87c0644ca34f</code> for the above <code class=\\\"language-text\\\">AccountId</code> example.</p>\\n</li>\\n<li>\\n<p>The internal <code class=\\\"language-text\\\">Guid</code> can be generated using one of the following methods/properties as described by points 3-5 on this list. You can access the <code class=\\\"language-text\\\">Guid</code> factories directly by accessing the static methods on the <code class=\\\"language-text\\\">GuidFactories</code> class.</p>\\n</li>\\n<li>\\n<p><code class=\\\"language-text\\\">New</code>: Uses the standard <code class=\\\"language-text\\\">Guid.NewGuid()</code>.</p>\\n</li>\\n<li>\\n<p><code class=\\\"language-text\\\">NewDeterministic(...)</code>: Creates a name-based <code class=\\\"language-text\\\">Guid</code> using the algorithm from <a href=\\\"https://www.ietf.org/rfc/rfc4122.txt\\\">RFC 4122 §4.3</a>, which allows identities to be generated based on known data, e.g. an e-mail, i.e., it always returns the same identity for the same arguments.</p>\\n</li>\\n<li>\\n<p><code class=\\\"language-text\\\">NewComb()</code>: Creates a sequential <code class=\\\"language-text\\\">Guid</code> that can be used to e.g. avoid database fragmentation.</p>\\n</li>\\n<li>\\n<p>A <code class=\\\"language-text\\\">string</code> can be tested to see if its a valid identity using the static <code class=\\\"language-text\\\">bool IsValid(string)</code> method.</p>\\n</li>\\n<li>\\n<p>Any validation errors can be gathered using the static <code class=\\\"language-text\\\">IEnumerable<string> Validate(string)</code> method.</p>\\n</li>\\n</ol>\\n<blockquote>\\n<p> Its very important to name the constructor argument <code class=\\\"language-text\\\">value</code> as it is significant when the identity type is deserialized.</p>\\n</blockquote>\\n<p>Here's some examples on we can use our newly created <code class=\\\"language-text\\\">AccountId</code></p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token comment\\\">// Uses the default Guid.NewGuid()</span>\\n<span class=\\\"token comment\\\">// as described in point 3 above</span>\\n<span class=\\\"token keyword\\\">var</span> accountId <span class=\\\"token operator\\\">=</span> AccountId<span class=\\\"token punctuation\\\">.</span>New</code></pre>\\n </div>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token comment\\\">// Create a namespace, put this in a constant somewhere</span>\\n<span class=\\\"token keyword\\\">var</span> emailNamespace <span class=\\\"token operator\\\">=</span> Guid<span class=\\\"token punctuation\\\">.</span><span class=\\\"token function\\\">Parse</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token string\\\">\\\"769077C6-F84D-46E3-AD2E-828A576AAAF3\\\"</span><span class=\\\"token punctuation\\\">)</span><span class=\\\"token punctuation\\\">;</span>\\n\\n<span class=\\\"token comment\\\">// Creates an identity with the value \\\"account-9181a444-af25-567e-a866-c263b6f6119a\\\",</span>\\n<span class=\\\"token comment\\\">// useful to use when you want to create Id's</span>\\n<span class=\\\"token comment\\\">// deterministically from other real world \\\"identifiers\\\",</span>\\n<span class=\\\"token comment\\\">// especially in distributed situations</span>\\n<span class=\\\"token comment\\\">// as described in point 4 above</span>\\n<span class=\\\"token keyword\\\">var</span> accountId <span class=\\\"token operator\\\">=</span> AccountId<span class=\\\"token punctuation\\\">.</span><span class=\\\"token function\\\">NewDeterministic</span><span class=\\\"token punctuation\\\">(</span>emailNamespace<span class=\\\"token punctuation\\\">,</span> <span class=\\\"token string\\\">\\\"[email protected]\\\"</span><span class=\\\"token punctuation\\\">)</span><span class=\\\"token punctuation\\\">;</span></code></pre>\\n </div>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token comment\\\">// Creates a new identity every time, but an identity when used in e.g.</span>\\n<span class=\\\"token comment\\\">// database indexes, minimizes fragmentation</span>\\n<span class=\\\"token comment\\\">// as described in point 5 above</span>\\n<span class=\\\"token keyword\\\">var</span> accountId <span class=\\\"token operator\\\">=</span> AccountId<span class=\\\"token punctuation\\\">.</span><span class=\\\"token function\\\">NewComb</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token punctuation\\\">)</span></code></pre>\\n </div>\\n<blockquote>\\n<p>You are not forced to use the <code class=\\\"language-text\\\">Identity<></code> implementation from Akkatecture. If you make your own Identity that implements <code class=\\\"language-text\\\">IIdentity</code> then it can still plug into all of the Akkatecture constructs as variants.</p>\\n</blockquote>\\n<h1 id=\\\"entities\\\"><a href=\\\"#entities\\\" aria-hidden=\\\"true\\\" class=\\\"anchor\\\"><svg aria-hidden=\\\"true\\\" height=\\\"16\\\" version=\\\"1.1\\\" viewBox=\\\"0 0 16 16\\\" width=\\\"16\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\\\"></path></svg></a>Entities</h1>\\n<p>An <code class=\\\"language-text\\\">Entity</code> is an object that has some intrinsic identity, apart from the rest of its state. Even if its properties are the same as another instance of the same type, it remains distinct because of its unique identity. The <code class=\\\"language-text\\\">Entity<></code> In Akkatecture is itself a <code class=\\\"language-text\\\">ValueObject</code> however it implements the <code class=\\\"language-text\\\">IEntity<Identity></code> interface, which requires it to have a member called <code class=\\\"language-text\\\">Identity Id</code>. Now you can see the relationship between <code class=\\\"language-text\\\">Entity<></code>, <code class=\\\"language-text\\\">SingleValueObject<></code>, and <code class=\\\"language-text\\\">Identity<></code>. A sample <code class=\\\"language-text\\\">Entity</code> running onwards from the Account example above, could be:</p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token keyword\\\">public</span> <span class=\\\"token keyword\\\">class</span> <span class=\\\"token class-name\\\">Account</span> <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token class-name\\\">Entity</span><span class=\\\"token operator\\\"><</span>AccountId<span class=\\\"token operator\\\">></span>\\n<span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token class-name\\\">AccountNumber</span> AccountNumber <span class=\\\"token punctuation\\\">{</span><span class=\\\"token keyword\\\">get</span><span class=\\\"token punctuation\\\">;</span><span class=\\\"token punctuation\\\">}</span>\\n\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token function\\\">Account</span><span class=\\\"token punctuation\\\">(</span>\\n <span class=\\\"token class-name\\\">AccountId</span> entityId<span class=\\\"token punctuation\\\">,</span>\\n <span class=\\\"token class-name\\\">AccountNumber</span> accountNumber<span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token keyword\\\">base</span><span class=\\\"token punctuation\\\">(</span>entityId<span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token comment\\\">//do some model validation, null checks etc.</span>\\n AccountNumber <span class=\\\"token operator\\\">=</span> accountNumber<span class=\\\"token punctuation\\\">;</span>\\n <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\\n </div>\\n<blockquote>\\n<p>When you look at the <code class=\\\"language-text\\\">Account</code> class/model definition above, you could describe it using object oriented programming language. That is, The <code class=\\\"language-text\\\">Account</code> class/model <em>is-an</em> <code class=\\\"language-text\\\">Entity<></code> that <em>has-an</em> <code class=\\\"language-text\\\">AccountId</code>, and <em>has-an</em> <code class=\\\"language-text\\\">AccountNumber</code>. </p>\\n</blockquote>\\n<p><a href=\\\"/docs/aggregates\\\">Next, Aggregates →</a></p>\",\"timeToRead\":4,\"excerpt\":\"The basic core primitives of Akkatecture are: Value Objects Identities Entities A is an immutable type that is distinguishable only by the…\",\"frontmatter\":{\"title\":\"Primitives\",\"cover\":\"https://unsplash.it/400/300/?random?BoldMage\",\"date\":\"01/07/2018\",\"category\":\"akkatecture\",\"tags\":[\"basic-concepts\",\"akkatecture\",\"csharp\",\"dotnet\"]},\"fields\":{\"slug\":\"/primitives\"}}},\"pathContext\":{\"slug\":\"/primitives\",\"category\":\"akkatecture\"}}\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// path---docs-primitives-abe8b4562fe39228b7f6.js","module.exports = {\"data\":{\"allPostTitles\":{\"edges\":[{\"node\":{\"frontmatter\":{\"title\":\"Getting Started\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":1,\"type\":\"docs\"},\"fields\":{\"slug\":\"/getting-started\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Primitives\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/primitives\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Walkthrough Introduction\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/walkthrough-introduction\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Sagas\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/sagas\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Tips and Tricks\",\"lesson\":1,\"category\":\"akkatecture\",\"chapter\":5,\"type\":\"docs\"},\"fields\":{\"slug\":\"/tips-and-tricks\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Aggregates\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/aggregates\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Aggregate\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-aggregate\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Snapshotting\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/snapshotting\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Articles\",\"lesson\":2,\"category\":\"akkatecture\",\"chapter\":5,\"type\":\"docs\"},\"fields\":{\"slug\":\"/articles\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Events\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/events\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Commands\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-commands\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Clustering\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/clustering\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Videos\",\"lesson\":3,\"category\":\"akkatecture\",\"chapter\":5,\"type\":\"docs\"},\"fields\":{\"slug\":\"/videos\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Commands\",\"lesson\":4,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/commands\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Events\",\"lesson\":4,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-events\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Production Readiness\",\"lesson\":4,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/production-readiness\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Specifications\",\"lesson\":5,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/specifications\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Specifications\",\"lesson\":5,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-specifications\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Event Upgrading\",\"lesson\":5,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/event-upgrading\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Subscribers\",\"lesson\":6,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/subscribers\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Aggregate Test\",\"lesson\":6,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-aggregate-test\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Testing Aggregates\",\"lesson\":6,\"category\":\"akkatecture\",\"chapter\":4,\"type\":\"docs\"},\"fields\":{\"slug\":\"/testing-aggregates\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Scheduled Jobs\",\"lesson\":7,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/scheduled-jobs\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Aggregate Saga\",\"lesson\":7,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-aggregate-saga\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Akka\",\"lesson\":8,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/akka\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Subscribers\",\"lesson\":8,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-subscribers\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Configuration\",\"lesson\":9,\"category\":\"akkatecture\",\"chapter\":2,\"type\":\"docs\"},\"fields\":{\"slug\":\"/configuration\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Your First Projections\",\"lesson\":9,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/your-first-projections\"}}},{\"node\":{\"frontmatter\":{\"title\":\"Walkthrough Ending\",\"lesson\":10,\"category\":\"akkatecture\",\"chapter\":3,\"type\":\"docs\"},\"fields\":{\"slug\":\"/walkthrough-ending\"}}}]},\"postBySlug\":{\"html\":\"<p>The basic core primitives of Akkatecture are:</p>\\n<ul>\\n<li><a href=\\\"#value-objects\\\">Value Objects</a></li>\\n<li><a href=\\\"#identities\\\">Identities</a></li>\\n<li><a href=\\\"#entities\\\">Entities</a></li>\\n</ul>\\n<p>A <code class=\\\"language-text\\\">ValueObject</code> is an immutable type that is distinguishable only by the state of its properties. That is, unlike an <code class=\\\"language-text\\\">Entity</code>, which has a unique identifier and remains distinct even if its properties are otherwise identical, two <code class=\\\"language-text\\\">ValueObject</code>s with the exact same properties can be considered equal. An <code class=\\\"language-text\\\">Entity</code> always has a globally unique identifier, that is, if two entities have the same identity, they are the same entity, regardless if their member values are different. Akkatecture uses these primitives all over the project, and you are highly encouraged to use them as well, so that your domain design is highly expressive, and readable.</p>\\n<h1 id=\\\"value-objects\\\"><a href=\\\"#value-objects\\\" aria-hidden=\\\"true\\\" class=\\\"anchor\\\"><svg aria-hidden=\\\"true\\\" height=\\\"16\\\" version=\\\"1.1\\\" viewBox=\\\"0 0 16 16\\\" width=\\\"16\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\\\"></path></svg></a>Value Objects</h1>\\n<p>In Akkatecture, the <code class=\\\"language-text\\\">ValueObject</code> abstract class type is used to represent value object. These should be immutable by implementation. There also is the <code class=\\\"language-text\\\">SingleValueObject<></code> generic primitive, that allows for the modelling of domain value objects that are only valued by a single c# dotnet primitive.</p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token keyword\\\">public</span> <span class=\\\"token keyword\\\">class</span> <span class=\\\"token class-name\\\">AccountNumber</span> <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token class-name\\\">SingleValueObject</span><span class=\\\"token operator\\\"><</span><span class=\\\"token keyword\\\">string</span><span class=\\\"token operator\\\">></span>\\n<span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token function\\\">AccountNumber</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">string</span> <span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token keyword\\\">base</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token comment\\\">//do some model validation, null checks etc.</span>\\n <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\\n </div>\\n<blockquote>\\n<p>It is recommended to use <code class=\\\"language-text\\\">value</code> as the parameter name, if you intend to serialize value objects. With Akkatecture's built in serialization converters.</p>\\n</blockquote>\\n<h1 id=\\\"identities\\\"><a href=\\\"#identities\\\" aria-hidden=\\\"true\\\" class=\\\"anchor\\\"><svg aria-hidden=\\\"true\\\" height=\\\"16\\\" version=\\\"1.1\\\" viewBox=\\\"0 0 16 16\\\" width=\\\"16\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\\\"></path></svg></a>Identities</h1>\\n<p>The <code class=\\\"language-text\\\">Identity<></code> value object provides generic functionality to model and validate the identities of e.g. aggregate roots. Its esentially a wrapper around a <code class=\\\"language-text\\\">Guid</code>. It is possible to model your own <code class=\\\"language-text\\\">Identity<></code> by implementing the <code class=\\\"language-text\\\">IIdentity<></code> interface.</p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token keyword\\\">public</span> <span class=\\\"token keyword\\\">class</span> <span class=\\\"token class-name\\\">AccountId</span> <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token class-name\\\">Identity</span><span class=\\\"token operator\\\"><</span>AccountId<span class=\\\"token operator\\\">></span>\\n<span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token function\\\">AccountId</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">string</span> <span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token keyword\\\">base</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token keyword\\\">value</span><span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\\n </div>\\n<ol>\\n<li>\\n<p>The identity follow the form <code class=\\\"language-text\\\">{class without "Id"}-{guid}</code> e.g. <code class=\\\"language-text\\\">account-c93fdb8c-5c9a-4134-bbcd-87c0644ca34f</code> for the above <code class=\\\"language-text\\\">AccountId</code> example.</p>\\n</li>\\n<li>\\n<p>The internal <code class=\\\"language-text\\\">Guid</code> can be generated using one of the following methods/properties as described by points 3-5 on this list. You can access the <code class=\\\"language-text\\\">Guid</code> factories directly by accessing the static methods on the <code class=\\\"language-text\\\">GuidFactories</code> class.</p>\\n</li>\\n<li>\\n<p><code class=\\\"language-text\\\">New</code>: Uses the standard <code class=\\\"language-text\\\">Guid.NewGuid()</code>.</p>\\n</li>\\n<li>\\n<p><code class=\\\"language-text\\\">NewDeterministic(...)</code>: Creates a name-based <code class=\\\"language-text\\\">Guid</code> using the algorithm from <a href=\\\"https://www.ietf.org/rfc/rfc4122.txt\\\">RFC 4122 §4.3</a>, which allows identities to be generated based on known data, e.g. an e-mail, i.e., it always returns the same identity for the same arguments.</p>\\n</li>\\n<li>\\n<p><code class=\\\"language-text\\\">NewComb()</code>: Creates a sequential <code class=\\\"language-text\\\">Guid</code> that can be used to e.g. avoid database fragmentation.</p>\\n</li>\\n<li>\\n<p>A <code class=\\\"language-text\\\">string</code> can be tested to see if its a valid identity using the static <code class=\\\"language-text\\\">bool IsValid(string)</code> method.</p>\\n</li>\\n<li>\\n<p>Any validation errors can be gathered using the static <code class=\\\"language-text\\\">IEnumerable<string> Validate(string)</code> method.</p>\\n</li>\\n</ol>\\n<blockquote>\\n<p> Its very important to name the constructor argument <code class=\\\"language-text\\\">value</code> as it is significant when the identity type is deserialized.</p>\\n</blockquote>\\n<p>Here's some examples on we can use our newly created <code class=\\\"language-text\\\">AccountId</code></p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token comment\\\">// Uses the default Guid.NewGuid()</span>\\n<span class=\\\"token comment\\\">// as described in point 3 above</span>\\n<span class=\\\"token keyword\\\">var</span> accountId <span class=\\\"token operator\\\">=</span> AccountId<span class=\\\"token punctuation\\\">.</span>New</code></pre>\\n </div>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token comment\\\">// Create a namespace, put this in a constant somewhere</span>\\n<span class=\\\"token keyword\\\">var</span> emailNamespace <span class=\\\"token operator\\\">=</span> Guid<span class=\\\"token punctuation\\\">.</span><span class=\\\"token function\\\">Parse</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token string\\\">\\\"769077C6-F84D-46E3-AD2E-828A576AAAF3\\\"</span><span class=\\\"token punctuation\\\">)</span><span class=\\\"token punctuation\\\">;</span>\\n\\n<span class=\\\"token comment\\\">// Creates an identity with the value \\\"account-9181a444-af25-567e-a866-c263b6f6119a\\\",</span>\\n<span class=\\\"token comment\\\">// useful to use when you want to create Id's</span>\\n<span class=\\\"token comment\\\">// deterministically from other real world \\\"identifiers\\\",</span>\\n<span class=\\\"token comment\\\">// especially in distributed situations</span>\\n<span class=\\\"token comment\\\">// as described in point 4 above</span>\\n<span class=\\\"token keyword\\\">var</span> accountId <span class=\\\"token operator\\\">=</span> AccountId<span class=\\\"token punctuation\\\">.</span><span class=\\\"token function\\\">NewDeterministic</span><span class=\\\"token punctuation\\\">(</span>emailNamespace<span class=\\\"token punctuation\\\">,</span> <span class=\\\"token string\\\">\\\"[email protected]\\\"</span><span class=\\\"token punctuation\\\">)</span><span class=\\\"token punctuation\\\">;</span></code></pre>\\n </div>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token comment\\\">// Creates a new identity every time, but an identity when used in e.g.</span>\\n<span class=\\\"token comment\\\">// database indexes, minimizes fragmentation</span>\\n<span class=\\\"token comment\\\">// as described in point 5 above</span>\\n<span class=\\\"token keyword\\\">var</span> accountId <span class=\\\"token operator\\\">=</span> AccountId<span class=\\\"token punctuation\\\">.</span><span class=\\\"token function\\\">NewComb</span><span class=\\\"token punctuation\\\">(</span><span class=\\\"token punctuation\\\">)</span></code></pre>\\n </div>\\n<blockquote>\\n<p>You are not forced to use the <code class=\\\"language-text\\\">Identity<></code> implementation from Akkatecture. If you make your own Identity that implements <code class=\\\"language-text\\\">IIdentity</code> then it can still plug into all of the Akkatecture constructs as variants.</p>\\n</blockquote>\\n<h1 id=\\\"entities\\\"><a href=\\\"#entities\\\" aria-hidden=\\\"true\\\" class=\\\"anchor\\\"><svg aria-hidden=\\\"true\\\" height=\\\"16\\\" version=\\\"1.1\\\" viewBox=\\\"0 0 16 16\\\" width=\\\"16\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\\\"></path></svg></a>Entities</h1>\\n<p>An <code class=\\\"language-text\\\">Entity</code> is an object that has some intrinsic identity, apart from the rest of its state. Even if its properties are the same as another instance of the same type, it remains distinct because of its unique identity. The <code class=\\\"language-text\\\">Entity<></code> In Akkatecture is itself a <code class=\\\"language-text\\\">ValueObject</code> however it implements the <code class=\\\"language-text\\\">IEntity<Identity></code> interface, which requires it to have a member called <code class=\\\"language-text\\\">Identity Id</code>. Now you can see the relationship between <code class=\\\"language-text\\\">Entity<></code>, <code class=\\\"language-text\\\">SingleValueObject<></code>, and <code class=\\\"language-text\\\">Identity<></code>. A sample <code class=\\\"language-text\\\">Entity</code> running onwards from the Account example above, could be:</p>\\n<div class=\\\"gatsby-highlight\\\">\\n <pre class=\\\"language-csharp\\\"><code class=\\\"language-csharp\\\"><span class=\\\"token keyword\\\">public</span> <span class=\\\"token keyword\\\">class</span> <span class=\\\"token class-name\\\">Account</span> <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token class-name\\\">Entity</span><span class=\\\"token operator\\\"><</span>AccountId<span class=\\\"token operator\\\">></span>\\n<span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token class-name\\\">AccountNumber</span> AccountNumber <span class=\\\"token punctuation\\\">{</span><span class=\\\"token keyword\\\">get</span><span class=\\\"token punctuation\\\">;</span><span class=\\\"token punctuation\\\">}</span>\\n\\n <span class=\\\"token keyword\\\">public</span> <span class=\\\"token function\\\">Account</span><span class=\\\"token punctuation\\\">(</span>\\n <span class=\\\"token class-name\\\">AccountId</span> entityId<span class=\\\"token punctuation\\\">,</span>\\n <span class=\\\"token class-name\\\">AccountNumber</span> accountNumber<span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">:</span> <span class=\\\"token keyword\\\">base</span><span class=\\\"token punctuation\\\">(</span>entityId<span class=\\\"token punctuation\\\">)</span>\\n <span class=\\\"token punctuation\\\">{</span>\\n <span class=\\\"token comment\\\">//do some model validation, null checks etc.</span>\\n AccountNumber <span class=\\\"token operator\\\">=</span> accountNumber<span class=\\\"token punctuation\\\">;</span>\\n <span class=\\\"token punctuation\\\">}</span>\\n<span class=\\\"token punctuation\\\">}</span></code></pre>\\n </div>\\n<blockquote>\\n<p>When you look at the <code class=\\\"language-text\\\">Account</code> class/model definition above, you could describe it using object oriented programming language. That is, The <code class=\\\"language-text\\\">Account</code> class/model <em>is-an</em> <code class=\\\"language-text\\\">Entity<></code> that <em>has-an</em> <code class=\\\"language-text\\\">AccountId</code>, and <em>has-an</em> <code class=\\\"language-text\\\">AccountNumber</code>. </p>\\n</blockquote>\\n<p><a href=\\\"/docs/aggregates\\\">Next, Aggregates →</a></p>\",\"timeToRead\":4,\"excerpt\":\"The basic core primitives of Akkatecture are: Value Objects Identities Entities A is an immutable type that is distinguishable only by the…\",\"frontmatter\":{\"title\":\"Primitives\",\"cover\":\"https://unsplash.it/400/300/?random?BoldMage\",\"date\":\"01/07/2018\",\"category\":\"akkatecture\",\"tags\":[\"basic-concepts\",\"akkatecture\",\"csharp\",\"dotnet\"]},\"fields\":{\"slug\":\"/primitives\"}}},\"pathContext\":{\"slug\":\"/primitives\",\"category\":\"akkatecture\"}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/json-loader!./.cache/json/docs-primitives.json\n// module id = 419\n// module chunks = 5874578191020"],"sourceRoot":""}