cqrs

Domain Driven Design, Domain objects, attitude about Setters

醉酒当歌 提交于 2019-11-27 22:13:19
问题 Been watching some Greg Young videos lately and I'm trying to understand why there is a negative attitude towards Setters on Domain objects. I thought Domain objects were supposed to be "heavy" with logic in DDD. Are there any good examples online of the bad example and then they way to correct it? Any examples or explanations are good. Does this only apply to Events stored in a CQRS manner or does this apply to all of DDD? 回答1: I'm contributing this answer to complement Roger Alsing answer

CQRS sagas - did I understand them right?

大憨熊 提交于 2019-11-27 20:34:23
问题 I'm trying to understand sagas , and meanwhile I have a specific way of thinking of them - but I am not sure whether I got the idea right. Hence I'd like to elaborate and have others tell me whether it's right or wrong. In my understanding, sagas are a solution to the question of how to model long-running processes . Long-running means: Involving multiple commands, multiple events and possibly multiple aggregates. The process is not modeled inside one of the participating aggregates to avoid

How do I handle nested API responses in a Flux application?

烂漫一生 提交于 2019-11-27 16:40:48
问题 I'm porting an existing app to Flux and I'm a bit confused about one topic. Say I have several API endpoints that return two- or three-level nested objects. For example, GET /articles may return a JSON response of schema articles: article* article: { author: user, likers: user* primary_collection: collection? collections: collection* } collection: { curator: user } As you see, there are all kinds of users at different levels of nesting: articles[i].author articles[i].likers[i] articles[i]

ENode 1.0 - 整体架构介绍

蓝咒 提交于 2019-11-27 12:38:40
前言 今天是个开心的日子,又是周末,可以安心轻松的写写文章了。经过了大概3年的DDD理论积累,以及去年年初的第一个版本的 event sourcing 框架的开发以及项目实践经验,再通过今年上半年利用业余时间的设计与开发,我的enode框架终于可以和大家见面了。 自从Eric Evan提出DDD领域驱动设计以来已经过了很多年了,现在已经有很多人在学习或实践DDD。但是我发现目前能够支持DDD开发的框架还不多,至少在国内还不多。据我所知道的java和.net平台,国外比较有名的有:基于java平台的是 axon framework ,该框架很活跃,作者也很勤奋,该框架已经在一些实际商业项目中使用了,算比较成功;基于.net平台的是 ncqrs ,该框架早起比较活跃,但现在没有发展了,因为几乎没人在维护,让人很失望;国内有:banq的 jdon framework 可以支持 DDD+CQRS+EventSourcing的 开发,但是它是基于java平台的,所以对于.net平台的人,没什么实际用处;.net平台,开源的主要就是园子里的晴阳兄开发的 apworks 框架。晴阳兄在DDD方面,在国内的贡献很大,写了很多DDD系列的文章,框架和案例并行,很不错。当然,我所关注的紧紧是c#和java语言的框架,基于scala等其他语言实现的框架也有很多,这里就不一一例举了。

CQRS events do not contain details needed for updating read model

自闭症网瘾萝莉.ら 提交于 2019-11-27 11:41:18
问题 There is one thing about CQRS I do not get: How to update the read model when the raised event does not contain the details needed for updating the read model. Unfortunately, this is a quite common scenario. Example: I add a user to a group, so I send a addUserToGroup(userId, groupId) command. This is received, handled by the command handler, the userAddedToGroup event is created, stored and published. Now, an event handler receives this event and the both IDs. Now there shall be a view that

CQRS: Storing events and publishing them - how do I do this in a safe way?

寵の児 提交于 2019-11-27 10:01:20
问题 As I've learned in Why is the CQRS repository publishing events, not the event store? it's the CQRS repository's task to publish events. So far, so good. Of course, storing the events and publishing them should be within one single transaction. Technically this means writing one (or more) records to the store, and publishing one (or more) events to a message bus. Hence, a simple database transaction is not enough, it should be a distributed one. Now, unfortunately, many NoSQL databases (such

Why are commands and events separately represented?

核能气质少年 提交于 2019-11-27 09:56:03
问题 What is the difference between commands and events in architectures that emphasize events? The only distinction I can see is that commands are usually sourced/invoked by actors outside the system, whereas events seem to be sourced by handlers and other code in a system. However, in many example applications I have seen, they have different (but functionally similar) interfaces. 回答1: Commands can be rejected. Events have happened. This is probably the most important reason. In an event-driven

Domain queries in CQRS

本小妞迷上赌 提交于 2019-11-27 09:22:11
问题 We are trying out CQRS. We have a validation situation where a CustomerService (domain service) needs to know whether or not a Customer exists. Customers are unique by their email address. Our Customer repository (a generic repository) only has Get(id) and Add(customer). How should the CustomerService find out if the Customer exists? 回答1: Take a look at this blog post: Set based validation in the CQRS Architecture. It addresses this very issue. It's a complex issue to deal with in CQRS. What

Domain Validation in a CQRS architecture

自闭症网瘾萝莉.ら 提交于 2019-11-27 09:07:31
问题 Danger ... Danger Dr. Smith... Philosophical post ahead The purpose of this post is to determine if placing the validation logic outside of my domain entities (aggregate root actually) is actually granting me more flexibility or it's kamikaze code Basically I want to know if there is a better way to validate my domain entities. This is how I am planning to do it but I would like your opinion The first approach I considered was: class Customer : EntityBase<Customer> { public void ChangeEmail

CQRS Examples and Screencasts [closed]

天涯浪子 提交于 2019-11-27 08:57:58
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm looking for some in depth end-to-end CQRS examples with a reasonable set of unit tests. Also, if anyone knows of some CQRS