Design question

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,
I need a functionality which will be mutual for two classes (A and B)
which have no inheritence between them -> I created a new class C which
will contain the mutual methods.
There is an external class D which will need to use A and B methods by
getting the object C and activate the methods.

Is there a need to make C static or public is enough?
How can I insure mutual exclusion?
 
Hi,

csharpula csharp said:
Hello,
I need a functionality which will be mutual for two classes (A and B)
which have no inheritence between them ->

So these two classes share a common interface right? so define an interface
and have both classes implement it.

I created a new class C which
will contain the mutual methods.

Now here I get confused, are you telling that the implementation in both
classes of the methods are the same?

How can I insure mutual exclusion?

What you mean with mutual exclusion?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top