{"id":39,"date":"2023-08-31T00:01:31","date_gmt":"2023-08-30T23:01:31","guid":{"rendered":"https:\/\/codeblog.xyz\/?p=39"},"modified":"2023-10-23T21:28:03","modified_gmt":"2023-10-23T18:28:03","slug":"cqrs-key-concepts-and-best-practices","status":"publish","type":"post","link":"https:\/\/codeblog.xyz\/?p=39","title":{"rendered":"CQRS &#8211; key concepts and best practices"},"content":{"rendered":"\n<p><strong>Conceptual Understanding<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Onion Architecture is all about the positioning of concerns and flow of dependencies, primarily toward the center.<\/li>\n\n\n\n<li>The center of the onion, the domain model, should have no dependencies on any outer layers.<\/li>\n\n\n\n<li>Layers in the Onion Architecture are differentiated based on their responsibilities.<\/li>\n\n\n\n<li>The layers include: Domain Model (center), Domain Services, Application Services, and Infrastructure (outermost).<\/li>\n\n\n\n<li>The inner layers define interfaces that outer layers implement.<\/li>\n\n\n\n<li>Dependency inversion is used to invert the flow of control which helps in achieving a decoupled and testable architecture.<\/li>\n\n\n\n<li>Onion Architecture emphasizes that the infrastructure is just a detail and the application should not be dependent on it.<\/li>\n\n\n\n<li>The architecture helps in building scalable, maintainable, and testable applications.<\/li>\n<\/ol>\n\n\n\n<p><strong>Domain Layer<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"9\">\n<li>This is the innermost layer representing enterprise-wide business concepts.<\/li>\n\n\n\n<li>It includes Entities, Value Objects, and Domain Events.<\/li>\n\n\n\n<li>It is technology-agnostic and has no dependencies on outer layers.<\/li>\n\n\n\n<li>Contains business rules that should be common to multiple applications in the same domain.<\/li>\n\n\n\n<li>Defines interfaces for repositories that outer layers<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Conceptual Understanding Domain Layer<\/p>\n","protected":false},"author":2,"featured_media":233,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[47,35,46],"class_list":["post-39","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-best-practice","tag-concepts","tag-cqrs"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/posts\/39","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=39"}],"version-history":[{"count":1,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/posts\/39\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/posts\/39\/revisions\/40"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=\/wp\/v2\/media\/233"}],"wp:attachment":[{"href":"https:\/\/codeblog.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=39"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeblog.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}