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. 前言 之前一直看别人的源码,虽然对自己提升比较大,但毕竟不是自己写的,很容易遗 ...
随机推荐
- MVC 用基架创建Controller,通过数据库初始化器生成并播种数据库
1 创建MVC应用程序 2 在Model里面创建实体类 using System; using System.Collections.Generic; using System.Linq; using ...
- 待修 Bug
# 乱码 ## 描述 环境:Tomcat 8 + Spring 4 + Spring Security. 问题描述: 在类 AbstractAnnotationConfigDispatcherServ ...
- WPF中任意Object的XAML代码格式化输出
原文:WPF中任意Object的XAML代码格式化输出 有时候,我们需要将WPF中的控件自身的XAML代码输出成文本,那么,我们可以使用System.Windows.Markup.XamlWriter ...
- redis入门笔记(3)
本篇文章介绍几个redis的应用场景. 1.取最新N个数据的操作 –比如典型的取你网站的最新文章,通过下面方式,我们可以将最新的5000条评论的ID放在Redis的List集合中,并将超出集合部分从数 ...
- Android零基础入门第45节:GridView简单使用
原文:Android零基础入门第45节:GridView简单使用 前面一共用了8期来学习ListView列表的相关操作,其实学习的ListView的知识完全适用于AdapterView的其他子类,如G ...
- Vm安装
说明:都是默认安装,并不需要繁琐设置,所以没有文字说明
- Qt文档系统分析(解释Qt文档的生成工具与过程)
写在前面 只要打开Qt Assistant或Qt Creator的Help,或是打开在线版的 http://doc.qt.nokia.com ,Qt的漂亮的文档就会呈现在我们眼前.而且 Qt的文档,长 ...
- PowerDesigner逆向工程导入MYSQL数据库总结(不容易,感谢前者们)
原文:PowerDesigner逆向工程导入MYSQL数据库总结(不容易,感谢前者们) 参考来源: http://blog.csdn.net/chamtianjiao/article/details/ ...
- ML:吴恩达 机器学习 课程笔记(Week7~8)
Support Vector Machines Unsupervised Learning Dimensionality Reduction
- C# ACCESS 查询提示“至少一个参数没有被指定”问题
错误的SQL指令如下: sqlStr = “select * from tb_userInfo where userName=” + userName; //错误的 sql 指令 正确的SQL ...