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. 前言 之前一直看别人的源码,虽然对自己提升比较大,但毕竟不是自己写的,很容易遗 ...
随机推荐
- Go 语言如果按这样改进,能不能火过 Java?
据 InfoWorld 消息,为改进 Go 语言的开发工具,Go 可能会获得自己的语言服务器,类似于 Microsoft 和 Red Hat 的语言服务器协议. 消息是从 Go 语言开发者的讨论组中流 ...
- Bootstrap 图片形状
@{ Layout = null;}<!DOCTYPE html><html><head> <meta name="viewport&q ...
- delphi中WebBrowser的parent改变时变成空白问题的解决(覆盖CreateWnd和DestroyWnd)
这段时间在做一个delphi界面打开网页的功能,且此网页所在窗口可完整显示,可缩小到另一个窗口的panel上显示 可是在改变网页所在窗口时,WebBrowser控件变成了空白 上网google了半天, ...
- C# API 获取系统DPI缩放倍数跟分辨率大小
原文:C# API 获取系统DPI缩放倍数跟分辨率大小 using System; using System.Drawing; using System.Runtime.InteropServices ...
- .NET与 java通用的3DES加密解密方法
C#代码 private void button1_Click(object sender, EventArgs e) { string jiami = textBox1.Text; textBox2 ...
- Hive-分组之后取前n个
1. 统计国家每个省份出现次数最高的5个城市的名称 直观思维来考虑: 把 数据组织成: 国家 省份 出现次数(倒序) 城市 row_number() 根据partition by 生 ...
- Win10《芒果TV - Preview》官方指定预览版 - 重要使用注意事项
Win10<芒果TV - Preview>官方指定预览版,最新的改进和功能更新将会此版本优先体验. 重要使用注意事项: 1.因为方便过审核,默认将会员相关的操作提示简化: 2.使用中务必手 ...
- OpenDJ Roadmap
Roadmap https://wikis.forgerock.org/confluence/display/OPENDJ/OpenDJ+Roadmap Forum https://forum.for ...
- 浅谈浏览器http的缓存机制 good
http://www.cnblogs.com/vajoy/p/5341664.html
- Color gradient in Delphi FireMonkey
Introduction to color gradients in Delphi FireMonkey. Video This video covers the basics of color gr ...