Total Downloads

2,591,904

Total Files

9,206

Latest Update

10

How to avoid temporal coupling in C#

Posted December 4, 2017 | Windows


Two hallmarks of good software design are low coupling and high cohesion. Cohesion is a measure of how focused a module of a program is on a set of responsibilities. Coupling is a measure of the degree to which the modules of a program are dependent on other modules.

Giving a module a broad set of responsibilities, or making it dependent on many other modules, makes the code more difficult to maintain and discourages code reuse. In other words, low cohesion and high coupling are detrimental to your application. Thus we should strive for high cohesion and low coupling: Restricting the focus of modules to closely related functionality, and minimizing their dependence on external code. 

I have discussed the various types of cohesion and coupling in a previous article (see “Design for change: Coupling and cohesion in object oriented systems”). In this article I will look specifically at temporal coupling and suggest some strategies to avoid this particular design smell. 

What is temporal coupling?

Temporal coupling is a “design smell” that occurs when you have an implicit temporal relationship between two or more members of a class. This generally means having to invoke multiple members of a class in a specific sequence. The members are effectively tightly coupled because the calls must follow a strict order.



Source link

')
ankara escort çankaya escort çankaya escort escort bayan çankaya istanbul rus escort eryaman escort ankara escort kızılay escort istanbul escort ankara escort ankara escort escort ankara istanbul rus Escort atasehir Escort beylikduzu Escort Ankara Escort malatya Escort kuşadası Escort gaziantep Escort izmir Escort