Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:58:56+00:00 2026-06-06T13:58:56+00:00

Assume methods M1 and M2 have strongly related responsibilities First example: If • M1

  • 0

Assume methods M1 and M2 have strongly related responsibilities

First example:

If

• M1 and M2 are defined within class A ( thus class A is highly cohesive )

• class B uses A.M1 and class C uses A.M2

then

• A is coupled with both B and C classes

• changing the signature of M1 will require changes only in B, but not in C

Second example:

If

• M1 is defined within class A1 ( thus B is coupled with A1 )

• M2 is defined withing class A2 ( thus C is coupled with A2 )

then

• changing the signature of M1 will require changes only in B, but not in C

a) To my understanding, classes in last example are no more coupled than classes in first example! Or am I missing something?

b) As far as I can tell, classes in first example are more loosely coupled than those in second example only if:

  • we assume that changing the signature of M1 will also require us to change the signature of M2, but I don’t see that happening very often?!

  • or if both M1 and M2 operate on the data of same type T1, then replacing T1 with T2 will require changes in both M1 and M2?!

  • or if we assume that due to M1 and M2 having closely related responsibilities, that the chances are that much greater that changing M1 will often require M2 also to be changed (even if M1 doesn’t directly or indirectly call M2)?!

  • or if we assume that due to M1 and M2 having closely related responsibilities, the chances are much greater that some class will require both M1 and M2 ( as such having M1 and M2 in single class reduces coupling )?!

c) Are there any other reasons why defining M1 and M2 within A ( instead of defining M1 within A1 and M2 within A2 ) will reduce coupling?

Note – I’m aware that we should have higly cohesive modules due to easier maintenance and reusability

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:58:58+00:00Added an answer on June 6, 2026 at 1:58 pm

    Yes it does. What you are missing that is if ClassA is cohesive, changing M1 will cause ClassB to access some other method in ClassA. It increases maintenance because you won’t have to modify other modules (method and variables) in ClassA itself.

    When we call a class cohesive (say ClassA) , we mean that we can easily use the purpose(s) of the class without have to make our caller class (ClassB) according to the requirements of ClassA. Hence, ClassB is not dependent on ClassA and thereby cohesion is reduced.

    Don’t think of think of cohesion in terms of methods. Methods are not called cohesive, classes are.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assume you have a class that defines virtual methods with the access specifier public.
Assume I have a C# class like this: [XmlRoot(floors)] public class FloorCollection { [XmlElement(floor)]
I have a set of methods that all synchronize to the class object (can't
Let's assume I have two service classes with the following methods: GroupService createGroup() deleteGroup()
In various activities I have very similar methods. For example: @Override public void onClick(View
Say I have a class with some properties and some methods for manipulating those
Assume that I have a class that exposes the following event: public event EventHandler
Assume that I have a class with a readonly property on it. //MyClass.h @interface
So assume I have one class named Program which contains my whole program of
Assume i have a costum actionscript class. public class myClass { private var myVariable:ArrayCollection;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.