首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
In computer programming, cohesion and coupling are used to describe modules of code. Which of the following is a favorable combi
In computer programming, cohesion and coupling are used to describe modules of code. Which of the following is a favorable combi
admin
2013-12-19
75
问题
In computer programming, cohesion and coupling are used to describe modules of code. Which of the following is a favorable combination of cohesion and coupling?
选项
A、Low cohesion, low coupling
B、High cohesion, high coupling
C、Low cohesion, high coupling
D、High cohesion, low coupling
答案
D
解析
D正确。如果一个模块被描述为具有高内聚(cohesion)、低耦合(coupling)性,这是个好事。内聚反映的是一个模块能够执行多少种不同类型的任务。高内聚意味着这个模块执行的是一个基本任务(如数值的减法)或几个非常相似的任务(如减法、加法、乘法)。内聚程度越高,更新或修改一个模块且不影响其他与之交互的模块就越容易。这也意味着该模块更容易重复使用和维护,因为与低内聚的模块相比它更简单。耦合显示了一个模块为了执行其任务需要进行多少次交互的衡量。如果一个模块是低耦合或者松散耦合,这意味着这个模块在执行它的工作时不需要与许多其他模块进行通信。与那些依靠许多其他模块进行工作的模块相比,这些模块更容易被理解和重复使用。而且,修改这些模块也更加容易,也不会影响它们周围的众多模块。
A不正确。因为低内聚的模块是不可取的。低内聚的模块会执行几个不同的任务,增加了这个模块的复杂性,使之更难维护和重复使用。一个模块的内聚程度越高,它执行的任务越少,越容易对其进行更新或者修改,而不影响其他与之交互的模块。
B不正确。因为高耦合的模块是不可取的。高耦合意味着一个模块依赖于很多其他的模块来执行其任务。这使得它因为与其他模块的相互依存关系而很难被理解、重复使用和修改。打个比方,公司希望员工能够在尽量不依靠其他员工的情况下执行他们各自的任务。如果Joe需要与5个人进行交流才能完成他的工作,这说明太过复杂,也太耗时,当然出错误的地方也会更多。
C不正确。因为这一陈述说得与正确的恰恰相反。一个低内聚、高耦合的模块十分复杂,因为它需要执行几个不同类型的任务并依靠许多其他模块来执行这些任务。这些特点使得这个模块更难维护和重复使用,这是由于它很大程度上增大了影响到与之交互的其他模块的可能性。
转载请注明原文地址:https://kaotiyun.com/show/EAhZ777K
0
CISSP认证
相关试题推荐
Salt,shellsormetalsarestillusedasmoneyinout-the-waypartsoftheworldtoday.Saltmayseemratherastrange【C1】__
Salt,shellsormetalsarestillusedasmoneyinout-the-waypartsoftheworldtoday.Saltmayseemratherastrange【C1】__
Salt,shellsormetalsarestillusedasmoneyinout-the-waypartsoftheworldtoday.Saltmayseemratherastrange【C1】__
Individualsandbusinesseshavelegalprotectionforintellectualpropertytheycreateandown.Intellectualproper【C1】______fro
Iftheworld’seducationsystemshaveacommonfocus,itistoturnoutschool-leaverswhoareproficientinmaths.Governments
About3billionpeoplelivewithin100milesofthesea,anumberthatcoulddoubleinthenextdecadeashumansflocktocoasta
Foryears,sportsfanaticshaveturnedtostatisticstohelpthemgaugetherelativestrengthorweaknessesofdifferentteams,
Howmenfirstlearnedtoinventwordsisunknown;inotherwords,theoriginoflanguageisamystery.Allwereallyknowistha
Inarareunanimousruling,theUSSupremeCourthasoverturnedthecorruptionconvictionofaformerVirginiagovernor,Robert
Gradeinflation—thegradualincreaseinaverageGPAs(grade-pointaverages)overthepastfewdecades—isoftenconsideredaprod
随机试题
A.CVPB.PAWPC.MAPD.PCWPE.MPAP能判定左心室功能,反映血容量是否充足的指标是
A、血培养B、检测特异性抗体C、检测特异性抗原D、大便培养E、活体组织检查流行性出血热确诊
可解除胃肠道平滑肌痉挛的药物是
A.处方调配B.治疗药物监测C.静脉药物配置D.参与临床药物治疗E.药物不良反应监测和报告药师提供药学服务的重要方式和途径是()。
瑞翔建筑工程公司就其全部的财产向保险公司投保,约定保险金额为300万元,后因雨天雷电导致火灾,使得公司财产遭受了360万元的损失。则下列说法正确的是:
在跨越两个会计年度的建造合同中,下列有关建造合同收入确认的表述中,正确的有()。
列举幼儿园家长工作的主要形式,并谈谈其作用。
习近平总书记在纪念五四运动100周年大会上强调,新时代中国青年运动的主题,新时代中国青年运动的方向,新时代中国青年的使命,就是()。
设对任意的x,总有φ(x)≤f(x)≤g(x),
Elderlypeoplerespondbesttoacalmandunhurriedenvironment.Thisisnotalwayseasytoprovideastheirbehaviorcansometi
最新回复
(
0
)