Book a Demo

Author Topic: Class Diagram: Generic types and update methods  (Read 13042 times)

EAUser2009

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Class Diagram: Generic types and update methods
« on: September 18, 2009, 07:37:32 pm »
I'm using C# and I'm newbie with EA product. I have some questions:
- how to represent a generic type <T> in a class? I used tag "generic" (I found from Help) but the generated code doesn't have <T> or T type.
- sometimes I have to change return values of some methods in the interface, but the classes implement this interface don't update these changes. Can EA do it automaticaly or I miss something?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Class Diagram: Generic types and update method
« Reply #1 on: September 18, 2009, 08:26:36 pm »
EA sort of bends the template classes (as would be used by C++ and such) to represent .Net generics. It works fairly well much of the time.

Try reverse engineering some simple generics written in C#. Once you examine how EA handles them you will be able to create your own.
No, you can't have it!

EAUser2009

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Class Diagram: Generic types and update method
« Reply #2 on: September 18, 2009, 08:49:58 pm »
Thanks for your reply. I'll try it
How about the problem with changes in interface but there is no update in classes implementing this interface?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Class Diagram: Generic types and update method
« Reply #3 on: September 18, 2009, 09:02:53 pm »
EA won't update classes automatically when you change an interface.

This is not really a cop-out or a failure to carry design through to implementation on the part of Sparx. There was some reasoning behind this decision. It was explained in the forum by one of the Sparxians some time ago but I've long since forgotten the reference.

Search the forum and you will find some workarounds. Unfortunately they all require some effort.
No, you can't have it!