Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sslavic

Pages: [1] 2
1
General Board / Re: Java collections and generics in associations
« on: March 05, 2008, 11:16:07 am »
Another issue/bug found: attribute gained through association will persist even tho either of the classes, which formed association, gets deleted from the diagram where that association was painted. Both classes will remain in Project Browser, they can possibly be painted elsewhere on some other diagrams, but point is that when code is generated, association attribute will still be there, even tho there is no more that association between the classes.

2
General Board / Re: Java collections and generics in associations
« on: March 05, 2008, 12:48:39 am »
I've found in EAP file a line that has

Code: [Select]
defaultCollectionClassList<#TYPE#>{E75F2822-0F50-4882-89F1-4DEE4623F024}Q++

so definitely old and erased Default Collection Class setting is still present in the project.

3
General Board / Re: Java collections and generics in associations
« on: March 04, 2008, 09:49:29 pm »
Another issue, which in my opinion is a bug, is manifested in way that when a class attribute, previously checked to be Property and having getter and setter generated, has its type changed, this change doesn't propagate to corresponding getter and setter. Workaround I had to come up with is to first uncheck Property checkbox for attribute whose type has to be changed (getter and setter are deleted), change attribute type, and then check Property again. (Sigh) Yet another annoying EA "feature".

Back to the associations (but related to the accessor methods), class attributes that class gets by (navigable) association is not in list of class attributes and I don't see easy way to mark it additionally as a Property (being navigable in certain direction should be enough). Is there any way to make EA generate getter and setter methods for such attributes? Not to mention that other tools like Sybase PowerDesigner not only offer this, SYB PD can also generate additional handy methods for accessing attributes that are collections (getIterator, removeAll, addAll, ...). Guess this can be done in Code Generation Templates, and as much as I agree these additional methods are advanced and not always needed (so customizing generation templates is reasonable), getters and setters are basic and common, I expect things like these from the start. Where is the best place to start learning this language for customizing code generation templates in EA?

4
General Board / Re: Java collections and generics in associations
« on: March 04, 2008, 08:11:55 pm »
Midnight, Have to admit, I'm not sure what you're talking about. I didn't do anything like that, at least not on purpose. There is a root package, and problematic class, User, is first painted in one sub-package and then dragged from Project Browser tree to the other sub-package to mark another association that class has. In its primary package, User class had its Default Collection Class set to one value, then its source was generated, then Default Collection Class was erased for that class, and finally Default Collection Class is set globally for Java language to a slightly different value (full class path was specified). Regardless of made changes, generating source for that class would result in x-to-Many associations being mapped using second value, except single association drawn between User class and some other class, on User class primary diagram/package. No, problematic association doesn't have Member Type set for neither of the two roles.

I agree with you Simon, something is holding that old value, but why, where, and how to clean/reset it I do not know. Right-clicking root package then selecting Code Engineering-->Reset Options for this Package, then choosing either Java or All as Where, and Java as To, and checking Reset Default Options and checking Process Child Packages - all this didn't help. I've tried deleting association, saving, restarting EA, adding association back - no luck. Same with deleting class itself - no wonder why setting Default Collection Class for that specific class didn't work as well.

All this is rather annoying. I don't understand rationale behind not having things like these having default values for specific languages. E.g. in Java, a java.util.List is most commonly used collection class, and Java 1.5+ is version of choice in most if not all new Java applications. Setting default values would make it easier for all users - ones that will use it as is, and also ones that will want to change it (it is easier to change something than to reinvent the wheel especially if that involves learning something like EA's only expressions like #TYPE#)

Thank you all for your assistance!

5
General Board / Re: Java collections and generics in associations
« on: March 04, 2008, 12:55:07 am »
Thank you, it works, but...

User and Role classes are drawn on single diagram, and on that diagram I've first configured in its Details tab, Collection Classes, Default Collection Class to be List<#TYPE#> and generated code. All associations that had multiplicity 0..* or 1..* were well generated.

Then I cleared that setting from User class, deleted previously generated Java file, and set in Tools-->Options-->Source Code Engineering-->Java-->Collection Classes, Default Collection Class to be java.util.List<#TYPE#>. After that I've generated code and to my surprise, associations between User and Role were generated as List<#TYPE#> and other association between User and some other classes drawn on different diagram were generated as java.util.List<#TYPE#> (where #TYPE# was replaced as expected). Problem is I can not make it uniform anymore, regardless of the global or User class setting for Default Collection Class is, it always generates List<#TYPE#>. Is this a bug or am I doing something wrong?

6
General Board / Java collections and generics in associations
« on: March 01, 2008, 02:04:30 am »
Is it possible and, if yes, how to make EA generate code using Java Generics and Collections API?

Simple example is just to have two classes with association in between navigable and bidirectional, modeling many-to-many relationship.

7
General Board / Re: Modeling Java Generics with Interfaces
« on: December 17, 2007, 05:43:33 pm »
There is a solution given in another topic on this same forum. Look here http://www.sparxsystems.com/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1197374126

8
General Board / Element synonym
« on: December 21, 2007, 05:25:05 am »
I'm new to Enterprise Architect and have used PowerDesigner background before. In PowerDesigner there was a notion of element synonym - if I wanted to represent same element twice on same (or multiple different) diagram I would create/define element once and then reuse it wherever needed by making so called "graphical synonym" (something like "simple link" in EA). Defining a relationship between other elements and graphical synonym would result as if relationship was defined between that other element and root element of the synonym, just it would visually be connected to the synonym. If synonym gets deleted, relationship would automatically be connected to nearest synonym of the same element, or to the root element itself if there are no synonyms.

It seems that Enterprise Architect doesn't allow creation of element "as Simple Link" of some element and have both element and its simple link on same diagram. Is there a workaround to display same element twice on single diagram? E.g. in a complex data model I'd like to visually separate different parts of model, not to have relationships all over the place obstructing the view.

9
General Board / Re: Screen Architect Prototyping Plug-in Released
« on: December 12, 2007, 05:48:10 pm »
Another, and final thumb down - for additional $75 this plug-in offers nothing essentially new that isn't already present in EA user interface diagrams.

10
General Board / Re: Screen Architect Prototyping Plug-in Released
« on: December 12, 2007, 05:15:31 pm »
When I wanted to download trial version of this plug-in, I was requested to register and on registration form there's way too much required fields, personal information - instant first turn off. Second one, .NET framework is a system requirement. Two thumbs down, and I haven't installed it yet.

11
General Board / Re: Clear recent
« on: December 17, 2007, 06:43:59 am »
Works great! Thanks!

12
General Board / Clear recent
« on: December 17, 2007, 05:10:48 am »
How to clear recent projects list?

13
General Board / Re: Obtaining license
« on: December 17, 2007, 04:41:33 am »
Problem was with my bank. Successfully obtained license.

14
General Board / Re: Obtaining license
« on: December 17, 2007, 12:20:29 am »
Has anyone successfully purchased EA license in last two days, and if yes which of the two payment services did you use?

15
General Board / Re: Obtaining license
« on: December 16, 2007, 07:25:23 am »
Will try all as you suggested. Thanks for you replies.

Pages: [1] 2