What is coupling and cohesion?

Coupling

In software development perspective coupling is the degree of a module or class is tied directly to others.We can reduce the coupling via implementing intermediate components like Spring IOC, business delegates etc.

Cohesion


We don't want a single class to perform all the tasks like validation, business logic, data acces logic etc.In order to create a  more cohesive system from the higher and lower level perspectives,you need to break out the various needs into separate classes.
Interfaces, Implementation, Validator, Data access classes etc.

No comments:

Post a Comment

12 classic String-based Java interview questions with simple explanations and code.

  1️⃣ Check if a String is a Palindrome Problem Given a string, check if it reads the same forward and backward. Example: "madam...

Featured Posts