有界上下文的大小 [英] Size of a bounded context

查看:71
本文介绍了有界上下文的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始学习DDD的原理,目前正在尝试了解有限上下文的概念。尤其是,您如何确定必须多大(或小)?是的,我知道,越小越好,越大越好(根据沃恩·弗农的说法)。

I've started learning the principles of DDD and I'm currently trying to get a grasp of the concept of a bounded context. In particular, how do you decide just how big (or small) it has to be? Yeah, I know, as small as possible and as big as necessary (according to Vaughn Vernon).

让我们说我要为一个博客建模。然后,我可以说涉及3个有限的上下文:1)前页(以最近的文章为特色,没有显示评论)2)讨论(包括评论的单篇文章)3)Article Composer(我在其中撰写文章)。

Let's say I were to model a blog. I could then go and say there are 3 bounded contexts involved: 1) Front Page (featuring the most recent articles, no comments shown) 2) Discussion (a single article including comments) 3) Article Composer (where I compose an article).

但是,这并不对劲(所有语言的通用语言都是相同的),似乎我是从

However, this doesn't feel right (the ubiquitous language is the same for all of them), it seems as if I'm coming from a front end point of view and am still thinking in terms of view models or something.

有人可以指出正确的方向吗?

Could anyone please point me in the right direction?

推荐答案

尝试从不同的角度看待您的整个领域,作为文章的编辑者,您可能会使用诸如创建文章草稿,发布文章等文章的句子。作为读者,您将在示例中阅读文章并对其进行评论。除了建立域语言之外,您还将识别实体及其行为,其中某些实体只会以一种视角出现,某些实体会同时出现在两种视角中,但是您将通过它们的行为来区分它们。您的领域语言向您显示了每个视角的界限,它们是作为有界上下文实现的。

Try to look at your whole domain from different perspectives, as an editor of article, you probably will use sentences like creating a draft of an article, publishing an article, as an article a reader you will in example read article and comment on it. Alongside building your domain language you will identify entities and their behaviour, some of them will appear only in one perspective, some will appear in both, but you will distinct them by their behaviour. Your domain language shows you the boundries of each perspective, that you implement as a bounded contexts.

这篇关于有界上下文的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆