If I have two classes as
class A
{
}
and
class B
{
}
class A wants to use methods of class B and vice-versa.
What should be the best design other than the mediator pattern?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
At the minimum, you should decouple your classes with interfaces. This way your intended contract between the two classes would be captured explicitly through the interfaces.
Other than that, it depends a lot on the nature of interaction that you are planning.