Book a Demo

Author Topic: Class diagram  (Read 5301 times)

gliesian

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Class diagram
« on: July 28, 2008, 03:50:26 am »
I wish to display a class diagram as a single box... however the default shows two compartments... how do I remove the bottom compartment?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Class diagram
« Reply #1 on: July 28, 2008, 07:10:17 am »
Unfortunately you don't, I least I think you don't. This is a UML restriction...

You could use a shape script, but you will need to add a stereotype to the class. Another option would be a custom image, but that leaves a lot of limitations.

Perhaps you could use an object classifier, but once again that will give you some problems, not the least of which is a colon in the name.

I often grapple with this when doing a high-level diagram. There's not too much you do to get around it.

[Of course I could be wrong... Ideas anyone?]

David
No, you can't have it!

gliesian

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Class diagram
« Reply #2 on: July 28, 2008, 08:14:16 am »
It is my understanding that the attributes and operations compartment are optional.  If they are not, perhaps someone can point this out in the spec.  I'll take a look at the spec and see if I can find it myself (http://www.omg.org/docs/formal/07-11-02.pdf).

So what I am hearing is that you cannot remove the second compartment with the EA tool.  Is this correct?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Class diagram
« Reply #3 on: July 28, 2008, 10:11:39 am »
AFAIK this is the case.

[Once again I'd be delighted if someone could prove me wrong.]

I completely agree with you about the permissibility of showing a class without any horizontal lines - or at least without any empty compartments - but EA does not seem to allow this. The specification does not say that a tool must allow such a thing, just that it is acceptable to do so.

I did make a formal feature request quite some time ago on just this point. There was no reply. Perhaps you'd like to make another. In time there might be enough weight that this would make it onto the list for implementation.

David
No, you can't have it!

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Class diagram
« Reply #4 on: July 28, 2008, 11:12:37 am »
Just to clarify if you are refering to the Compartment or the actual view of the Attributes and Operations; these can be turned off in the Diagram Properties | Elements tab.  The line remains, but you can simply reduce the hieght of the Element to elimnate that.

gliesian

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Class diagram
« Reply #5 on: July 28, 2008, 12:11:01 pm »
Thanks... I get more of a rectangular box than a square one, but I guess that's okay for what I need to do.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Class diagram
« Reply #6 on: July 28, 2008, 02:36:05 pm »
What exactly do you want to achieve?  If it is purely a pictorial representation, could you use Object elements on a Class diagram?

Another option might be to use any graphics tool to create a blank rectangle as you require, save it as a file, and then use the Appearance | Select Alternate Image menu option to apply that shape to each Class. The Class name displays underneath the shape. You can set this up in a matter of seconds. Then, your element looks like a blank rectangle but behaves (and is reported on) like a Class.
Best Regards, Roy

Transition Technologies

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Class diagram
« Reply #7 on: July 28, 2008, 05:51:47 pm »
Quote
What exactly do you want to achieve?  If it is purely a pictorial representation, could you use Object elements on a Class diagram?
Exactly for me Object is the solution, or even you could use Domain Model if you don't want to show Operations and Attributes.
« Last Edit: July 28, 2008, 05:53:00 pm by transition »
Regards,
Transition Technologies
Authorized Reseller and Training Partner of Sparx Systems
www.ea.tt.com.pl

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Class diagram
« Reply #8 on: July 28, 2008, 09:52:49 pm »
Very true, but the line remains...

Using objects can work, with the punctuation note in mind.

For high-level presentation some people - a few of my clients among them - find the line annoying. After all, it's just a box in Visio. At times like that I'd love to be able to eliminate (all) the lines on a specific diagram.

I'd also like to be able to do this with my 'real' classes, remembering that the diagram in question is a single viewpoint among many; other diagrams would retain all the markup as usual. That way the Visio problem - it's 'just' a box, not a class - has been addressed. It is also easier for me to keep the presentation and the system in sync. [A rare situation, but failing to do so is associated with a high proportion of project failures.]

But no...

David
No, you can't have it!