Friend classes

  • Thread starter Thread starter Padu
  • Start date Start date
P

Padu

Is there such a thing in C#? If not, is there a workaround or suggested
shift of paradigm?

I know friendly classes can be evils sometimes, but some other times it may
be very helpful. If you think about the memento pattern, it is nice for the
memento to expose two interfaces, one for the world and another one for the
originator...

Any comments?

Cheers

Padu
 
Is there such a thing in C#? If not, is there a workaround or
suggested shift of paradigm?

Sure. Use an internal class.

Best Regards,
Dustin Campbell
Developer Express Inc
 
Sort of .. the internal keyword makes things visible only to other classes
within your assembly or friend assemblies .. this is a bit larger in scope
than delcaring another class a friend but can offer similar functionality.

Cheers,

Greg Young
MVP - C#
 

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