Home » Modeling » UML2 » Can I control the placement of stereotypes within XMI?
| |
Re: Can I control the placement of stereotypes within XMI? [message #470960 is a reply to message #470953] |
Wed, 21 February 2007 12:31 |
Billy Dennigan Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hi James,
Thanks for the response. I've succeeded in rearranging the order of these
elements by overriding method 'XMLSaveImpl.writeTopObjects(List)', sorting
a copy of the list, and passing this on to 'super.writeTopObjects'.
This has improved the situation because it means that if two users add
elements to the model, the stereotype elements are (usually) inserted at
different locations in the set of stereotypes at the end of the file. So a
conflict does not result and these additions can be merged together
automatically. Previously this scenario would result in a merge conflict
because both developers would each have caused a new element to be added
to the exact same location of the file.
Resolving merge conflicts, when they do occur, in this part of the file is
still very difficult though because these elements are out of context i.e.
separated from their base element. So we've also added a 'logical name'
attribute to our stereotype which we set equal to the 'name' of the base
element and makes it easier to identify each of the stereotype entries.
Another question: when processing the list in
'XMLSaveImpl.writeTopObjects(List)', the second (or third) and subsequent
entries are instances of 'DynamicEObjectImpl' which correspond to my
stereotype entries. Is there an easy way to obtain the EObject class which
corresponds to the core uml object for this stereotype? I want this in
order to be able to determine the name, parent, etc of the underlying uml
object. This would help me improve my afore-mentioned sorting strategy.
Many thanks,
Billy.
|
|
|
Re: Can I control the placement of stereotypes within XMI? [message #470967 is a reply to message #470960] |
Thu, 22 February 2007 03:43 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Billy,
Have a look at UMLUtil.getBaseElement(..). I believe that's what you are
looking for.
- James.
"Billy Dennigan" <bdennigan@curamsoftware.com> wrote in message
news:409521ee3d6cefad81061a6965e39ad5$1@www.eclipse.org...
> Hi James,
>
> Thanks for the response. I've succeeded in rearranging the order of these
> elements by overriding method 'XMLSaveImpl.writeTopObjects(List)', sorting
> a copy of the list, and passing this on to 'super.writeTopObjects'.
>
> This has improved the situation because it means that if two users add
> elements to the model, the stereotype elements are (usually) inserted at
> different locations in the set of stereotypes at the end of the file. So a
> conflict does not result and these additions can be merged together
> automatically. Previously this scenario would result in a merge conflict
> because both developers would each have caused a new element to be added
> to the exact same location of the file.
>
> Resolving merge conflicts, when they do occur, in this part of the file is
> still very difficult though because these elements are out of context i.e.
> separated from their base element. So we've also added a 'logical name'
> attribute to our stereotype which we set equal to the 'name' of the base
> element and makes it easier to identify each of the stereotype entries.
> Another question: when processing the list in
> 'XMLSaveImpl.writeTopObjects(List)', the second (or third) and subsequent
> entries are instances of 'DynamicEObjectImpl' which correspond to my
> stereotype entries. Is there an easy way to obtain the EObject class which
> corresponds to the core uml object for this stereotype? I want this in
> order to be able to determine the name, parent, etc of the underlying uml
> object. This would help me improve my afore-mentioned sorting strategy.
>
> Many thanks,
>
> Billy.
>
>
>
|
|
| | |
Re: Can I control the placement of stereotypes within XMI? [message #588988 is a reply to message #470953] |
Wed, 21 February 2007 12:31 |
Billy Dennigan Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hi James,
Thanks for the response. I've succeeded in rearranging the order of these
elements by overriding method 'XMLSaveImpl.writeTopObjects(List)', sorting
a copy of the list, and passing this on to 'super.writeTopObjects'.
This has improved the situation because it means that if two users add
elements to the model, the stereotype elements are (usually) inserted at
different locations in the set of stereotypes at the end of the file. So a
conflict does not result and these additions can be merged together
automatically. Previously this scenario would result in a merge conflict
because both developers would each have caused a new element to be added
to the exact same location of the file.
Resolving merge conflicts, when they do occur, in this part of the file is
still very difficult though because these elements are out of context i.e.
separated from their base element. So we've also added a 'logical name'
attribute to our stereotype which we set equal to the 'name' of the base
element and makes it easier to identify each of the stereotype entries.
Another question: when processing the list in
'XMLSaveImpl.writeTopObjects(List)', the second (or third) and subsequent
entries are instances of 'DynamicEObjectImpl' which correspond to my
stereotype entries. Is there an easy way to obtain the EObject class which
corresponds to the core uml object for this stereotype? I want this in
order to be able to determine the name, parent, etc of the underlying uml
object. This would help me improve my afore-mentioned sorting strategy.
Many thanks,
Billy.
|
|
|
Re: Can I control the placement of stereotypes within XMI? [message #590484 is a reply to message #470960] |
Thu, 22 February 2007 03:43 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Billy,
Have a look at UMLUtil.getBaseElement(..). I believe that's what you are
looking for.
- James.
"Billy Dennigan" <bdennigan@curamsoftware.com> wrote in message
news:409521ee3d6cefad81061a6965e39ad5$1@www.eclipse.org...
> Hi James,
>
> Thanks for the response. I've succeeded in rearranging the order of these
> elements by overriding method 'XMLSaveImpl.writeTopObjects(List)', sorting
> a copy of the list, and passing this on to 'super.writeTopObjects'.
>
> This has improved the situation because it means that if two users add
> elements to the model, the stereotype elements are (usually) inserted at
> different locations in the set of stereotypes at the end of the file. So a
> conflict does not result and these additions can be merged together
> automatically. Previously this scenario would result in a merge conflict
> because both developers would each have caused a new element to be added
> to the exact same location of the file.
>
> Resolving merge conflicts, when they do occur, in this part of the file is
> still very difficult though because these elements are out of context i.e.
> separated from their base element. So we've also added a 'logical name'
> attribute to our stereotype which we set equal to the 'name' of the base
> element and makes it easier to identify each of the stereotype entries.
> Another question: when processing the list in
> 'XMLSaveImpl.writeTopObjects(List)', the second (or third) and subsequent
> entries are instances of 'DynamicEObjectImpl' which correspond to my
> stereotype entries. Is there an easy way to obtain the EObject class which
> corresponds to the core uml object for this stereotype? I want this in
> order to be able to determine the name, parent, etc of the underlying uml
> object. This would help me improve my afore-mentioned sorting strategy.
>
> Many thanks,
>
> Billy.
>
>
>
|
|
| |
Goto Forum:
Current Time: Fri Apr 26 18:37:32 GMT 2024
Powered by FUDForum. Page generated in 0.03998 seconds
|