1388 热度

Domain-Driven Refactoring: Long Methods

Posts in this series:Intro;Procedural Beginnings;Long Methods. In the last post, I walked through the main, immediate code smell we saw of a long method, and I would classify this method as long...

收录时间: 2021-07-23
分类: 架构设计
贡献者: Rector
1657 热度

RabbitMQ和Kafka综合对比

消息队列中间件(简称消息中间件)是指利用高效可靠的消息传递机制进行与平台无关的数据交流,并基于数据通信来进行分布式系统的集成。 通过提供消息传递和消息排队模型,它可以在分布式环境下提供应用解耦、弹性伸缩、冗余存储、流量削峰、异步通信、数据同步等等功能,其作为分布式系统架构中的一个重要组件,有着举足轻重的地位。 目前开源的消息中间件有ActiveMQ、RabbitMQ、Kafka、RocketMQ、pulsar等,在整体架构中引入消息中间件,势必要考虑很多因素,比如成本及收益问题,怎么样才能达到最优的性价比?虽然消息中间件种类繁多,但是各自都有各自的侧重点,选择合适自己、扬长避短无疑是最好的方式。

收录时间: 2021-07-20
分类: 架构设计
贡献者: Rector
1510 热度

Domain-Driven Refactoring: Intro

A common theme in domain-driven design are design patterns. When you start learning about DDD, you'll be presented with many code-level concepts such as...

收录时间: 2021-06-04
分类: 架构设计
贡献者: Rector
1283 热度

Testing your Domain when Event Sourcing

How do you test your domain when Event Sourcing? I find testing aggregates with Event Sourcing to be simpler than testing if you’re storing the current state. The inputs to your aggregate are events and the output of your aggregate are events.

收录时间: 2021-05-21
分类: 架构设计
贡献者: Rector
1455 热度

Event Based Architecture: What do you mean by EVENT?

The term “Event” is really overloaded. There are many different utilities that leverage events. Event Sourcing, Event Carried State Transfer, and Event Notifications. None of these are for the same purpose. When talking about an Event Based architecture, realize which one you’re using and for what purpose.

收录时间: 2021-05-06
分类: 架构设计
贡献者: Rector
1560 热度

理解领域驱动设计

什么是领域,我习惯描述的是制药领域、环境领域、建筑领域、金融领域等,而在领域内,各种业务规则、业务知识盛行,如何有效的把控规则的变化,应对复杂知识,有一个很关键的四字词语,分而治之。分治法在很多场景下体现了其强大的作用力。领域本身很大,那就拆分,得到更小的领域,也即子域,如同递归调用一般,将一个复杂问题拆分单独求解,而最终将解汇总得到复杂问题解。怎么拆,拆成怎么样合适,依据什么拆,这些在领域驱动设计中有了一套答案,虽然领域驱动设计不是银弹,但可以说的上是一套极好的系统方法论或称为架构设计的方法论。领域驱动设计常以战略设计与战术设计来将整个领域展现的淋漓尽致,其作用范围既面向业务也面向技术...

收录时间: 2021-01-19
分类: 架构设计
贡献者: Rector
AD 友情赞助
2053 热度

CQRS与Event Sourcing之浅见

DDD是近年软件设计的热门。CQRS与Event Sourcing作为实施DDD的一种选择,也逐步进入人们的视野。围绕这两个主题,软件开发的大咖[Martin Fowler]、[Greg Young]、[Udi Dahan]分别有所论述,[MSDNC QRS Journey]、[Implementing DDD]、[Patterns, Principles, and Practices of DDD]等著述也提供了范例,国内外各大论坛的文章和DDD开源框架更是数不胜数,为学习CQRS和Event Sourcing提供了大量指导。其中,Greg Young的论文最为系统。故本文通过解读其论文,简单梳理了CQRS与Event Sourcing的发展脉络,厘出其中的主要技术重点,并提出以Akka作为落地方案,以求对这两个主题有一个较为全面的总结。错谬之处,还望指正。

收录时间: 2021-01-11
分类: 架构设计
贡献者: Rector
1886 热度

Modular Monolith: Domain-Centric Design

In previous posts in this series, I covered what a Modular Monolith is, what its architecture looks like and how this architecture can be enforced. Then I described architectural drivers for this architecture and styles of integration between modules. In this post I would like to go deeper – a level lower and describe how such architecture can be designed. We are not going to implement this architecture yet – we will focus on its technology-agnostic design.

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

CQRS Myths: 3 Most Common Misconceptions

Although Command Query Responsibility Segregation (CQRS) seems to be a term a lot of developers are aware of, I do think the majority have the wrong definition. Like many terms in the software development industry, things over time get confused, and then those confusing ideas propagate. These are the 3 CQRS Myths I see or hear the most often.

收录时间: 2020-11-05
分类: 架构设计
贡献者: Rector
2269 热度

Immediate Domain Event Salvation with MediatR

Domain events are one of my favorite patterns and one Julie Lerman and I cover in our DDD Fundamentals course, on Pluralsight. I differentiate between two kinds of domain events: pre-persistence and post-persistence. You'll find a good implementation of post-persistence domain events (using MediatR) in my Clean Architecture solution template. However, until recently, I hadn't built an immediate, pre-persistence implementation of domain events for .NET using MediatR. This is meant to follow a similar approach to Udi Dahan's classic static helper, which relied on StructureMap and static methods.

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

.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)

依赖倒置(Dependency Inversion Principle,缩写DIP)是面向对象六大基本原则之一。他是指一种特定的的解耦形式,使得高层次的模块不依赖低层次的模块的实现细节,依赖关系被颠倒(反转),从而使得低层次模块依赖于高层次模块的需求抽象.

收录时间: 2020-05-12
分类: 架构设计
贡献者: Rector
2270 热度

带你走进神一样的Elasticsearch索引机制

相比于大多数人熟悉的MySQL数据库的索引,Elasticsearch的索引机制是完全不同于MySQL的B+Tree结构。索引会被压缩放入内存用于加速搜索过程,这一点在效率上是完爆MySQL数据库的。但是Elasticsearch会对全部text字段进行索引,必然会消耗巨大的内存,为此Elasticsearch针对索引进行了深度的优化。在保证执行效率的同时,尽量缩减内存空间的占用。这篇文章就深度解析了Elasticsearch索引原理,揭开搜索的神秘面纱。更多精彩内容请看我的个人博客前言相比于大多数人熟悉的MySQL数据库的索引,Elasticsearch的索引机制是完全不同于MySQL的B+...

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

ElasticSearch专栏讲解(一)

ElasticSearch是一个用Java语言开发的分布式文档检索引擎。也支持文档存储功能,且不会将信息类似SQL存储为列数据,而是存储已序列化的JSON文档的复杂数据结构。而且ElasticSearch支持集群部署,当集群中有多个ElasticSearch节点时,存储的文档会分布在整个集群中,并且可以从任何节点立即访问。ElasticSearch是基于 Lucene 的搜索服务器,并且提供了标准的 RESTful web接口,作为 Apache 许可条款下的开放源码发布。

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

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
2300 热度

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
AD 友情赞助
2484 热度

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
1738 热度

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
1918 热度

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
2629 热度

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

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

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

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
AD 友情赞助