Main Menu
Login
SSL SecureMode
Username:
Password:  
Lost Password?
Register now!
ChangeVision Members Map
Search
Forum Index   -   Topic Index
   How to use of Astah (Pro/SysML/GSN/Com)
     Help with java import to class diagram -- generics?

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
titusj
Posted on: 2008/2/28 7:26
Just popping in
Joined: 2008/2/28
From:
Posts: 9
Help with java import to class diagram -- generics?
Hello,

First, I'm just starting to use JUDE, so I don't have any experience with the product yet.

I've just imported a project with the intent of documenting some relationships with class diagrams. After my import, I see some of my collections are appearing as interfaces. A colleague asked me if the problem is related to generics. The only references I could find searching the JUDE site for "generics" were almost 2 years old. Does JUDE not support correctly importing generics, or do is another issue causing me these problems?

To summarize what I'm after. I have class Parent that has a List<Child> member. I want to see an association between Parent and Child on my diagram. Instead "List<Child>" appears to be an interface and the two classes are in no way related.

Thanks for any help you can provide.

Jason
titusj
Posted on: 2008/2/28 7:27
Just popping in
Joined: 2008/2/28
From:
Posts: 9
Re: Help with java import to class diagram -- generics?
I forgot to mention... I'm using the JUDE Community 5.2.1 on Windows.
midori
Posted on: 2008/2/28 13:20
Developer
Joined: 2006/7/3
From:
Posts: 324
Re: Help with java import to class diagram -- generics?
Hi Jason,

Thank you for using JUDE!

In JUDE, generics will be imported as template parameters.

For example, import the following codes:
import java.util.List;
public class Parent {

	List<Child> c;

}


As you can see, List<Child> is imported as an anonymous bound class.





















An association can be set between Parent and Child if you add the following code:
import java.util.List;
public class Parent {

	List<Child> c;
	Child[] c2;

}


After importing, an association is generated between Parent and Child.




















If you have further questions, please let us know at any time. Thank you.


Regards,
Midori
titusj
Posted on: 2008/2/29 0:46
Just popping in
Joined: 2008/2/28
From:
Posts: 9
Re: Help with java import to class diagram -- generics?
Midori,

Thanks for walking through the example. What you are saying is exactly what I'm seeing. Unfortunately, it isn't quite exactly what I desire.

To elaborate on my situation, I am trying to document an existing application using some critical class diagrams. In other words, I am not at a point where changing the code is an option (not that I'd advocate changing the code to suit the class diagramming tool anyway). My hope was to create a new diagram and then drop on the existing classes that I think are most significant to some view of the system.

Granted it has been a while since I've dug into the exact semantics of UML, but I've always used an association to represent this type of relationship in the past. I would ideally love to be able to even call the association an aggregation or composition after I've put both classes on the diagram. I don't see a benefit to the representation you explained over one of those options, and in fact find it less intuitive. After all, I'm not really trying to communicate the fact that a java List was used, but instead that a parent has a collection of children.

I guess what I'm saying is that I request in some future version the JUDE development team consider making this type of representation an option.

Thanks.

Jason
midori
Posted on: 2008/2/29 11:52
Developer
Joined: 2006/7/3
From:
Posts: 324
Re: Help with java import to class diagram -- generics?
Hi Jason,

Thank you for your detailed explanation.

We have discussed the import java function in JUDE and would like to support the following feature to convert java and UML (both import and export java) in the future version of JUDE.

Our idea is shown below.
Import Parent, then models will be displayed as follows:

List<Child>





Set<Child>





Map<Key, Value>






If you have further comments, please let us know freely. Thanks!

Regards,
Midori
titusj
Posted on: 2008/2/29 23:35
Just popping in
Joined: 2008/2/28
From:
Posts: 9
Re: Help with java import to class diagram -- generics?
Midori,

That looks great! It shows exactly what I need.

I look forward to seeing that functionality in the future.

Jason
emkookmer
Posted on: 2008/6/17 16:36
Just popping in
Joined: 2008/6/17
From:
Posts: 1
Re: Help with java import to class diagram -- generics?
would it not be more handy if the user could just use it like this within jude

from a class diagram point of view

constructor/method
+ Parent(childeren : List<Child>)
+ GetChilderen() : IEnumerable<Child>


class value
- List<Child> : _childeren


i think this would give the best readability, but it would probly be a difficult feature to implement
midori
Posted on: 2008/6/18 15:54
Developer
Joined: 2006/7/3
From:
Posts: 324
Re: Help with java import to class diagram -- generics?
Hi emkookmer,

Thank you for your comment!

In JUDE, you can choose to import attributes as associations or attributes when you import java files.

So, if "children" is imported as an attribute, it will be displayed as below.









Best regards,
Midori
simas
Posted on: 2010/6/10 21:02
Just popping in
Joined: 2010/6/10
From:
Posts: 1
Re: Help with java import to class diagram -- generics?
Hi,

When will this feature be implemented?
I think the solution using templates is not usable for Java.

Kind Regards,
Simon
Joba
Posted on: 2010/6/16 2:09
Developer
Joined: 2006/6/6
From:
Posts: 969
Re: Help with java import to class diagram -- generics?
Hi Simon,

Development team again had a discussion and the conclusion is that this feature will be implemented in the near future release. Not the next release but one after.

Thank you for your comment and being patient with us.

Best Regards,
Satomi
Threaded | Newest First Previous Topic | Next Topic | Top