Sparx Systems Forum

Enterprise Architect => Uml Process => Topic started by: EAUser2009 on September 18, 2009, 07:37:32 pm

Title: Class Diagram: Generic types and update methods
Post by: EAUser2009 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?
Title: Re: Class Diagram: Generic types and update method
Post by: «Midnight» 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.
Title: Re: Class Diagram: Generic types and update method
Post by: EAUser2009 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?
Title: Re: Class Diagram: Generic types and update method
Post by: «Midnight» 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.