Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to check two models against each other
How to check two models against each other [message #474379] Wed, 18 July 2007 15:10 Go to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
Re: How to check two models against each other [message #474382 is a reply to message #474379] Wed, 18 July 2007 18:01 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator<EObject> eAllContents =
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject = eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <eclipse@janreimone.de> wrote in message
news:f7lah5$u4j$1@build.eclipse.org...
> It's me again :)
> At first I have to say that I haven't really thought about what I'll
> describe. I just have some ideas but not a real solution.
> From another Tool a uml-file is generated containing a model. The model
> contains all things you can imagine ;) Well, some classe, a StateMachine
> and so on. When my program is running this uml-file will be loaded and I
> can read from it. So far so good.
> Now I want to check if the generation was correct. So I created another
> model representing the same as the model loaded from my uml-file. The
> idea is, that the Eclipse-UML2-methods will create a correct model. So I
> want to compare both. But how can I do this exactly? Load all elements
> in two ELists and then simply compare each element?
> What do you think?
>
> greets
> J.R.
Re: How to check two models against each other [message #474383 is a reply to message #474382] Wed, 18 July 2007 18:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070200000509020602050606
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

James,

There's the new compare framework in the EMFT project now too and I
think it has specialized code for UML2.

http://www.eclipse.org/emft/projects/compare/


James Bruck wrote:
> Hi Jan,
>
> You could walk each model using a tree iterator starting at the root and
> compare each item ... something like...
>
> for(TreeIterator<EObject> eAllContents =
> ((EObject)object).eAllContents();eAllContents.hasNext();){
> EObject childEObject = eAllContents.next();
> }
>
> If you want to get really fancy you can have a look at the matchers in
> UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
> UML2Util.
>
> Hope that helps.
>
> - James.
>
>
> "Jan Reimann" <eclipse@janreimone.de> wrote in message
> news:f7lah5$u4j$1@build.eclipse.org...
>
>> It's me again :)
>> At first I have to say that I haven't really thought about what I'll
>> describe. I just have some ideas but not a real solution.
>> From another Tool a uml-file is generated containing a model. The model
>> contains all things you can imagine ;) Well, some classe, a StateMachine
>> and so on. When my program is running this uml-file will be loaded and I
>> can read from it. So far so good.
>> Now I want to check if the generation was correct. So I created another
>> model representing the same as the model loaded from my uml-file. The
>> idea is, that the Eclipse-UML2-methods will create a correct model. So I
>> want to compare both. But how can I do this exactly? Load all elements
>> in two ELists and then simply compare each element?
>> What do you think?
>>
>> greets
>> J.R.
>>
>
>
>


--------------070200000509020602050606
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
James,<br>
<br>
There's the new compare framework in the EMFT project now too and I
think it has specialized code for UML2.<br>
<blockquote><a href="http://www.eclipse.org/emft/projects/compare/">http://www.eclipse.org/emft/projects/compare/</a><br>
</blockquote>
<br>
James Bruck wrote:
<blockquote cite="mid:f7lki9$20j$2@build.eclipse.org" type="cite">
<pre wrap="">Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator&lt;EObject&gt; eAllContents =
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject = eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <a class="moz-txt-link-rfc2396E" href="mailto:eclipse@janreimone.de">&lt;eclipse@janreimone.de&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:f7lah5$u4j$1@build.eclipse.org">news:f7lah5$u4j$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------070200000509020602050606--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to check two models against each other [message #474384 is a reply to message #474383] Thu, 19 July 2007 02:42 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0070_01C7C98C.ECAA80F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Cool .. I'm liking that answer better than mine.

- James
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:f7ll3m$7me$1@build.eclipse.org...
James,

There's the new compare framework in the EMFT project now too and I =
think it has specialized code for UML2.

http://www.eclipse.org/emft/projects/compare/


James Bruck wrote:=20
Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator<EObject> eAllContents =3D
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject =3D eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <eclipse@janreimone.de> wrote in message
news:f7lah5$u4j$1@build.eclipse.org...
It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
=20

=20

------=_NextPart_000_0070_01C7C98C.ECAA80F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.3132" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Cool&nbsp;.. I'm liking that answer =
better than=20
mine.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>- James</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:f7ll3m$7me$1@build.eclipse.org">news:f7ll3m$7me$1@build.ecli=
pse.org</A>...</DIV>James,<BR><BR>There's=20
the new compare framework in the EMFT project now too and I think it =
has=20
specialized code for UML2.<BR>
<BLOCKQUOTE><A=20
=
href=3D"http://www.eclipse.org/emft/projects/compare/">http://www.eclipse=
..org/emft/projects/compare/</A><BR></BLOCKQUOTE><BR>James=20
Bruck wrote:=20
<BLOCKQUOTE cite=3Dmid:f7lki9$20j$2@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator&lt;EObject&gt; eAllContents =3D
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject =3D eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:eclipse@janreimone.de">&lt;eclipse@janreimone.de&gt;</A> =
wrote in message
<A class=3Dmoz-txt-link-freetext =
href=3D"news:f7lah5$u4j$1@build.eclipse.org">news:f7lah5$u4j$1@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0070_01C7C98C.ECAA80F0--
Re: How to check two models against each other [message #474385 is a reply to message #474383] Thu, 19 July 2007 10:04 Go to previous messageGo to next message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Ed Merks schrieb:
> There's the new compare framework in the EMFT project now too and I
> think it has specialized code for UML2.
>
> http://www.eclipse.org/emft/projects/compare/

Sounds great. I'll try it and let you know how it does its job ;)

greets
J.R.
Re: How to check two models against each other [message #474386 is a reply to message #474385] Thu, 19 July 2007 11:03 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080907090000050305090809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

JR,

For questions specific to the compare framework, please use the EMFT
newsgroup and prefix the posting with [EMF Compare].

news://news.eclipse.org/eclipse.technology.emft

The guys working on this component are being very helpful on the newsgroup.


Jan Reimann wrote:
> Ed Merks schrieb:
>> There's the new compare framework in the EMFT project now too and I
>> think it has specialized code for UML2.
>>
>> http://www.eclipse.org/emft/projects/compare/
>
> Sounds great. I'll try it and let you know how it does its job ;)
>
> greets
> J.R.


--------------080907090000050305090809
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
JR,<br>
<br>
For questions specific to the compare framework, please use the EMFT
newsgroup and prefix the posting with [EMF Compare].<br>
<blockquote><a href="news://news.eclipse.org/eclipse.technology.emft">news://news.eclipse.org/eclipse.technology.emft</a><br>
</blockquote>
The guys working on this component are being very helpful on the
newsgroup.<br>
<br>
<br>
Jan Reimann wrote:
<blockquote cite="mid:f7ncv0$um$1@build.eclipse.org" type="cite">Ed
Merks schrieb:
<br>
<blockquote type="cite">There's the new compare framework in the EMFT
project now too and I think it has specialized code for UML2.
<br>
<br>
&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emft/projects/compare/">http://www.eclipse.org/emft/projects/compare/</a>
<br>
</blockquote>
<br>
Sounds great. I'll try it and let you know how it does its job ;)
<br>
<br>
greets
<br>
J.R.
<br>
</blockquote>
<br>
</body>
</html>

--------------080907090000050305090809--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to check two models against each other [message #623759 is a reply to message #474379] Wed, 18 July 2007 18:01 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator<EObject> eAllContents =
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject = eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <eclipse@janreimone.de> wrote in message
news:f7lah5$u4j$1@build.eclipse.org...
> It's me again :)
> At first I have to say that I haven't really thought about what I'll
> describe. I just have some ideas but not a real solution.
> From another Tool a uml-file is generated containing a model. The model
> contains all things you can imagine ;) Well, some classe, a StateMachine
> and so on. When my program is running this uml-file will be loaded and I
> can read from it. So far so good.
> Now I want to check if the generation was correct. So I created another
> model representing the same as the model loaded from my uml-file. The
> idea is, that the Eclipse-UML2-methods will create a correct model. So I
> want to compare both. But how can I do this exactly? Load all elements
> in two ELists and then simply compare each element?
> What do you think?
>
> greets
> J.R.
Re: How to check two models against each other [message #623900 is a reply to message #474382] Wed, 18 July 2007 18:10 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070200000509020602050606
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

James,

There's the new compare framework in the EMFT project now too and I
think it has specialized code for UML2.

http://www.eclipse.org/emft/projects/compare/


James Bruck wrote:
> Hi Jan,
>
> You could walk each model using a tree iterator starting at the root and
> compare each item ... something like...
>
> for(TreeIterator<EObject> eAllContents =
> ((EObject)object).eAllContents();eAllContents.hasNext();){
> EObject childEObject = eAllContents.next();
> }
>
> If you want to get really fancy you can have a look at the matchers in
> UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
> UML2Util.
>
> Hope that helps.
>
> - James.
>
>
> "Jan Reimann" <eclipse@janreimone.de> wrote in message
> news:f7lah5$u4j$1@build.eclipse.org...
>
>> It's me again :)
>> At first I have to say that I haven't really thought about what I'll
>> describe. I just have some ideas but not a real solution.
>> From another Tool a uml-file is generated containing a model. The model
>> contains all things you can imagine ;) Well, some classe, a StateMachine
>> and so on. When my program is running this uml-file will be loaded and I
>> can read from it. So far so good.
>> Now I want to check if the generation was correct. So I created another
>> model representing the same as the model loaded from my uml-file. The
>> idea is, that the Eclipse-UML2-methods will create a correct model. So I
>> want to compare both. But how can I do this exactly? Load all elements
>> in two ELists and then simply compare each element?
>> What do you think?
>>
>> greets
>> J.R.
>>
>
>
>


--------------070200000509020602050606
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
James,<br>
<br>
There's the new compare framework in the EMFT project now too and I
think it has specialized code for UML2.<br>
<blockquote><a href="http://www.eclipse.org/emft/projects/compare/">http://www.eclipse.org/emft/projects/compare/</a><br>
</blockquote>
<br>
James Bruck wrote:
<blockquote cite="mid:f7lki9$20j$2@build.eclipse.org" type="cite">
<pre wrap="">Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator&lt;EObject&gt; eAllContents =
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject = eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <a class="moz-txt-link-rfc2396E" href="mailto:eclipse@janreimone.de">&lt;eclipse@janreimone.de&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:f7lah5$u4j$1@build.eclipse.org">news:f7lah5$u4j$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
<br>
</body>
</html>

--------------070200000509020602050606--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to check two models against each other [message #623901 is a reply to message #474383] Thu, 19 July 2007 02:42 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.

------=_NextPart_000_0070_01C7C98C.ECAA80F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Cool .. I'm liking that answer better than mine.

- James
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:f7ll3m$7me$1@build.eclipse.org...
James,

There's the new compare framework in the EMFT project now too and I =
think it has specialized code for UML2.

http://www.eclipse.org/emft/projects/compare/


James Bruck wrote:=20
Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator<EObject> eAllContents =3D
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject =3D eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <eclipse@janreimone.de> wrote in message
news:f7lah5$u4j$1@build.eclipse.org...
It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
=20

=20

------=_NextPart_000_0070_01C7C98C.ECAA80F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2900.3132" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Cool&nbsp;.. I'm liking that answer =
better than=20
mine.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>- James</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:f7ll3m$7me$1@build.eclipse.org">news:f7ll3m$7me$1@build.ecli=
pse.org</A>...</DIV>James,<BR><BR>There's=20
the new compare framework in the EMFT project now too and I think it =
has=20
specialized code for UML2.<BR>
<BLOCKQUOTE><A=20
=
href=3D"http://www.eclipse.org/emft/projects/compare/">http://www.eclipse=
..org/emft/projects/compare/</A><BR></BLOCKQUOTE><BR>James=20
Bruck wrote:=20
<BLOCKQUOTE cite=3Dmid:f7lki9$20j$2@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi Jan,

You could walk each model using a tree iterator starting at the root and
compare each item ... something like...

for(TreeIterator&lt;EObject&gt; eAllContents =3D
((EObject)object).eAllContents();eAllContents.hasNext();){
EObject childEObject =3D eAllContents.next();
}

If you want to get really fancy you can have a look at the matchers in
UMLUtil ... have a look for TypeMatcher, or EStrucuralFeatureMatcher in
UML2Util.

Hope that helps.

- James.


"Jan Reimann" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:eclipse@janreimone.de">&lt;eclipse@janreimone.de&gt;</A> =
wrote in message
<A class=3Dmoz-txt-link-freetext =
href=3D"news:f7lah5$u4j$1@build.eclipse.org">news:f7lah5$u4j$1@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">It's me again :)
At first I have to say that I haven't really thought about what I'll
describe. I just have some ideas but not a real solution.
From another Tool a uml-file is generated containing a model. The model
contains all things you can imagine ;) Well, some classe, a StateMachine
and so on. When my program is running this uml-file will be loaded and I
can read from it. So far so good.
Now I want to check if the generation was correct. So I created another
model representing the same as the model loaded from my uml-file. The
idea is, that the Eclipse-UML2-methods will create a correct model. So I
want to compare both. But how can I do this exactly? Load all elements
in two ELists and then simply compare each element?
What do you think?

greets
J.R.
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0070_01C7C98C.ECAA80F0--
Re: How to check two models against each other [message #623902 is a reply to message #474383] Thu, 19 July 2007 10:04 Go to previous message
Jan Reimann is currently offline Jan ReimannFriend
Messages: 90
Registered: July 2009
Member
Ed Merks schrieb:
> There's the new compare framework in the EMFT project now too and I
> think it has specialized code for UML2.
>
> http://www.eclipse.org/emft/projects/compare/

Sounds great. I'll try it and let you know how it does its job ;)

greets
J.R.
Re: How to check two models against each other [message #623904 is a reply to message #474385] Thu, 19 July 2007 11:03 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080907090000050305090809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

JR,

For questions specific to the compare framework, please use the EMFT
newsgroup and prefix the posting with [EMF Compare].

news://news.eclipse.org/eclipse.technology.emft

The guys working on this component are being very helpful on the newsgroup.


Jan Reimann wrote:
> Ed Merks schrieb:
>> There's the new compare framework in the EMFT project now too and I
>> think it has specialized code for UML2.
>>
>> http://www.eclipse.org/emft/projects/compare/
>
> Sounds great. I'll try it and let you know how it does its job ;)
>
> greets
> J.R.


--------------080907090000050305090809
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
JR,<br>
<br>
For questions specific to the compare framework, please use the EMFT
newsgroup and prefix the posting with [EMF Compare].<br>
<blockquote><a href="news://news.eclipse.org/eclipse.technology.emft">news://news.eclipse.org/eclipse.technology.emft</a><br>
</blockquote>
The guys working on this component are being very helpful on the
newsgroup.<br>
<br>
<br>
Jan Reimann wrote:
<blockquote cite="mid:f7ncv0$um$1@build.eclipse.org" type="cite">Ed
Merks schrieb:
<br>
<blockquote type="cite">There's the new compare framework in the EMFT
project now too and I think it has specialized code for UML2.
<br>
<br>
&nbsp;&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.eclipse.org/emft/projects/compare/">http://www.eclipse.org/emft/projects/compare/</a>
<br>
</blockquote>
<br>
Sounds great. I'll try it and let you know how it does its job ;)
<br>
<br>
greets
<br>
J.R.
<br>
</blockquote>
<br>
</body>
</html>

--------------080907090000050305090809--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:new Problem on applieng a StereoType
Next Topic:XMI question wrt Association
Goto Forum:
  


Current Time: Fri Mar 29 02:10:05 GMT 2024

Powered by FUDForum. Page generated in 0.05611 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top