[umbrello-devel] [umbrello] [Bug 73847] support for UML tagged values

Ralf Habacker ralf.habacker at freenet.de
Thu Dec 4 23:04:37 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=73847

--- Comment #8 from Ralf Habacker <ralf.habacker at freenet.de> ---
(In reply to Oliver Kellogg from comment #7)
> (In reply to Ralf Habacker from comment #6)
> > from http://en.wikipedia.org/wiki/Stereotype_%28UML%29
> > "... From version 2.0 the previously independent tagged value is considered
> > to be a stereotype attribute. " .- which is basically already supported by
> > umbrello [...]
> 
> I don't understand. What do you mean by this?
> As far as I know, stereotype attributes are not supported at all by Umbrello.
The recent state of stereotype support includes implicit the attribute if a
related stereotype is present or not, which theoretical could be also expressed
as an explicit attribute  "present=yes|no" (I'm not saying that we should
implement that, it is only for understanding) 

To support uml 1.4 tagged values, it is required
1. to add a key/value map to class UMLStereotype
2. to extend stereotype xmi  save/load with this map
3. to adapt client code to use UMLStereotype class if not done 
4. to extend the property dialog of class UMLStereotype
5. to extend the property dialogs supporting stereotypes to add/change
stereotype attributes

Just a few ideas:
3.   by using UMLStereotype::name() to get the name 
 5. may be implemented by replacing the current widget code shown below
Classgeneralpage::Classgeneralpage()
... 
    m_pStereoTypeL = new QLabel(i18n("&Stereotype name:"), this);
    m_pNameLayout->addWidget(m_pStereoTypeL, 1, 0);

    m_pStereoTypeCB = new KComboBox(true, this);
    m_pNameLayout->addWidget(m_pStereoTypeCB, 1, 1);

    m_pStereoTypeCB->setItemText(m_pStereoTypeCB->currentIndex(),
m_pObject->stereotype());
    m_pStereoTypeL->setBuddy(m_pStereoTypeCB);

  if (t == UMLObject::ot_Interface || t == UMLObject::ot_Datatype || t ==
UMLObject::ot_Enum)  {
        m_pStereoTypeCB->setEditable(false);

...

by a new dedicated dialog widget class located in
umbrello/dialogs/widgets/umlstereotype.cpp
  UMLStereotypeWidget *widget = new UMLStereotypeWidget
(m_pObject->stereotype());
  if (t == UMLObject::ot_Interface || t == UMLObject::ot_Datatype || t ==
UMLObject::ot_Enum) 
     widget->setEditable(false);
 m_pNameLayout->addWidget(widget);

the latter would also be a preparation for future properties editor support
(see bug 97291)

For full uml 2.0 support it is additional required to support profiles. On a
first run profile support could be reduced to a hard coded default profile
using the current implementation.

BTW: Umbrello supports already a kind of profile support in the code generation
area (one profile for each language)

> BTW thanks for providing the info links.
> Here is a further one:
> http://www.uml-diagrams.org/profile-diagrams.html#tagged-value
This is very useful

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the umbrello-devel mailing list