697 热度

A Fast and Lightweight Solution for CQRS and Event Sourcing

The purpose of this article is to present a fast and lightweight implementation of the CQRS+ES pattern using the C# programming language and the .NET Framework. This implementation is relatively full-featured, including support for SQL Server serialization of commands and events, scheduled commands, snapshots, sagas (i.e., process managers), and plug-and-play overrides for multitenant customization. I will describe how the code is structured, and illustrate how it works with a sample application.

收录时间: 2020-04-10
分类: 架构设计
贡献者: Rector
759 热度

Domain-Driven Design and Entity Framework Core

This article is about my experiences of applying a Domain-Driven Design (DDD) approach when working with Entity Framework Core (EF Core). I have now used DDD and my supporting libraries for two years on my own projects and client projects. Here are the bigger client projects where I used an DDD approach...

收录时间: 2020-04-07
分类: 架构设计
贡献者: Rector
1136 热度

How to create better code using Domain-Driven Design

How to create better code using Domain-Driven DesignHomepage>Blog>How to create better code using Domain-Driven Design 16/03/2020Business requirements The anemic enterprise cake Project structure Where is the business logic? Issues with the anemic domain model Anemic model Primitive obsession Reada...

收录时间: 2020-03-25
分类: 架构设计
贡献者: Rector
567 热度

CQRS

CQRS is a simple pattern that strictly segregates the responsibility of handling command input into an autonomous system from the responsibility of handling side-effect-free query/read access on the same system. If you are familiar with Domain-Driven Design, you’ve most likely heard about, Command-Query Responsibility Segregation (CQRS). Though the CQRS pattern is well-known, there are still a lot of misconceptions around this pattern, especially when it comes to applying it in real-world software projects. In this article, you will learn exactly what CQRS is, the principles behind it, and the benefits it can provide for your project.

收录时间: 2020-03-25
分类: 架构设计
贡献者: Rector
847 热度

Building microservices through Event Driven Architecture part11: Run Unit tests inside a docker container

This tutorial is the 11th part of a series : Building microservices through Event Driven Architecture. The previous step is about building microservices through Event Driven Architecture part10: Handling updates : https://logcorner.com/building-microservices-through-event-driven-architecture-part10-handling-updates-and-deletes/. In this tutorial, I will show how to run unit tests inside a docker container.

收录时间: 2020-03-10
分类: 架构设计
贡献者: Rector
1053 热度

如何运用领域驱动设计 - 领域事件

在实践领域驱动设计(DDD)的过程中,我们往往会遇到多个领域对象相互交互的情况。比如聚合根A在执行某操作之前需要得到聚合根B的某个信号(或某些数据)。如果在单体应用程序中,我们有条件和机会使得两者进行强引用来完成操作,但是这将直接打破领域驱动设计的规范,从而使得项目不可控,再次回到大泥球的开发。

收录时间: 2020-03-06
分类: 架构设计
贡献者: Rector
AD 友情赞助
760 热度

CQRS: Refactoring Queries without Repositories

This question posted on Twitter (and the subsequent thread) caught my attention. I had to pipe in with my own opinion on having queries without repositories. To summarize, the question is about using Aggregate Roots with an ORM like Entity Framework. Should you eager load all navigation properties or alternatively I guess, use lazy loading? My answer is if you’re only using an aggregate root for commands (to change state) and you generally have a higher read to write ratio, then eager load the navigation properties. As a general rule of thumb.

收录时间: 2020-03-06
分类: 架构设计
贡献者: Rector
831 热度

TDD & Agile

I never bought into the ‘agile will save us all’ philosophy that permeates the True Believers. It’s not because I don’t believe them — I do. Operating according to the agile manifesto is a step up. It’s a big step up. Scrum provides a framework for operating with agility, and I’ve been a part of organizations that were successful and had adopted Scrum.

收录时间: 2020-02-28
分类: 架构设计
贡献者: Rector
889 热度

A Brief Intro to Clean Architecture, Clean DDD, and CQRS

In this blog entry I give a primer on Clean Architecture, which is a modern, scalable formal software architecture which is appropriate for modern web applications. Next, I discuss how Domain-Driven Design fits into this picture, and how DDD concepts dovetail nicely into Clean Architecture, producing a methodology called Clean DDD. Finally, I introduce Command Query Responsibility Segregation (CQRS), and describe how it complements and enhances Clean DDD solutions to create software systems that are elegant, robust, scalable, and testable.

收录时间: 2020-02-22
分类: 架构设计
贡献者: Rector
833 热度

CQRS + Event Sourcing – Step by Step

A common issue I see is understanding the flow of commands, events and queries within a typical CQRS ES based system. The following post is designed to clear up what happens at each step. Hopefully this will help you to reason about your code and what each part does.

收录时间: 2020-02-22
分类: 架构设计
贡献者: Rector
683 热度

The Power of EventSourcing

We just had a nice experience while maintaining one of the applications we created for our customer and we wanted to share this with you! We are building a small ‘on-the-side’ project for a customer that supports the planing of a huge event with more than 1.500 guests. It's not in their major line of work and they use the application for about 1.5 months to organise the seating plan for their annual Company party. Together we decided that it’s OK to take some shortcuts during the implementation to reduce the overall effort.

收录时间: 2020-02-22
分类: 架构设计
贡献者: Rector
771 热度

Loosely Coupled Show: Software Architecture and Design

I’m excited to announce the Loosely Coupled Show, a new project I’m working on with James Hickey. Check out the YouTube Channeland subscribe!The premise is simple. To have discussions about software architecture and design. The target audience is intermediate to senior software developers.Episode...

收录时间: 2020-02-22
分类: 架构设计
贡献者: Rector
863 热度

Encapsulation Boundaries Large and Small

Writing any significantly complex software application involves the use of encapsulation boundaries and abstractions. Think about the smallest bit of executable code in your program: an expression or perhaps a statement. This typically maps roughly to a line of code. You can build entire applications using only this structure. If you do, they look something like this...

收录时间: 2020-01-30
分类: 架构设计
贡献者: Rector
945 热度

如何运用领域驱动设计 - 工作单元

在上一篇 《如何运用领域驱动设计 - 存储库》 的文章中,我们讲述了有关仓储的概念和使用规范。仓储为聚合提供了持久化到本地的功能,但是在持久化的过程中,有时一个聚合根中的各个领域对象会分散到不同的数据库表里面;又或者是一个用例操作需要操作多个仓储;而这些操作都应该要么同时成功,要么同时失败,因此就需要为这一系列操作提供事务的支持,而事务管理就是由工作单元来提供的。在上一篇中,可能已经提到了工作单元,但是仅仅是一笔带过,现在我们就来详细的探究该如何更好的来实现工作单元。(文章的代码片段都使用的是C#,案例项目也是基于 DotN...

收录时间: 2020-01-02
分类: 架构设计
贡献者: Rector
815 热度

驱动领域DDD的微服务设计和开发实战

你是否还在为微服务应该拆多小而争论不休?到底如何才能设计出收放自如的微服务?怎样才能保证业务领域模型与代码模型的一致性?或许本文能帮你找到答案。 本文是基于 DDD 的微服务设计和开发实战篇,通过借鉴领域驱动设计思想,指导微服务项目团队进行设计和开发(理论篇详见《当中台遇上 DDD,我们该如何设计微服务?》)。本文包括三部分内容:第一部分讲述领域驱动设计基本知识,包括:分层架构、服务视图、数据视图和领域事件发布和订阅等;第二部分讲述微服务设计方法、过程、模板、代码目录、设计原则等内容;最后部分以一个项目为例讲述基于 DDD 的微服务设计过程。

收录时间: 2019-12-30
分类: 架构设计
贡献者: Rector
AD 友情赞助
741 热度

高并发、高性能 Web 架构

文章介绍了典型的,三层架构的高性能 Web 应用架构,并对反向代理服务,应用层节点工作模型,Memcached 服务等做了详细的解释,希望能对您有所帮助。

收录时间: 2019-12-09
分类: 架构设计
贡献者: Rector
913 热度

大话设计,没有模式—通用权限设计与实现

当代码写多了,总有些是经验,但经验是什么呢?if…else用的次数比别人多?显然不是。有些超棒的设计可以谓之经验!功能权限网络上流行的经典的权限设计是【主体】- 【领域】 - 【权限】( who、what、how问题原型 ) 的设计思想,其中:【主体】可以是用户,可以是角色,也可以是一个部门【领域】可以是一个模块,可以是一个页面,也可以是页面上的按钮【权限】可以是“可见”,可以是“只读”,也可以是“可用”(如按钮可以点击)为了简化程序开发,在OpenAuth.Core中去掉了权限的控制,简化为【主体】- 【领域】的模式,且【主体】限定为角色。即只能给角色分配模块和按钮,不能直接分配给用户账号或...

收录时间: 2019-11-27
分类: 架构设计
贡献者: Rector
827 热度

如何设计一个本地缓存

最近在看Mybatis的源码,刚好看到缓存这一块,Mybatis提供了一级缓存和二级缓存;一级缓存相对来说比较简单,功能比较齐全的是二级缓存,基本上满足了一个缓存该有的功能;当然如果拿来和专门的缓存框架如ehcache来对比可能稍有差距;本文我们将来整理一下实现一个本地缓存都应该需要考虑哪些东西。考虑点考虑点主要在数据用何种方式存储,能存储多少数据,多余的数据如何处理等几个点,下面我们来详细的介绍每个考虑点,以及该如何去实现;1.数据结构首要考虑的就是数据该如何存储,用什么数据结构存储,最简单的就直接用Map来存储数据;或者复杂的如redis一样提供了多种数据类型哈希,列表,集合,有序集合...

收录时间: 2019-11-25
分类: 架构设计
贡献者: Rector
816 热度

Building microservices through Event Driven Architecture part9: Implementing EventSourcing on Application

This tutorial is the 9th part of a series : Building microservices through Event Driven Architecture. The previous step is about Building microservices through Event Driven Architecture part8: Implementing EventSourcing on Repositories : http://logcorner.com/building-microservices-through-event-driven-architecture-part7-implementing-eventsourcing-on-repositories/

收录时间: 2019-11-22
分类: 架构设计
贡献者: Rector
752 热度

缓存穿透、缓存击穿和缓存雪崩实践

我们使用缓存的主要目是提升查询速度和保护数据库等稀缺资源不被占满。而缓存最常见的问题是缓存穿透、击穿和雪崩,在高并发下这三种情况都会有大量请求落到数据库,导致数据库资源占满,引起数据库故障。

收录时间: 2019-11-05
分类: 架构设计
贡献者: Rector
AD 友情赞助