Ian Cooper 的个人资料Staccato Signals日志列表 工具 帮助
5月22日

The problem with archetype patterns and MDA

I'm reading Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and MDA. I picked this up partially because one of the databases at my current gig has been heavily influenced by some of the ideas here - especially the party archetype.

First, I want to be positive: if you are looking for a discussion around some of the problems you will hit when designing a solution to representing contacts, products,orders, rules etc. then as analysis patterns some useful learning has been captured here. As an example, the discussion on how to build products that support the open-closed principle (OCP) and are open for extension and closed for modification is useful and captures valuable knowledge. To be fair to the authors they do note that you can use the book as just that.

However the book pitches itself as differing from Fowler's Analysis Patterns in that it suggests that the archetypes it provides are not just patterns, but templates for tooling to generate code, specifically:

"Is sufficiently detailed to feed into the Model Driven Architecture (MDA) development workflow as a platform-independent model (PIM)".

The archetype patterns, that are intended as suitable sources for generation, are necessarily defined in terms of state, not in behaviours, because the behaviour will differ from application to application. Indeed the book says:

"As a general rule, Parties have no interesting behavior—they simply hold information. This is an important point to grasp because it makes the Party reusable across many different business domains. If you were to add significant amounts of behavior to the Party, or to any of its subclasses, this behavior might be appropriate for some domains but not for others. Your best strategy, therefore, is to treat the different types of Party mostly as passive data stores and to allow other things to act upon them."

Whoa there! Surely the authors recognize the smell here - this is structured programming not Object-Oriented programming. We are talking about seperation of state and behaviour. This seems to be a problem for archetype patterns - state and behaviour need to be seperated to create a generic template that we can use to stamp new instances out for new domains, because behaviour is unknown to the archetype author.

The difficulty of extracting a design from one domain and using it in another is a big one. Successful re-use seems to be where the domain remains the same. It seems to be very hard, perhaps impossible, to write clean code that is reusable when you decide to shift domains. The authors do note this objection:

"Sometimes a specific model of something, such as a model of products, may be suitable for use in one business area but not in another. This is what we refer to as the principle of variation: different business domains often seem to require different models of the same thing.

This principle just seems to be a fact of life. Often there is no way around it even if you choose to make some modeling compromises.

Because of variation, the construction of generic, highly reusable object models, such as enterprise object models, has proven to be rather difficult. You may even have heard some pundits say that such activities have failed and are, in principle, impossible."

I do not support the author's contention that simply seperating state from behaviour is an adequate solution to the problem; sure, you can shift the archetype between domains now - but only because it no longer does anything useful. Any code that you add to work with the passive data structure will not be 'clean' OO code. So we have sacrificed design for the ability to create a PIM usable with code generation.  But how much work has that actually saved us when our requirement is likely demand behaviour as well as state. In addition when we do not design our software through its behaviour we may end up with inappropriate data structures for our actual behaviours. Adding the behaviour to a generated artefact increases the likelihood that we will have speculative generality or over-complexity in our code derived from other domains that the model needs to support. The authors do express that the archetype can be morphed to the requirements of the domain for generation, but what drives those requirements if its not expression of that behaviour in the first place. While I tend to think that Behaviour Driven Development is really just a 'best practice' for Test Driven Development, their focus on behaviour does highlight that good OO design is about behaviour not about state.



评论 (3)

请稍候...
很抱歉,您输入的评论太长。请缩短您的评论。
您没有输入任何内容,请重试。
很抱歉,我们当前无法添加您的评论。请稍后重试。
若要添加评论,需要您的家长授予您相应权限。请求权限
您的家长禁用了评论功能。
很抱歉,我们当前无法删除您的评论。请稍后重试。
您已超过了一天之内允许提供的评论数上限。请在 24 小时后重试。
因为我们的系统表明您可能在向其他用户提供垃圾评论,您的帐户已禁用了评论功能。如果您认为我们错误地禁用了您的帐户,请联系 Windows Live 支持部门
完成下面的安全检查,您提供评论的过程才能完成。
您在安全检查中键入的字符必须与图片或音频中的字符一致。

若要添加评论,请使用您的 Windows Live ID 登录(如果您使用过 Hotmail、Messenger 或 Xbox LIVE,您就拥有 Windows Live ID)。登录


还没有 Windows Live ID 吗?请注册

http://www.topbattery.com.au/dell/latitude-d531.htm dell latitude d531 battery
http://www.topbattery.com.au/dell/d9200.php Notebook Laptop Battery for Dell D9200 D5318 G5260 laptop battery ,
http://www.topbattery.com.au/dell/inspiron-1200.htm dell inspiron 1200 battery
http://www.topbattery.com.au/toshiba/satellite-p200.htm toshiba satellite p200 battery
http://www.topbattery.com.au/toshiba/satellite-p205.htm toshiba satellite p205 battery
http://www.topbattery.com.au/toshiba/pa3534u-1brs.htm toshiba pa3534u-1brs battery
http://www.topbattery.com.au/toshiba/satellite-a205.htm toshiba satellite a205 battery
http://www.topbattery.com.au/toshiba/satellite-a100.htm toshiba satellite a100 battery
http://www.topbattery.com.au/toshiba/satellite-a105.htm toshiba satellite a105 battery
http://www.topbattery.com.au/toshiba/satellite-a80.htm toshiba satellite a80 battery
http://www.topbattery.com.au/toshiba/satellite-m110.htm toshiba satellite m110 battery
http://www.topbattery.com.au/acer/travelmate-4200.htm acer travelmate 4200 battery ,
http://www.topbattery.com.au/dell/inspiron-1100-series.htm dell inspiron 1100 series battery ,
http://www.topbattery.com.au/toshiba/satellite-a205.htm toshiba satellite a205 battery
http://www.topbattery.com.au/acer/3ur18650y-2-qc236.htm acer 3ur18650y-2-qc236 battery
http://www.topbattery.com.au/asus/904ha.htm asus 904ha battery
http://www.topbattery.com.au/hp/b2800.htm hp b2800 battery
http://www.topbattery.com.au/hp/a32.htm hp a32 battery
http://www.topbattery.com.au/hp/m9.htm hp m9 battery
http://www.topbattery.com.au/toshiba/pa3331u-1brs.htm toshiba pa3331u-1brs battery
http://www.topbattery.com.au/toshiba/pa3331u-1bas.htm toshiba pa3331u-1bas battery
http://www.topbattery.com.au/toshiba/satellite-m30.htm toshiba satellite m30 battery
http://www.topbattery.com.au/toshiba/pa3480u-1brs.htm toshiba pa3480u-1brs battery
http://www.topbattery.com.au/toshiba/p100.htm toshiba p100 battery
http://www.topbattery.com.au/toshiba/p105.htm toshiba p105 battery
http://www.topbattery.com.au/toshiba/pa3479u-1brs.htm toshiba pa3479u-1brs battery
http://www.topbattery.com.au/hp/4411.htm hp 4411 battery
11 月 7 日
名氏发表:
<a href="http://www.hongju168.com/">仓储货架|仓库货架|托盘|仓储笼</a> <a href="http://www.hongju168.com/1.html">仓储货架|仓库货架|托盘|仓储笼</a> <a href="http://www.hongju168.com/3.html">仓储货架|仓库货架|托盘|仓储笼</a> <a href="http://www.hongju168.com/4.html">仓储货架|仓库货架|托盘|仓储笼</a> <a href="http://www.hongju168.com/2.html">轻型仓储货架|轻量型仓库货架|库房货架</a> <a href="http://www.hongju168.com/2.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-2.html">中量型仓储货架|中量A型仓库货架|库房货架</a> <a href="http://www.hongju168.com/2-2.html ">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-3.html">中量型仓储货架|中量B型仓库货架|库房货架</a> <a href="http://www.hongju168.com/2-3.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-4.html">横梁式仓库货架|重型仓储货架|货位式库房货架</a> <a href="http://www.hongju168.com/2-4.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-5.html">模具货架|抽屉式仓库货架|仓储货架|库房货架</a> <a href="http://www.hongju168.com/2-5.html ">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-6.html">贯通式仓储货架|通廊式仓库货架|驶入式库房货架</a> <a href="http://www.hongju168.com/2-6.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-7.html">悬臂式仓储货架|仓库货架|库房货架</a> <a href="http://www.hongju168.com/2-7.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-8.html">阁楼式仓储货架|仓库货架|库房货架|钢平台</a> <a href="http://www.hongju168.com/2-8.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-9.html">流利式仓储货架|仓库货架|库房货架|辊轮式货架|自滑式货架</a> <a href="http://www.hongju168.com/2-9.html">货架厂|货架公司|南京货架</a> <a href="http://www.hongju168.com/2-10.html">工作台|工作桌</a> <a href="http://www.hongju168.com/2-11.html">工具柜|工具车</a> <a href="http://www.hongju168.com/2-12.html">托盘|塑料托盘|钢托盘|铁托盘|钢制托盘</a> <a href="http://www.hongju168.com/2-13.html">仓储笼|仓库笼|折叠式仓储笼|蝴蝶笼</a> <a href="http://www.hongju168.com/2-14.html">周转箱|塑料周转箱</a> <a href="http://www.hongju168.com/2-15.html">静音手推车|铁板手推车|购物手推车|登高车</a> <a href="http://www.hongju168.com/2-16.html">手动液压托盘搬运车|不锈钢搬运车|电子秤搬运车</a> <a href="http://www.hongju168.com/2-16.html">高起升搬运车|电动搬运车|平台车</a> <a href="http://www.hongju168.com/2-16.html">手动液压堆高车|手动液压堆垛车|半电动堆垛车</a> <a href="http://www.hongju168.com/2-16.html">全电动堆垛车|油桶搬运车|圆桶搬运车|油桶装卸车|</a> <a href="http://www.hongju168.com/2-16.html">柴油内燃平衡重式叉车|电动平衡重式叉车</a> <a href="http://www.hongju168.com/2-16.html">液压升降机|剪叉式高空作业平台|固定式蹬车桥</a> <a href="http://www.hongju168.com/2-17.html">文件柜</a> <a href="http://www.hongju168.com/2-18.html">不锈钢制品</a> <a href="http://www.hongju168.com/2-19.html">零件盒|零件柜</a> <a href="http://www.njhongju.cn">折叠式仓储笼|仓库笼</a> <a href="http://www.njhongju.cn">钢托盘</a> <a href="http://www.njhongju.cn">钢制料箱</a> <a href="http://www.njhongju.cn">堆垛架</a> <a href="http://www.njhongju.cn">物流台车</a> <a href="http://www.njhongju.cn">手推车</a> <a href="http://www.njhongju.cn/index.htm">钢托盘</a> <a href="http://www.njhongju.cn/index.htm">折叠式仓储笼|仓库笼</a> <a href="http://www.njhongju.cn/hj1.htm">折叠式仓储笼|仓库笼</a> <a href="http://www.njhongju.cn/hj2.htm">钢托盘|钢制托盘|铁托盘|金属托盘|镀锌托盘</a> <a href="http://www.njhongju.cn/hj3.htm">堆垛架|巧固架</a> <a href="http://www.njhongju.cn/hj4.htm">钢制料箱</a> <a href="http://www.njhongju.cn/hj5.htm">物流台车|载物台车</a> <a href="http://www.njhongju.cn/stc.htm">手推车|静音手推车</a> <a href="http://www.njhongju.cn/stc1.htm">手推车|静音手推车</a> <a href="http://www.njhongju.cn/index1.htm">仓储笼|钢托盘|钢制料箱|堆垛架|物流台车|手推车</a> <a href="http://www.njhongju.cn/index2.htm">仓储笼|钢托盘</a> <a href="http://www.njhongju.cn/index4.htm">仓储笼</a>
3 月 13 日
11 月 18 日

引用通告

此日志的引用通告 URL 是:
http://iancooper.spaces.live.com/blog/cns!844BD2811F9ABE9C!382.trak
引用此项的网络日志