是 Asp.Net MVC + CSLA + DDD 可能

发布于 2024-07-18 07:31:51 字数 460 浏览 6 评论 0原文

前几天,我被要求审查一个基于 ASP.NET MVC + CSLA + DDD(域驱动设计)的系统。 该系统的第一个版本是基于ASP.NET MVC + CSLA。 第二个版本是在此基础上添加了 DDD。 原因是……嗯,我不知道是什么。 当我查看两种不同架构的图表时,很明显第二个版本极其复杂。 CSLA 对象基本上使用Domain 对象。 当你看到这样的东西时,你知道它已经闻起来很臭了,但很难证明为什么有人不应该这样做,除非 A) 对所有主题都有深入的了解,或者 B) 长期使用它。 对于这个主题,我没有这些,但我知道如果我从头开始构建它,我就不会这样做,我接触的很多开发人员也不会这样做。

那么,亲爱的读者,遇到这种情况你会怎么做? 我的想法是,如果您想使用 CSLA、MVC 和 DDD,那么您就表明立场并选择其中之一(CSLA 或 DDD)。 如果你不这样做,厨房里就有太多厨师了。

如果您对此事有意见,请发表一些见解。

I was asked to review a system the other day that was based on ASP.NET MVC + CSLA + DDD (domain drive design). The first version of this system was based on ASP.NET MVC + CSLA. The second release was based on that plus added DDD. The reason is because..... well, I don't know what. As I looked at the diagrams from the two different architectures, it was pretty apparent that the second version was extremely more complex. The CSLA objects basically used the Domain objects. When you see something like this you know it already smells but it is hard to justify why someone shouldn't do it this way without A) having extreme knowledge of all topics or B) using it for a long time. I have neither of these for this topic but I know if I'd built this from scratch I wouldn't have done it this way, nor wouldn't a lot of developers I associate with.

So, dear reader, what would you do in this situation? My thoughts are that if you want to use CSLA and MVC and DDD then you make a stand and chose one or another (CSLA or DDD). If you don't there are too many cooks in the kitchen.

Please shed some insight if you have opinions on this matter.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

吹泡泡o 2024-07-25 07:31:51

我的想法是,如果你愿意
使用 CSLA 和 MVC 和 DDD 然后你就可以了
一个立场并选择一个或另一个(CSLA
或DDD)。 如果你不这样做,也有
厨房里有很多厨师。

我倾向于同意你的观点。 如果有人想使用已经推出的 DDD 友好架构 + 支持框架来进行 DDD,我建议 S#arp 架构< /a> 通过 CSLA。

尽管如此,有些人认为可以使用 CSLA 来承担 DDD 的某些方面。 显然,DDD 纯粹主义者可能会对这种前景感到畏缩,但你不必成为纯粹主义者才能从 DDD 中获得一些东西。 Derick Bailey 有一个关于该主题的有趣博客: http: //www.avocadosoftware.com/csblogs/dredge/archive/2007/02/19/687.aspx

My thoughts are that if you want to
use CSLA and MVC and DDD then you make
a stand and chose one or another (CSLA
or DDD). If you don't there are too
many cooks in the kitchen.

I tend to agree with you there. If someone wants to do DDD with an already flushed out DDD friendly architecture + supporting frameworks, I'd recommend S#arp Architecture over CSLA.

That being said, some people feel it is possible to take on some of the aspects of DDD using CSLA. Obviously a DDD purist would probably cringe at that prospect, but you don't have to be a purist to gain something from DDD. Derick Bailey has an interesting blog regarding the topic: http://www.avocadosoftware.com/csblogs/dredge/archive/2007/02/19/687.aspx

残疾 2024-07-25 07:31:51

在我看来,CSLA 的最新版本是搬起石头砸自己的脚。 意见不同,但在我的书中,当一个对象必须知道它是否是一个孩子时,这是错误的。

In my opinion, CSLA shot itself in its foot with the latest version. Opinions differ, but it's so wrong, in my book, when an object has to know if it is a child or not.

甲如呢乙后呢 2024-07-25 07:31:51

似乎有些人发现 CSLA 和 DDD / Alt.Net 并不完全是交叉目的。

我仍然同意,如果你决定要走一条更纯粹、更不务实的道路,你可能需要做很多工作来适应洛基所做的出色工作,正如基思所建议的那样,这可能是如果你不小心的话,很容易造成混乱。

一些进一步的信息:

通过 CSLA.NET 使用依赖注入< /a>

将存储库模式与 CSLA.NET 结合使用< /a>

Rocky 为什么他致力于构建一个“务实”框架

It seems that some people out there are finding that CSLA and DDD / Alt.Net are not entirely a cross-purposes.

I'd still agree that you probably have quite a bit of work to do to adapt the good work that Rocky has done if you decide that you want to follow a more purist and less pragmatic path, and as Keith has suggested, it could be easy to just create a mess if you're not careful.

Some further info:

Using Dependency Injection with CSLA.NET

Using the Repository Pattern with CSLA.NET

Rocky on why he's committed to building a 'pragmatic' framework

灯角 2024-07-25 07:31:51

我不确定根据记忆使用 ActiveRecord 方法的 CSLA 是否特别适合 DDD。 使用 nHibernate 效果更好。

I am not sure CSLA which from memory uses an ActiveRecord approach is particularly suited to DDD. Better off with nHibernate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文