顺便说一下一个老帖子:http://www.blogjava.net/GandofYan/archive/2006/05/30/48954.html关于domain object的讨论,其中的领域逻辑用E-R建模来表示是这样的:
Bid的建立需要满足3个约束条件,仅此而已。
那个贴子中有这样一句 "this.getBids().add(newBid); 在没有Hibernate/JDO这类可以实现“透明的持久化”工具出现之前,这类domain logic是无法实现的"。事实上,如果采用E-R建模,这个问题压根就不存在,至少用这个例子来说明透明持久化(再说一遍透明持久化的本质是缓存)的优点是很不恰当的,Hibernate解决了一个它自已创造出来的问题,因为E-R建模不象对象建模一样存在一对多这个概念,不存在由一方来维护关联这个问题。一对多关联的本质是一方维护着一个内存缓存表(set,list,array,bag),在运行期默认要将多方载入这个缓存,结束时将缓存清空并刷新到数据库,这是一种提前的性能优化(利用二级缓存),可能造成性能问题(不必要的加载)和增加编程复杂性。好比“高三一班加入一名新生"用E-R概念来表述就是new Student("张三").setClass("高三一班"); 而用一对多关联表述就变成了getAllStudents("高三一班").add(new Student("张三")),问题是getAllStudents和加入新生这两个逻辑是不相干的,加入新生就必须getAllStudents? 未必。
分享到:
相关推荐
Domain Object领域模型学习、设计、分析资料,错过别后悔。
Unsupervised Domain Adaption of Object Detectors A Survey.zip
Unsupervised Domain Adaption of Object Detectors A Survey.pdf
A Survey on Deep Domain Adaptation and Tiny Object Detection Challenges, Techniques and Datasets.pdf
A Survey on Deep Domain Adaptation and Tiny Object Detection Challenges, Techniques and Datasets.zip
目标检测,机器学习
Cross-Domain Weakly-Supervised Object Detectio.pdf
深入理解ApplicationDomain和SecurityDomain
另一个是不会进行领域建模,关于领域建模争论已经很多了,我的观点是DDD很好,但不是银弹,用和不用取决于场景。但不管怎样,请你抛开偏见,好好的研读一下Eric Evans的《领域驱动设计》,如果有认知升级的感悟,...
失血模型简单来说,就是domain object只有属性的getter/setter方法的纯数据类,所有的业务逻辑完全由business object来完成(又称TransactionScript),这种模型下的domain object被Martin Fowler称之为“贫血的domain...
'Eric Evans has written a fantastic book on how you can make the design of your software match your mental model of the problem domain you are addressing. 'His book is very compatible with XP. It is ...
Wavelet Transform Domain Filters
Domain adaptation is one of the most challenging tasks of modern data analytics. If the adaptation is done correctly, models built on a specific data representation become more robust when confronted ...
Deep domain adaptation has emerged as a new learning technique to address the lack of massive amounts of labeled data. Compared to conventional methods, which learn shared feature subspaces or reuse ...
详细介绍ApplicationDomain和SecurityDomain的原理,想对这方面的知识做深入研究的可以看下
crossdomain.xml用于unity3d生成的webplayer不能读取数据库的问题,用于unity3d生成的webplayer不能读取数据库的问题
By the end of the book, you will learn to use other design patterns such as DSLs to extend DDD with object-oriented design base, and then get an insight into how to select the right scenarios to ...
-我们知道通常查询一个域名的归属时为了确保数据精确无误,往往要访问好几个 Whois 站点才能得到正确的数据,有了 Domain IP Locator,便可很轻松的实现一键查询!另外比较特别的一点是在进行 IP 检索时,如果目标...
Domain adaptation is an active, emerging research area that attempts to address the changes in data distribution across training and testing datasets. With the availability of a multitude of image ...