Difference Between Coupling And Cohesion

739 Words2 Pages

Coupling & Cohesion Student – w16006135 Explain in around 600 words, citing any literature you have consulted, what is meant by these terms in relation of object-oriented software design, and explain how they relate to the design you developed in your group. Coupling & Cohesion Conceptualized by Edward Yourdon and Larry Constantine in 1972, coupling and cohesion is a set of concepts to be applied when developing object-oriented systems to simplify the design and help enforce encapsulation. Coupling measures how much one object depends on another object to do its job. Tightly coupled objects will have high number of connections with other objects and a low level of mutual independence, whilst loosely coupled objects will contain the opposite. …show more content…

Highly cohesive objects are a good thing as they are easier to use and maintain, as well as more readable and reusable. To ensure this, objects should contain relevant methods, be clear and concise, and only exist to resolve a specific task. In object-oriented systems there are three types of cohesion: Class, Operation, and Specialization. Operation cohesion is the measure of how much an operation focuses on a single functional requirement, class cohesion is the measure of how much an entire class focuses on a single requirement, and finally specialization cohesion measures how sensible the inheritance between a parent and child object …show more content…

Operation cohesion can be seen throughout, as methods within objects are only included to serve a single purpose. An example of this can be seen in ‘Journal’, which contains the method ‘getVolumeNumber()’. This method has a simple purpose. It returns the volume number of the journal. ‘LoanTransaction’ is an object which demonstrates class cohesion very well. The class only exists to record the details of a user registering a loan, and all its methods and attributes reflect this. Finally, the inheritance between the ‘Item’, ‘Book’, and ‘Journal’ objects make use of specialization cohesion. It seemed far more sensible to separate ‘Item’ into three separate classes, where ‘Book’ and ‘Journal’ would be types of items, as opposed to having one big convoluted class which covered two different entities. In conclusion it is sensible to use coupling and cohesion in tangent, where cohesion is high, and coupling is kept loose. Sticking to this rule allows for object-oriented systems to be designed in a simple and elegant manner. FIGURE

Open Document