Book a Demo

Author Topic: Class Diagrams, Interface realization  (Read 3992 times)

Philippe E. Auchlin

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Class Diagrams, Interface realization
« on: August 10, 2007, 03:12:04 am »
Also I am relatively new to EA, I noticed behaviors in Class Diagrams which puzzles me:

1.When creating an interface and a class and realizing the interface in the class:

1.I will see a dialog allowing me to select the operations I would like to realize in the class. Also this mimics the behavior of most of other CASE tools, I always thought interfaces have to be realized in their entirety
2.The dialog does not show any attributes to be realized in the class.

2.When I remove the realization, or delete the interface, the operations stay in the class.
3.When I create a class and check the “abstract” checkbox, realizing this class in another one does not show any dialog and does not realize any operations or attributes either.

The language is set to C#, and this behavior not very well reflects how the compiler will react when attempting to compile a partially realized interface or inherited abstract class.

Am I missing something? Another way to better set the properties of either interfaces or abstract classes?

Philippe :-[
« Last Edit: August 10, 2007, 03:13:27 am by PhilippeA »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Class Diagrams, Interface realization
« Reply #1 on: August 10, 2007, 03:41:32 am »
I don't seem to have that issue. Both realizing and inheriting from an abstract class pops up the "Overrides and implementations" window.
A way of calling the window manually is described here: http://www.sparxsystems.com.au/EAUserGuide/index.html?overrideparentoperations.htm

Philippe E. Auchlin

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Class Diagrams, Interface realization
« Reply #2 on: August 10, 2007, 04:42:10 am »
Thanks Geert,

I checked the Settings as described in the linked page, they are identical and nevertheless, it works the way I described it.

Strictly object-oriented speaking:
Interfaces have to be realized, at least in C#, as a whole including attributes.
Abstract classes have to be realized, at least in C#, as a whole, I mean all abstract operations, and attributes.
Removing an interface or abstract class reference, at least in C#, I expect to see a dialog asking if I would like to keep the realized attributes and operations.

I expect to use the class diagrams to, at a later stage, generate the code in C#. I also expect the generated code to compile and not generate an error message because an interface has only been partly realized!

Philippe ;)