痔疮什么样子图片| 脓毒血症是什么原因引起的| 实质是什么意思| 一月四号是什么星座| 减肥期间早餐应该吃什么| 两个土念什么字| 甲状腺偏高有什么影响| 淋巴结肿大有什么症状| 皮包公司是什么意思| 种牙和假牙有什么区别| 白骨精什么意思| 落是什么生肖| 尿酸高是什么原因造成的| 阿胶不能和什么一起吃| 舌根部淋巴滤泡增生吃什么药| 尿酸高早餐吃什么| 食客是什么意思| 上呼吸道感染吃什么中成药| 眼睛散光是什么症状| 喷塑工是干什么的| iwc是什么牌子手表| 破冰是什么意思| 言谈举止是什么意思| 梦见大火是什么意思| 吃什么补蛋白最快| 汗疱疹吃什么药| 胎儿双顶径偏大是什么原因| 男怕初一女怕十五是什么意思| qcy是什么牌子| 蜘蛛痣长什么样| 什么的樱桃| 毓读什么| 脑血栓不能吃什么| 为什么喝酒后会头疼| 透析到什么程度会死亡| 秋千为什么叫秋千| 肌钙蛋白高说明什么| 1991年属羊是什么命| 滋阴潜阳是什么意思| Q什么意思| 点天灯是什么意思| 国家副主席是什么级别| 心形脸适合什么发型| 秋天是什么样子的| 靓仔是什么意思| 女性适合喝什么茶| 泡蛇酒用什么药材最好| 夫妻宫是什么意思| 摩登女郎是什么意思| 上颌窦炎吃什么药| 51岁属什么生肖| 粉底液是干什么用的| 蚂蚁最怕什么东西| 为什么受伤总是我| 沙门氏菌用什么药最好| 吃燕麦片有什么好处| 法尔如是是什么意思| 日值四离是什么意思| 你的美丽让你带走是什么歌| 玫瑰痤疮吃什么药| 怀孕初期吃什么| 为什么越睡越困| 天德合是什么意思| 姨妈痛吃什么药| 满月送孩子什么礼物好| 碉堡是什么意思啊| 狗为什么不死在家里| acu是什么意思| 井井有条是什么意思| 三点水开念什么意思| 专业组是什么意思| 游乐场都有什么项目| 生姜吃多了有什么害处| 热惊厥病发是什么症状| 什么东西不能带上飞机| 恶风是什么意思| 身上发抖是什么原因| 双鱼座什么性格| 跟腱炎挂什么科| 裂纹舌是什么原因| 小狗打什么疫苗| 沉香有什么好处| 胰腺钙化灶是什么意思| 69年出生属什么| 纳差是什么症状| 肠道易激惹综合征的症状是什么| 华在姓氏里读什么| 病毒性感冒吃什么药效果好| 外子是什么意思| 肛门坠胀用什么药| 艾灸脚心有什么好处| 梦见黑蛇是什么预兆| 皮肤瘙痒吃什么药| 大便拉不干净是什么原因| 白虎女是什么意思| 越南人说什么语言| 医院特需号是什么意思| 为什么上小厕会有刺痛感| 胃寒吃什么食物暖胃| 什么炒鸡蛋最好吃| 鬼迷心窍什么意思| 经期吃什么好| 2型糖尿病吃什么药降糖效果好| 肚脐左侧是什么器官| 龚是什么意思| kumpoo是什么牌子| 白带发黄是什么原因引起的| 股骨头疼痛吃什么药| 微波炉不能用什么容器| 双排是什么意思| 上午12点是什么时候| hpv病毒是什么病毒| 什么病不能吃西洋参| 突兀什么| 8月底是什么星座| 小便短赤什么意思| 妊高症是什么意思| 此生不换什么意思| 妇科千金片和三金片有什么区别| 梦见杀牛是什么预兆| 什么的飞机| 沉迷是什么意思| siemens是什么品牌| 2028是什么年| 红头文件是什么意思| 23数字代表什么意思| 指甲有竖纹是什么原因| 做腋臭手术挂什么科室| 拔指甲挂什么科| 脑内腔隙灶是什么意思| rebecca什么意思| 老是嗜睡是什么原因| 沉香有什么作用| 花儿为什么这样红简谱| 正司级是什么级别| 热得什么填空| 格桑花什么时候开花| 肾结石吃什么水果好| 壬午五行属什么| 消肿吃什么药| 脸上有痣去医院挂什么科| 厅局级是什么级别| 医生五行属什么| 急性化脓性扁桃体炎吃什么药| 花中之王是什么花| 潇字五行属什么| 做梦梦见下大雨是什么意思| 美平是什么药| 刑事拘留意味着什么| 淋巴结钙化是什么意思| 肚子胀气什么原因| 西洋参跟花旗参有什么区别| 脚气挂什么科室| 压床是什么意思| 包皮嵌顿是什么| 汗疱疹用什么药膏| 吕布属什么生肖| 为什么晚上睡觉老是做梦| 欲壑难填什么意思| 老是打嗝是什么原因| 股骨头疼痛什么原因| 软组织密度影什么意思| electrolux是什么牌子| 9月10日什么星座| 桃子吃了有什么好处| 13岁属什么| 为什么减肥一直减不下来| 运营商是什么意思| 四月十七是什么星座| 九月初四是什么星座| 卵泡刺激素是什么意思| 三百多分能上什么大学| 0l是什么意思| 什么叫多重耐药菌| 手术后能吃什么| 相破是什么意思| 捞女什么意思| 什么时候可以领退休金| 酒糟是什么| 赤脚走路有什么好处| 蓝莓有什么作用| 脖子皮肤黑是什么原因| 养胃喝什么茶| york是什么牌子| 什么扑鼻| 玉兰花什么季节开| 家庭烧烤准备什么食材| 粉刺是什么样的图片| 猕猴桃不能和什么一起吃| 什么水果含维c最多| 苏打水喝了有什么好处| 尿白细胞弱阳性什么意思| 小孩急性肠胃炎吃什么药| 少一个肾有什么影响| 天使综合征是什么病| 阴道炎什么症状| premier是什么牌子| 豆腐和什么不能一起吃| 尿酸高吃什么中药能降下来| 吃什么主食减肥最快| 地位是什么意思| 机翻是什么意思| haglofs是什么牌子| 耄耋读什么| 丁克夫妻是什么意思| perrier是什么水| 身上老是痒是什么原因| 腐女是什么| 远在天边近在眼前是什么意思| 甲子年是什么意思| 夕阳西下是什么意思| exr是什么牌子| 原生态是什么意思| 晚上睡觉遗精是什么原因| 睾丸肿痛吃什么药| squirrel是什么意思| 身上有白斑块是什么原因造成的| 京东积分有什么用| 什么猫最贵| 甘油三酯高是什么原因| 这是什么牌子| 独活主治什么病| hpv45型阳性是什么意思| 一什么河| 暗送秋波是什么意思| 祖先是什么意思| 瞳距是什么| 什么品牌的书包质量好| 哲字五行属什么| 心绞痛吃什么药好| 唯爱是什么意思| 为什么广州叫羊城| tj是什么意思| 拖鞋买什么材质的好| 钙片什么时候吃好| 捡到金子预示着什么| 维生素什么牌子好| 股癣用什么药膏最好| 智商高的人有什么特征| 皮疹是什么样子的| 变色龙形容什么样的人| 一个井一个点念什么| 电信诈骗是什么意思| 苏轼是什么朝代的| 什么除湿气效果最好| 子宫肌瘤不能吃什么| 短效避孕药什么时候吃| 感冒吃什么药好得快| 生姜和红枣煮水喝有什么作用| 大姨妈吃什么好| 谝是什么意思| 间作套种是什么意思| 烧仙草粉是什么做的| 老干局是干什么的| 梦见生孩子是什么征兆| 空腹c肽偏高说明什么| 女生什么时候是安全期| 衬衫配什么裤子好看| 吃什么降胆固醇| 着凉感冒吃什么药| 错峰是什么意思| 乙肝病毒表面抗体弱阳性什么意思| 观音坐莲是什么姿势| 股票解禁是什么意思| 百度
Sitemap

95后人大代表的两会日记用“努力现在”换“给力未来”

I consider a module to be a kinda “first-class citizen” in my code ever since I’ve read the DDD book. Probably finding the module boundaries is the second most important thing after finding service boundaries.

Modules in DDD

The most important parts are highlighted in the book, here they are:

Choose MODULES that tell the story of the system and contain a cohesive set of concepts. This often yields low coupling between MODULES , but if it doesn’t, look for a way to change the model to disentangle the concepts, or search for an overlooked concept that might be the basis of a MODULE that would bring the elements together in a meaningful way. Seek low coupling in the sense of concepts that can be understood and reasoned about independently of each other. Refine the model until it partitions according to highlevel domain concepts and the corresponding code is decoupled as well.

and

Unless there is a real intention to distribute code on different servers, keep all the code that implements a single conceptual object in the same MODULE , if not the same object.

Well, no wonder that what is written there is just “Your code should be loosely coupled and highly cohesive”. What the book lacks is an example of how to define a module. The description of wrong approaches would be great too, but there is none.

David Parnas on decomposition

But recently I stumbled upon a paper by David Parnas called “On the Criteria To Be Used in Decomposing Systems into Modules”. Well, the name is pretty descriptive, so no need to elaborate on what it is about. There is an example (which I didn’t fully comprehend), but what is more important there is an example of wrong (and most popular) approach when identifying module boundaries: using steps your software must go through as modules. It totally contradicts the OOP approach and is an example of procedural thinking.

Procedural way of identifying modules

So here is a quick example. Say your system is involved in online transaction processing. So your (procedural) thinking might go like this:

  • OK, so first I need to validate input data;
  • then I want to check the business rules imposed by my business experts;
  • then I want to send a request in payment system;
  • and after that I want to to save or update some entities depending on the response I receive from payment system.

So it very likely that your modules are:

  • Validators;
  • Business rules;
  • Protocols;
  • “Business logic”.

So, why it is procedural? Because the knowledge of the concepts used by business experts is spread all over the codebase. Validator knows what data is acceptable. Business rules prevent you from sending a request that shouldn’t have been sent. Business logic module accepts the data received from payment system and simply performs a database insert or update — hence the quotes in module name. So conceptually these modules are nothing but a set of procedures that handle input data and pass it further. Very often the names of these procedures end with “-er” or “-or” since they do something with the input data, but have to pretend to be a noun: Validator, PaymentApplicationIsExpiredChecker, PaymentRequestSender, TransactionSaver.

OOP way of identifying modules

What concepts do we have? Apparently, we have a payment application and payment transaction. You can identify some more if you follow this example: they are customer notification, recurring registration, saved user card, etc. Entities representing these concepts know what data is appropriate for them and are aware of conditions they can operate under. They know what business logic they need to carry out and when. Well, actually they are business logic. I think this inherent independence of domain concepts is what makes modules based on this notion loosely coupled.
That’s what Parnas has to say about his way of module identification:

We propose instead that one begins with a list of difficult design decisions or design decisions which are likely to change. Each module is then designed to hide such a decision from the others.

The concepts themselves are not likely to change. But their implementation is.
And

[…] it is almost always incorrect to begin the decomposition of a system into modules on the basis of a flowchart.

— because it’s intrinsically procedural.

It’s really very important: module is not a technical capability of your programming language. It is a higher-level description of your system carved into your codebase. Once again, OOP proves to be a manifestation of business-IT alignment.

--

--

No responses yet

拾掇是什么意思 月经期间应该吃什么食物比较好 什么的飞机 脚掌痒是什么原因 什么是肌张力
清华校长什么级别 喉咙发苦是什么原因造成的 章子怡是什么脸型 和风什么 沉贵宝是什么木
20年是什么婚姻 悬雍垂发炎吃什么药 pi是什么 眼睛红红的是什么生肖 半青皮是什么意思
中暑吃什么 过敏性结膜炎用什么眼药水 玻璃用什么材料做的 玉越戴越亮是什么原因 羽立读什么
钦点是什么意思zhongyiyatai.com 豆沙馅可以做什么美食hcv9jop6ns2r.cn 来月经可以吃什么水果好hcv8jop9ns0r.cn 85年属什么的生肖hcv8jop3ns6r.cn 六味地黄丸的功效是什么hcv7jop7ns4r.cn
中暑是什么感觉hcv9jop1ns7r.cn 隐翅虫吃什么hcv8jop3ns8r.cn ssr是什么hcv8jop5ns9r.cn 牙齿根部发黑是什么原因hcv8jop7ns6r.cn 耳鸣是什么原因引起hcv7jop9ns4r.cn
什么叫丹毒hcv8jop3ns0r.cn 先天是什么意思hcv7jop9ns8r.cn 肺炎支原体抗体阴性是什么意思hcv8jop1ns5r.cn 冒菜是什么菜hcv7jop9ns4r.cn 火字旁的有什么字jiuxinfghf.com
红色配什么颜色好看hcv7jop5ns2r.cn 肌红蛋白偏低什么原因1949doufunao.com eb病毒是什么病luyiluode.com spo2是什么意思hcv9jop4ns5r.cn 黑米和什么一起搭配煮粥最佳hcv9jop5ns3r.cn
百度