Anemic Model
In object-oriented programming, and especially in Domain-Driven Design, objects are said to be anemic if they have state but lack behavior.
Some kinds of objects, such as Data Transfer Objects (DTOs), are expected to simply be a collection of data.
However, the objects that model the behavior of the problem space within the application should use encapsulation to manage their internal state and behavior.
An anemic model frequently fails to follow the Tell, Don’t Ask principle, since objects cannot perform operations on their own state, but are constantly manipulated by other objects in a non-object-oriented fashion.
Rich domain models provide useful behavior to clients within the system.
Some code smells that may indicate an anemic domain model include exposed collection properties, and over-use of properties in general (especially setters).
Anemic Model的更多相关文章
- .net架构设计读书笔记--第三章 第9节 域模型实现(ImplementingDomain Model)
我们长时间争论什么方案是实现域业务领域层架构的最佳方法.最后,我们用一个在线商店案例来说明,其中忽略了许多之前遇到的一些场景.在线商店对很多人来说更容易理解. 一.在线商店项目简介 1. 用例 ...
- Asp.net设计模式笔记之三:业务逻辑层的组织
本章内容要点: 1.Transaction Script模式组织业务逻辑 2.Active Record模式和Castle Windsor来组织业务逻辑 3.Domain Model模式来组织业务逻辑 ...
- 后端开发实践系列之二——领域驱动设计(DDD)编码实践
Martin Fowler在<企业应用架构模式>一书中写道: I found this(business logic) a curious term because there are f ...
- 领域驱动设计(DDD)编码实践
写在前面 Martin Fowler在<企业应用架构模式>一书中写道: I found this(business logic) a curious term because there ...
- DDD总览
DDD总览 领域驱动设计(DDD)编码实践 目录 写在前面DDD总览实现业务的3种常见方式基于业务的分包领域模型的门面——应用服务业务的载体——聚合根实体 vs 值对象聚合根的家——资源库创生之柱 ...
- CQRS与Event Sourcing之浅见
引言 DDD是近年软件设计的热门.CQRS与Event Sourcing作为实施DDD的一种选择,也逐步进入人们的视野.围绕这两个主题,软件开发的大咖[Martin Fowler].[Greg You ...
- Spring Boot笔记一
Spring Boot 入门 Spring Boot 简介 > 简化Spring应用开发的一个框架:> 整个Spring技术栈的一个大整合:> J2EE开发的一站式解决方案: 微服务 ...
- 【疯狂造轮子-iOS】JSON转Model系列之二
[疯狂造轮子-iOS]JSON转Model系列之二 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 上一篇<[疯狂造轮子-iOS]JSON转Model系列之一> ...
- 【疯狂造轮子-iOS】JSON转Model系列之一
[疯狂造轮子-iOS]JSON转Model系列之一 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 之前一直看别人的源码,虽然对自己提升比较大,但毕竟不是自己写的,很容易遗 ...
随机推荐
- js的一些写法问题
尽量不要拼接字符,用自定义标签来完成 用winform的形式更佳
- MVC HttpUtility.HtmlEncode是如何编码的
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;us ...
- 消息队列中点对点与发布订阅区别(good)
背景知识 JMS一个在 Java标准化组织(JCP)内开发的标准(代号JSR 914).2001年6月25日,Java消息服务发布JMS 1.0.2b,2002年3月18日Java消息服务发布 1.1 ...
- JS 三个对话框
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...
- php获取一个月前的时间戳,获取三个月前的时间戳,获取一年前的时间戳
strtotime 非常强大的一个获取时间戳的函数 php获取一个月前的时间戳: strtotime("-0 year -1 month -0 day"); php获取三个月前的时 ...
- PostMessage和SendMessage有什么区别?(有EnumChildWindowsProc的例子)
PostMessage只是把消息放入队列,不管其他程序是否处理都返回,然后继续执行;而SendMessage必须等待其他程序处理消息后才返回,继续执行.PostMessage的返回值表示PostMes ...
- 获取bing图片并自动设置为电脑桌面背景(使用 URLDownloadToFile API函数)
众所周知,bing搜索网站首页每日会更新一张图片,张张漂亮(额,也有一些不合我口味的),特别适合用来做电脑壁纸. 我们想要将bing网站背景图片设置为电脑桌面背景的通常做法是: 上网,搜索bing 找 ...
- 程序的开机关机重启,开机启动,休眠功能delphi实现(使用AdjustTokenPrivileges提升权限)
TShutDownStatus = (sdShutDown,sdReboot,sdLogOff,sdPowerOff); procedure ShutDown(sdStatus : TShutDown ...
- 京东sdk商家上架接口调用问题总结
前言: 最近在做商家发布产品,调用京东sdk,发现问题很多,而且还是在我同事的帮助下完成的,摸索中,菜鸟还请高手门多多提携才好,入正题 首先是引用jd的sdk啦,京东sdk中发布商品需要调用一个 36 ...
- 取得文件夹内容信息(使用IShellFolder接口)
翻译自MSDN 2005 -> Win32 和 COM 开发 -> User Interface -> Windows User Experience -> Windows S ...