coupling

Cohesion and Decoupling, what do they represent?

▼魔方 西西 提交于 2019-12-02 14:15:06
What are Cohesion and Decoupling? I found information about coupling but not about decoupling. ant That article from Aaron is very good for understanding, also I'd recommend that you read manning publications Spring in Action book, they give very good examples on how the spring solves that problem it will definitely improve your understanding of this. EDIT : I came accross this in this great book called Growing object oriented software guided by tests : Coupling : Elements are coupled if a change in one forces a change in the other. For example, if two classes inherit from a common parent,

Model Using Modules in Rails Application

送分小仙女□ 提交于 2019-11-30 02:05:35
I have a model that requires loading external data from an auxiliary source. A number of web services exist that my model can fetch the data from (swappable), but I don't want to create code that will make it difficult to change services (costs significantly differ based on variable and fixed usage and it is likely changing will be required). I would like to create a driver to perform the interaction (and then create further custom drivers if the service requires switching). Unfortunately, due to the tight coupling of the driver and model, it does not makes sense to extract the code into a

Detecting dependencies between namespaces in .NET

て烟熏妆下的殇ゞ 提交于 2019-11-29 13:44:27
Are there any utilities that can examine a set of managed assemblies and tell you whether any of the types in one namespace depend on any in another? For example, say I have a MyApp.BusinessRules namespace and don't want it to access directly anything in MyApp.GUI , but both namespaces are in the same assembly. My goal is to be able to write a custom MSBuild task that verifies that various coupling rules have not been broken. So far the only tool I have come across that looks like it might do this is NDepend , but I am wondering if there is a simpler solution. Patrick from NDepend team So far

How to solve the violations of the Law of Demeter?

女生的网名这么多〃 提交于 2019-11-28 15:32:14
A colleague and I designed a system for our customer, and in our opinion we created a nice clean design. But I'm having problems with some coupling we've introduced. I could try to create an example design which includes the same problems as our design, but if you forgive me I'll create an extract of our design to support the question. We're developing a system for the registration of certain treatments for a patients. To avoid having a broken link to image I'll describe the conceptual UML class diagram as a c# style class definition. class Discipline {} class ProtocolKind { Discipline; }

Detecting dependencies between namespaces in .NET

杀马特。学长 韩版系。学妹 提交于 2019-11-28 07:34:00
问题 Are there any utilities that can examine a set of managed assemblies and tell you whether any of the types in one namespace depend on any in another? For example, say I have a MyApp.BusinessRules namespace and don't want it to access directly anything in MyApp.GUI , but both namespaces are in the same assembly. My goal is to be able to write a custom MSBuild task that verifies that various coupling rules have not been broken. So far the only tool I have come across that looks like it might do

Coupling, Cohesion and the Law of Demeter

删除回忆录丶 提交于 2019-11-27 10:25:52
The Law of Demeter indicates that you should only speak to objects that you know about directly. That is, do not perform method chaining to talk to other objects. When you do so, you are establishing improper linkages with the intermediary objects, inappropriately coupling your code to other code. That's bad. The solution would be for the class you do know about to essentially expose simple wrappers that delegate the responsibility to the object it has the relationship with. That's good. But, that seems to result in the class having low cohesion . No longer is it simply responsible for

Coupling, Cohesion and the Law of Demeter

半世苍凉 提交于 2019-11-26 17:56:29
问题 The Law of Demeter indicates that you should only speak to objects that you know about directly. That is, do not perform method chaining to talk to other objects. When you do so, you are establishing improper linkages with the intermediary objects, inappropriately coupling your code to other code. That's bad. The solution would be for the class you do know about to essentially expose simple wrappers that delegate the responsibility to the object it has the relationship with. That's good. But,