Book a Demo

Author Topic: how to declare class friendship in class diagram  (Read 2881 times)

Grigoris Dimitroulakos

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
how to declare class friendship in class diagram
« on: May 24, 2010, 02:12:00 am »
Hello
I want to model class friendship in EA8 so as to have the following result when I generate C++ code

class A{
  friend class B;
...
};

class B{
...
};

I have tried the following and it didn't work:
I used dependency relationship (class B ----(friend)--> class A ) stereotyped as "friend" or "permit". In that case the model had the dependency but the generated code is as
class A{
...
};

class B{
...
};

Thanks in advanced

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how to declare class friendship in class diagr
« Reply #1 on: May 25, 2010, 03:52:05 pm »
I don't think friend relations are supported by the engineering process.

Most people consider it a bad practice, so you might want to rethink the need for friend relations.

Geert