Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: Navigating on UML metamodel
Re: Navigating on UML metamodel [message #516099] Mon, 22 February 2010 13:38 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
I think it's best to ask about UML specific details on the UML2
newsgroup, which I've added to the "to" list of the reply, so no need to
repost.



CaribeanAlien wrote:
> Hi,
>
> I would like to create a standalone program able to display the list
> of elements available inside of the UML metamodel. To do this, I've
> tried to register into the resourceSet the path to the UML jar
> (org.eclipse.uml2.uml.resources_2.2.0.v200805131030.jar), as shown in
> the FAQ. Then, my thought was to access to the resource representing
> the UML Metamodel :
> Resource res =
> _resourceSet.getResource(URI.createURI(UMLResource.UML_METAM
> ODEL_URI), true);
> and to navigate over it.
>
> I didn't get error, but unexpected results. When I display elements
> name, It seems to be all the same. A lot of MetaElement, ... But no
> access to the real name! It seems to be a real mess. Does anyone has
> an idea?
> here is the test code I'm working on : http://www.pastebin.com/f44dc1608
>
> I'm currently waiting for the EMF book, hoping this to help me. Thanks
> in advance for any help!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #516123 is a reply to message #516099] Mon, 22 February 2010 19:34 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
............................................................ .................

[Updated on: Wed, 10 March 2010 14:05]

Report message to a moderator

Re: Navigating on UML metamodel [message #516141 is a reply to message #516123] Mon, 22 February 2010 20:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Vlad,

Did you even look at his code? He's trying to load the instances
directly from the jar. It looks okay to me, but I'm not sure what he's
expecting to find once it's loaded. The root object should be an
instance of Model if everything is correct.


Vlad Varnica wrote:
> You need to parse the .uml file. which is in your Package Explorer.
> First identify how is saved the name of the element in the xmi then
> just make a query directly on the xml.
>
> I think it is more simple to query the metamodel once it has been
> already created than during the creation stage :p


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #516348 is a reply to message #516141] Tue, 23 February 2010 11:22 Go to previous messageGo to next message
Tim Myer is currently offline Tim MyerFriend
Messages: 81
Registered: July 2009
Member
From a quick look at the code and without really knowing what the
hoped-for output should look like, I would ask whether changing this line

System.out.println("\t" + esf.getName() + " : " + eobj.eClass().eGet(esf));

to

System.out.println("\t" + esf.getName() + " : " + eobj.eGet(esf));

might give what you are looking for.

Hope that helps!
---Tim---

Ed Merks wrote:
> Vlad,
>
> Did you even look at his code? He's trying to load the instances
> directly from the jar. It looks okay to me, but I'm not sure what he's
> expecting to find once it's loaded. The root object should be an
> instance of Model if everything is correct.
>
>
> Vlad Varnica wrote:
>> You need to parse the .uml file. which is in your Package Explorer.
>> First identify how is saved the name of the element in the xmi then
>> just make a query directly on the xml.
>>
>> I think it is more simple to query the metamodel once it has been
>> already created than during the creation stage :p
Re: Navigating on UML metamodel [message #516488 is a reply to message #516348] Wed, 24 February 2010 08:41 Go to previous messageGo to next message
CaribeanAlien is currently offline CaribeanAlienFriend
Messages: 15
Registered: February 2010
Junior Member
Mmm, I have tried this either unfortunately, but it doesn't change anything.
To explain in better words the result I want to reach, here is my problem :
I need to implement a program loading the UML metamodel, in order to modify it. The first step before the modification is at least to display UML elements.

So this is what I do with my program : I load the jar file, try to parse the correct resource. this is what I get : http://picasaweb.google.com/lh/photo/n-y68jEsK7ks-TkInrZZdQ? feat=directlink

This tool has also the possibility to load any ecore metamodel. So I found an ecore version of the UML metamodel, and tried to load it.
Here is what we can see, it seems to be a much better result, more understandable.
http://picasaweb.google.com/lh/photo/ErucF-ZTGduGOOViZIP6Cw? feat=directlink

That is great! the problem is that I need absolutely to work on the jar, in order to modify the metamodel in the jar (hoping it will be possible to do it...).
Then, the final goal is to use this new metamodel in another EMF program (as source for EMF UML Metamodel, replacing the jar in the line
"URI uri = URI.createURI(" jar:file:/C:/org.eclipse.uml2.uml.resources_2.2.0.v200805131 030.jar!/ ");" in any EMF program.

Do you see my point?

Thank you for the help!
Re: Navigating on UML metamodel [message #516552 is a reply to message #516348] Wed, 24 February 2010 11:50 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
............................................................ ..............

[Updated on: Wed, 10 March 2010 14:03]

Report message to a moderator

Re: Navigating on UML metamodel [message #516559 is a reply to message #516488] Wed, 24 February 2010 11:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Comments below,


CaribeanAlien wrote:
> Mmm, I have tried this either unfortunately, but it doesn't change
> anything. To explain in better words the result I want to reach, here
> is my problem : I need to implement a program loading the UML
> metamodel, in order to modify it. The first step before the
> modification is at least to display UML elements.
> So this is what I do with my program : I load the jar file, try to
> parse the correct resource. this is what I get :
> http://picasaweb.google.com/lh/photo/n-y68jEsK7ks-TkInrZZdQ? feat=directlink
>
The AnyType instances and much of what I see here is what I'd expect if
the namespace in the serialization doesn't end up properly mapping to a
EPackage's nsURI. That likely means you've not registered all the
packages needed to read the instance.
>
> This tool has also the possibility to load any ecore metamodel. So I
> found an ecore version of the UML metamodel, and tried to load it.
> Here is what we can see, it seems to be a much better result, more
> understandable.
> http://picasaweb.google.com/lh/photo/ErucF-ZTGduGOOViZIP6Cw? feat=directlink
>
Yes, this looks like it's working well.
>
> That is great! the problem is that I need absolutely to work on the
> jar, in order to modify the metamodel in the jar (hoping it will be
> possible to do it...). Then, the final goal is to use this new
> metamodel in another EMF program (as source for EMF UML Metamodel,
> replacing the jar in the line "URI uri = URI.createURI("
> jar:file:/C:/org.eclipse.uml2.uml.resources_2.2.0.v200805131 030.jar!/
> ");" in any EMF program.
>
> Do you see my point?
Yes. It's just not clear looking at the source what little thing might
be wrong or missing. It looks like you registered the package
correctly. I tried running it and it worked correctly for me. Go figure.
>
> Thank you for the help!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #516576 is a reply to message #516559] Wed, 24 February 2010 12:56 Go to previous messageGo to next message
CaribeanAlien is currently offline CaribeanAlienFriend
Messages: 15
Registered: February 2010
Junior Member
Ed Merks wrote on Wed, 24 February 2010 06:52
Comments below,


Yes. It's just not clear looking at the source what little thing might
be wrong or missing. It looks like you registered the package
correctly. I tried running it and it worked correctly for me. Go figure.



Are you saying that you succeed in displaying the elements? It's quite new for me, maybe I have correct information, but I need to look deeply into the results. From the TreeIterator I got, I just parse the first level of the tree (shorting it with the prune() method), and I got some elements (mainly the first was "Model", and most of the others were "MetaClass").

So I will try in a close future to check if something is wrong with the registering of packages, but I'm not so convinced about my chances of solving it... Sad

Anyway, if this can help to solve the problem : when I tried to access features of elements, I got this strange thing : I catch the list of features for one element, and then, I parse this list in order to do :
element.get(feature);
=> but sometimes, this instruction returns "element doesn't have this feature", despite the fact that I got the list from the element itself. Isn't it weird?
Re: Navigating on UML metamodel [message #516637 is a reply to message #516576] Wed, 24 February 2010 16:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Comments below.

CaribeanAlien wrote:
> Ed Merks wrote on Wed, 24 February 2010 06:52
>> Comments below,
>>
>>
>> Yes. It's just not clear looking at the source what little thing
>> might be wrong or missing. It looks like you registered the package
>> correctly. I tried running it and it worked correctly for me. Go
>> figure.
>
>
>
> Are you saying that you succeed in displaying the elements?
Yes.
> It's quite new for me, maybe I have correct information, but I need to
> look deeply into the results. From the TreeIterator I got, I just
> parse the first level of the tree (shorting it with the prune()
> method), and I got some elements (mainly the first was "Model", and
> most of the others were "MetaClass").
Not sure what you refer to as "MetaClass". If I eliminate your lookup
loop, I see objects like this:

>org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@2bee2bee
uri='pathmap://UML_METAMODELS/UML.metamodel.uml'
>>org.eclipse.uml2.uml.internal.impl.ModelImpl 2125758132
>>org.eclipse.uml2.uml.internal.impl.PackageImportImpl 624567610
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 360846722
>>org.eclipse.uml2.uml.internal.impl.CommentImpl 806760470
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 845689448
>>org.eclipse.uml2.uml.internal.impl.CommentImpl 859583292
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 882128020
>>org.eclipse.uml2.uml.internal.impl.CommentImpl 1837526406
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 1863085836

Someone has already pointed out that you shouldn't be calling eGet on
the eClass() itself but rather on the instance.

System.out.println("\t" + esf.getName() + " : " + eobj.eGet(esf));
>
> So I will try in a close future to check if something is wrong with
> the registering of packages, but I'm not so convinced about my chances
> of solving it... :(
It looks to me like it's all working correctly. What appears to be wrong?
>
> Anyway, if this can help to solve the problem : when I tried to access
> features of elements, I got this strange thing : I catch the list of
> features for one element, and then, I parse this list in order to do :
> element.get(feature); => but sometimes, this instruction returns
> "element doesn't have this feature", despite the fact that I got the
> list from the element itself. Isn't it weird?
I'm not seeing that either. It helps to very clearly explain your
problem and to provide code others can use to reproduce the issue. This
example works for me: (Obviously you'd have to point it at where the
jar is on your system.)

package snippet;

import java.util.ListIterator;
import java.util.Map;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.resource.UMLResource;

public class Snippet
{
public static void main(String arg[])
{

ResourceSet resourceSet = new ResourceSetImpl();

resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
UMLPackage.eINSTANCE);


resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
Map uriMap = resourceSet.getURIConverter().getURIMap();
URI uri =
URI.createURI(" jar:file:/c:/sandbox/galileo.modeling.sr1/eclipse/plugins/or g.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar!/ ");
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));




System.out.println("[readMM] : try to access to " +
UMLResource.UML_METAMODEL_URI);
Resource res =
resourceSet.getResource(URI.createURI(UMLResource.UML_METAMO DEL_URI), true);
EcoreUtil.resolveAll(res);
System.out.println(">" + res.toString());
TreeIterator<EObject> it = res.getAllContents();

while (it.hasNext())
{
EObject eobj = (EObject)it.next();

System.out.println(">>" + eobj.getClass().getName() + " " +
eobj.hashCode());

if (eobj.eIsProxy())
{
System.out.println("proxy PROBLEM");
System.out.println(eobj.eClass().getName());

EObject eobjResolved = EcoreUtil.resolve(eobj, resourceSet);
if (eobjResolved.equals(eobj))
{
System.err.println("Proxy not solved");
}
else
{
System.out.println("Proxy solved : " +
eobjResolved.hashCode());
eobj = eobjResolved;
}
}

EList<EStructuralFeature> listee =
eobj.eClass().getEAllStructuralFeatures();
ListIterator<EStructuralFeature> li = listee.listIterator();
while (li.hasNext())
{
EStructuralFeature esf = li.next();
try
{
System.out.println("\t" + esf.getName() + " : " +
eobj.eGet(esf));
}
catch (Exception e)
{//e.printStackTrace();

}
}

if (eobj.eClass() instanceof EClass)
{// if
if (eobj.eContainer() == null)
{
System.out.println("this element has a null container : is
it the root element? ");
}
}

//it.prune();


}

}
}


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #516638 is a reply to message #516552] Wed, 24 February 2010 16:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Vlad,

Comments below.

Vlad Varnica wrote:
> The underlying question is "Should we query the in-memory model or the
> one which has been saved on the disk" ?
He's querying the one that's in the jar. He loads it into memory and
then navigates it.
>
> At Omondo I remembered a very bad experience with EMF.
Oh no, not again.
> The developer team said to me they have an EMF model manipulation
> which is in-memory and the used it to create an UML model. It was a
> good idea but the problem was that it was almost impossible to check
> the quality of the model.
Maybe you just can't think of a way rather than it being impossible.
> Finally we have migrated from a in-memory model to a disk model and
> have added unit testing.
And how exactly can one test a disk model without loading it into
memory. You're losing me somewhere.
> The result has been that many elements were not saved correctly and it
> was not possible to check it because the information was in-memory and
> not on the disk.
This seems to be straying very far from the topic of this thread.
> After all this lack of quality we have decided to only use directly
> the UML metamodel and save it on disk.
Could you be more confusing?
> What was the most amazing story is that we have developed EclipseUML
> free edition and studio edition till 2006 modeling tool with very high
> EMF profiles and saving users diagrams with wrong models information.
Sounds horrible. And no one noticed for years until you started saving
them. What were you doing before you saved them? Kept a live running
process going for years?
> Over 300 000 users have used wrong models and nobody never compained
> because they could not check it because the model was in memory !!
> Is-it really the good way to work ?
I doubt anyone can follow what you've described here. It sounds rather
incoherent. Clearly people have been saving and loading instances since
the very beginning.
>
> This is why Ed my first reply was not related to the source code but
> trying to move this user directly use the metamodel and not to be
> stuck in the middle of the mud :). It could have been better for all
> of us not to talk about it.
> don't you think so ?
Yes, it would be better if you didn't talk.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #516656 is a reply to message #516637] Wed, 24 February 2010 16:55 Go to previous messageGo to next message
Tim Myer is currently offline Tim MyerFriend
Messages: 81
Registered: July 2009
Member
Hi CaribeanAlien:

Is it perhaps a version issue?

Just out of curiosity, what does your classpath look like? I was able
to get a result similar to yours when I loaded up the UML2 2.2.0
resources jar (what you have in your code) when using the 3.0 versions
of EMF and UML2 on my classpath. The code works for me, too, when I use
UML2 3.0 resources.

---Tim---


Ed Merks wrote:
> Comments below.
>
> CaribeanAlien wrote:
>> Ed Merks wrote on Wed, 24 February 2010 06:52
>>> Comments below,
>>>
>>>
>>> Yes. It's just not clear looking at the source what little thing
>>> might be wrong or missing. It looks like you registered the package
>>> correctly. I tried running it and it worked correctly for me. Go
>>> figure.
>>
>>
>>
>> Are you saying that you succeed in displaying the elements?
> Yes.
>> It's quite new for me, maybe I have correct information, but I need to
>> look deeply into the results. From the TreeIterator I got, I just
>> parse the first level of the tree (shorting it with the prune()
>> method), and I got some elements (mainly the first was "Model", and
>> most of the others were "MetaClass").
> Not sure what you refer to as "MetaClass". If I eliminate your lookup
> loop, I see objects like this:
>
> >org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@2bee2bee
> uri='pathmap://UML_METAMODELS/UML.metamodel.uml'
> >>org.eclipse.uml2.uml.internal.impl.ModelImpl 2125758132
> >>org.eclipse.uml2.uml.internal.impl.PackageImportImpl 624567610
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 360846722
> >>org.eclipse.uml2.uml.internal.impl.CommentImpl 806760470
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 845689448
> >>org.eclipse.uml2.uml.internal.impl.CommentImpl 859583292
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 882128020
> >>org.eclipse.uml2.uml.internal.impl.CommentImpl 1837526406
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 1863085836
>
> Someone has already pointed out that you shouldn't be calling eGet on
> the eClass() itself but rather on the instance.
>
> System.out.println("\t" + esf.getName() + " : " + eobj.eGet(esf));
>>
>> So I will try in a close future to check if something is wrong with
>> the registering of packages, but I'm not so convinced about my chances
>> of solving it... :(
> It looks to me like it's all working correctly. What appears to be wrong?
>>
>> Anyway, if this can help to solve the problem : when I tried to access
>> features of elements, I got this strange thing : I catch the list of
>> features for one element, and then, I parse this list in order to do :
>> element.get(feature); => but sometimes, this instruction returns
>> "element doesn't have this feature", despite the fact that I got the
>> list from the element itself. Isn't it weird?
> I'm not seeing that either. It helps to very clearly explain your
> problem and to provide code others can use to reproduce the issue. This
> example works for me: (Obviously you'd have to point it at where the
> jar is on your system.)
>
> package snippet;
>
> import java.util.ListIterator;
> import java.util.Map;
>
> import org.eclipse.emf.common.util.EList;
> import org.eclipse.emf.common.util.TreeIterator;
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.ecore.EClass;
> import org.eclipse.emf.ecore.EObject;
> import org.eclipse.emf.ecore.EStructuralFeature;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
> import org.eclipse.emf.ecore.util.EcoreUtil;
> import org.eclipse.uml2.uml.UMLPackage;
> import org.eclipse.uml2.uml.resource.UMLResource;
>
> public class Snippet
> {
> public static void main(String arg[])
> {
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
> resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
> UMLPackage.eINSTANCE);
>
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
> UMLResource.Factory.INSTANCE);
> Map uriMap = resourceSet.getURIConverter().getURIMap();
> URI uri =
> URI.createURI(" jar:file:/c:/sandbox/galileo.modeling.sr1/eclipse/plugins/or g.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar!/ ");
>
> uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
> uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
> uri.appendSegment("metamodels").appendSegment(""));
> uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
> uri.appendSegment("profiles").appendSegment(""));
>
>
> System.out.println("[readMM] : try to access to " +
> UMLResource.UML_METAMODEL_URI);
> Resource res =
> resourceSet.getResource(URI.createURI(UMLResource.UML_METAMO DEL_URI),
> true);
> EcoreUtil.resolveAll(res);
> System.out.println(">" + res.toString());
> TreeIterator<EObject> it = res.getAllContents();
>
> while (it.hasNext())
> {
> EObject eobj = (EObject)it.next();
>
> System.out.println(">>" + eobj.getClass().getName() + " " +
> eobj.hashCode());
>
> if (eobj.eIsProxy())
> {
> System.out.println("proxy PROBLEM");
> System.out.println(eobj.eClass().getName());
>
> EObject eobjResolved = EcoreUtil.resolve(eobj, resourceSet);
> if (eobjResolved.equals(eobj))
> {
> System.err.println("Proxy not solved");
> }
> else
> {
> System.out.println("Proxy solved : " +
> eobjResolved.hashCode());
> eobj = eobjResolved;
> }
> }
>
> EList<EStructuralFeature> listee =
> eobj.eClass().getEAllStructuralFeatures();
> ListIterator<EStructuralFeature> li = listee.listIterator();
> while (li.hasNext())
> {
> EStructuralFeature esf = li.next();
> try
> {
> System.out.println("\t" + esf.getName() + " : " +
> eobj.eGet(esf));
> }
> catch (Exception e)
> {//e.printStackTrace();
>
> }
> }
>
> if (eobj.eClass() instanceof EClass)
> {// if
> if (eobj.eContainer() == null)
> {
> System.out.println("this element has a null container : is
> it the root element? ");
> }
> }
>
> //it.prune();
> }
>
> }
> }
>
>
Re: Navigating on UML metamodel [message #516818 is a reply to message #516656] Thu, 25 February 2010 09:43 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
............................................................ ...............


[Updated on: Wed, 10 March 2010 14:02]

Report message to a moderator

Re: Navigating on UML metamodel [message #516861 is a reply to message #516818] Thu, 25 February 2010 11:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Vlad,

Comments below.

Vlad Varnica wrote:
> It is always a pleasure to get you spicy answer ED :p
I wish I could say the same, but generally my brain hurts trying to
comprehend you commentary.
> It seems that you are confused by what mean in-memory and on disk.
Indeed.
> In memory is the way EMF works today by loading the model.
Not just EMF. Generally something on disk is just bytes until you load
them into memory and decode them into characters and then parse those
characters into something even more meaningful.
> On disk means that your UML model is automatically saved on disk and
> is therefore visible.
Auto save doesn't exactly sound like a stunning innovation.
> If a model is visible then you know exactly what you manipulate and
> you can add unit test to validate the model.
So the model is only the bytes on disk?
> If the model is in-memory then do you really know what you manipulate ?
If the model is bytes on disk it seems to me you know even less about
it. I suppose there's likely some fundamental point I'm missing.
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #516886 is a reply to message #516861] Thu, 25 February 2010 13:16 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
................................




[Updated on: Wed, 10 March 2010 14:02]

Report message to a moderator

Re: Navigating on UML metamodel [message #628241 is a reply to message #516123] Mon, 22 February 2010 20:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Vlad,

Did you even look at his code? He's trying to load the instances
directly from the jar. It looks okay to me, but I'm not sure what he's
expecting to find once it's loaded. The root object should be an
instance of Model if everything is correct.


Vlad Varnica wrote:
> You need to parse the .uml file. which is in your Package Explorer.
> First identify how is saved the name of the element in the xmi then
> just make a query directly on the xml.
>
> I think it is more simple to query the metamodel once it has been
> already created than during the creation stage :p


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #628246 is a reply to message #516141] Tue, 23 February 2010 16:12 Go to previous messageGo to next message
Tim Myer is currently offline Tim MyerFriend
Messages: 81
Registered: July 2009
Member
From a quick look at the code and without really knowing what the
hoped-for output should look like, I would ask whether changing this line

System.out.println("\t" + esf.getName() + " : " + eobj.eClass().eGet(esf));

to

System.out.println("\t" + esf.getName() + " : " + eobj.eGet(esf));

might give what you are looking for.

Hope that helps!
---Tim---

Ed Merks wrote:
> Vlad,
>
> Did you even look at his code? He's trying to load the instances
> directly from the jar. It looks okay to me, but I'm not sure what he's
> expecting to find once it's loaded. The root object should be an
> instance of Model if everything is correct.
>
>
> Vlad Varnica wrote:
>> You need to parse the .uml file. which is in your Package Explorer.
>> First identify how is saved the name of the element in the xmi then
>> just make a query directly on the xml.
>>
>> I think it is more simple to query the metamodel once it has been
>> already created than during the creation stage :p
Re: Navigating on UML metamodel [message #628252 is a reply to message #628246] Wed, 24 February 2010 08:41 Go to previous messageGo to next message
CaribeanAlien is currently offline CaribeanAlienFriend
Messages: 15
Registered: February 2010
Junior Member
Mmm, I have tried this either unfortunately, but it doesn't change anything.
To explain in better words the result I want to reach, here is my problem :
I need to implement a program loading the UML metamodel, in order to modify it. The first step before the modification is at least to display UML elements.

So this is what I do with my program : I load the jar file, try to parse the correct resource. this is what I get : http://picasaweb.google.com/lh/photo/n-y68jEsK7ks-TkInrZZdQ? feat=directlink

This tool has also the possibility to load any ecore metamodel. So I found an ecore version of the UML metamodel, and tried to load it.
Here is what we can see, it seems to be a much better result, more understandable.
http://picasaweb.google.com/lh/photo/ErucF-ZTGduGOOViZIP6Cw? feat=directlink

That is great! the problem is that I need absolutely to work on the jar, in order to modify the metamodel in the jar (hoping it will be possible to do it...).
Then, the final goal is to use this new metamodel in another EMF program (as source for EMF UML Metamodel, replacing the jar in the line
"URI uri = URI.createURI(" jar:file:/C:/org.eclipse.uml2.uml.resources_2.2.0.v200805131 030.jar!/ ");" in any EMF program.

Do you see my point?

Thank you for the help!
Re: Navigating on UML metamodel [message #628253 is a reply to message #628246] Wed, 24 February 2010 11:50 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
The underlying question is "Should we query the in-memory model or the one which has been saved on the disk" ?

At Omondo I remembered a very bad experience with EMF. The developer team said to me they have an EMF model manipulation which is in-memory and the used it to create an UML model. It was a good idea but the problem was that it was almost impossible to check the quality of the model.
Finally we have migrated from a in-memory model to a disk model and have added unit testing. The result has been that many elements were not saved correctly and it was not possible to check it because the information was in-memory and not on the disk. After all this lack of quality we have decided to only use directly the UML metamodel and save it on disk. What was the most amazing story is that we have developed EclipseUML free edition and studio edition till 2006 modeling tool with very high EMF profiles and saving users diagrams with wrong models information. Over 300 000 users have used wrong models and nobody never compained because they could not check it because the model was in memory !!
Is-it really the good way to work ?

This is why Ed my first reply was not related to the source code but trying to move this user directly use the metamodel and not to be stuck in the middle of the mud :).
It could have been better for all of us not to talk about it.
don't you think so ?
Re: Navigating on UML metamodel [message #628254 is a reply to message #628252] Wed, 24 February 2010 11:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Comments below,


CaribeanAlien wrote:
> Mmm, I have tried this either unfortunately, but it doesn't change
> anything. To explain in better words the result I want to reach, here
> is my problem : I need to implement a program loading the UML
> metamodel, in order to modify it. The first step before the
> modification is at least to display UML elements.
> So this is what I do with my program : I load the jar file, try to
> parse the correct resource. this is what I get :
> http://picasaweb.google.com/lh/photo/n-y68jEsK7ks-TkInrZZdQ? feat=directlink
>
The AnyType instances and much of what I see here is what I'd expect if
the namespace in the serialization doesn't end up properly mapping to a
EPackage's nsURI. That likely means you've not registered all the
packages needed to read the instance.
>
> This tool has also the possibility to load any ecore metamodel. So I
> found an ecore version of the UML metamodel, and tried to load it.
> Here is what we can see, it seems to be a much better result, more
> understandable.
> http://picasaweb.google.com/lh/photo/ErucF-ZTGduGOOViZIP6Cw? feat=directlink
>
Yes, this looks like it's working well.
>
> That is great! the problem is that I need absolutely to work on the
> jar, in order to modify the metamodel in the jar (hoping it will be
> possible to do it...). Then, the final goal is to use this new
> metamodel in another EMF program (as source for EMF UML Metamodel,
> replacing the jar in the line "URI uri = URI.createURI("
> jar:file:/C:/org.eclipse.uml2.uml.resources_2.2.0.v200805131 030.jar!/
> ");" in any EMF program.
>
> Do you see my point?
Yes. It's just not clear looking at the source what little thing might
be wrong or missing. It looks like you registered the package
correctly. I tried running it and it worked correctly for me. Go figure.
>
> Thank you for the help!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #628255 is a reply to message #516559] Wed, 24 February 2010 12:56 Go to previous messageGo to next message
CaribeanAlien is currently offline CaribeanAlienFriend
Messages: 15
Registered: February 2010
Junior Member
Ed Merks wrote on Wed, 24 February 2010 06:52
> Comments below,
>
>
> Yes. It's just not clear looking at the source what little thing might
> be wrong or missing. It looks like you registered the package
> correctly. I tried running it and it worked correctly for me. Go figure.



Are you saying that you succeed in displaying the elements? It's quite new for me, maybe I have correct information, but I need to look deeply into the results. From the TreeIterator I got, I just parse the first level of the tree (shorting it with the prune() method), and I got some elements (mainly the first was "Model", and most of the others were "MetaClass").

So I will try in a close future to check if something is wrong with the registering of packages, but I'm not so convinced about my chances of solving it... :(

Anyway, if this can help to solve the problem : when I tried to access features of elements, I got this strange thing : I catch the list of features for one element, and then, I parse this list in order to do :
element.get(feature);
=> but sometimes, this instruction returns "element doesn't have this feature", despite the fact that I got the list from the element itself. Isn't it weird?
Re: Navigating on UML metamodel [message #628257 is a reply to message #628255] Wed, 24 February 2010 16:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Comments below.

CaribeanAlien wrote:
> Ed Merks wrote on Wed, 24 February 2010 06:52
>> Comments below,
>>
>>
>> Yes. It's just not clear looking at the source what little thing
>> might be wrong or missing. It looks like you registered the package
>> correctly. I tried running it and it worked correctly for me. Go
>> figure.
>
>
>
> Are you saying that you succeed in displaying the elements?
Yes.
> It's quite new for me, maybe I have correct information, but I need to
> look deeply into the results. From the TreeIterator I got, I just
> parse the first level of the tree (shorting it with the prune()
> method), and I got some elements (mainly the first was "Model", and
> most of the others were "MetaClass").
Not sure what you refer to as "MetaClass". If I eliminate your lookup
loop, I see objects like this:

>org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@2bee2bee
uri='pathmap://UML_METAMODELS/UML.metamodel.uml'
>>org.eclipse.uml2.uml.internal.impl.ModelImpl 2125758132
>>org.eclipse.uml2.uml.internal.impl.PackageImportImpl 624567610
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 360846722
>>org.eclipse.uml2.uml.internal.impl.CommentImpl 806760470
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 845689448
>>org.eclipse.uml2.uml.internal.impl.CommentImpl 859583292
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 882128020
>>org.eclipse.uml2.uml.internal.impl.CommentImpl 1837526406
>>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 1863085836

Someone has already pointed out that you shouldn't be calling eGet on
the eClass() itself but rather on the instance.

System.out.println("\t" + esf.getName() + " : " + eobj.eGet(esf));
>
> So I will try in a close future to check if something is wrong with
> the registering of packages, but I'm not so convinced about my chances
> of solving it... :(
It looks to me like it's all working correctly. What appears to be wrong?
>
> Anyway, if this can help to solve the problem : when I tried to access
> features of elements, I got this strange thing : I catch the list of
> features for one element, and then, I parse this list in order to do :
> element.get(feature); => but sometimes, this instruction returns
> "element doesn't have this feature", despite the fact that I got the
> list from the element itself. Isn't it weird?
I'm not seeing that either. It helps to very clearly explain your
problem and to provide code others can use to reproduce the issue. This
example works for me: (Obviously you'd have to point it at where the
jar is on your system.)

package snippet;

import java.util.ListIterator;
import java.util.Map;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.resource.UMLResource;

public class Snippet
{
public static void main(String arg[])
{

ResourceSet resourceSet = new ResourceSetImpl();

resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
UMLPackage.eINSTANCE);


resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
Map uriMap = resourceSet.getURIConverter().getURIMap();
URI uri =
URI.createURI(" jar:file:/c:/sandbox/galileo.modeling.sr1/eclipse/plugins/or g.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar!/ ");
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));




System.out.println("[readMM] : try to access to " +
UMLResource.UML_METAMODEL_URI);
Resource res =
resourceSet.getResource(URI.createURI(UMLResource.UML_METAMO DEL_URI), true);
EcoreUtil.resolveAll(res);
System.out.println(">" + res.toString());
TreeIterator<EObject> it = res.getAllContents();

while (it.hasNext())
{
EObject eobj = (EObject)it.next();

System.out.println(">>" + eobj.getClass().getName() + " " +
eobj.hashCode());

if (eobj.eIsProxy())
{
System.out.println("proxy PROBLEM");
System.out.println(eobj.eClass().getName());

EObject eobjResolved = EcoreUtil.resolve(eobj, resourceSet);
if (eobjResolved.equals(eobj))
{
System.err.println("Proxy not solved");
}
else
{
System.out.println("Proxy solved : " +
eobjResolved.hashCode());
eobj = eobjResolved;
}
}

EList<EStructuralFeature> listee =
eobj.eClass().getEAllStructuralFeatures();
ListIterator<EStructuralFeature> li = listee.listIterator();
while (li.hasNext())
{
EStructuralFeature esf = li.next();
try
{
System.out.println("\t" + esf.getName() + " : " +
eobj.eGet(esf));
}
catch (Exception e)
{//e.printStackTrace();

}
}

if (eobj.eClass() instanceof EClass)
{// if
if (eobj.eContainer() == null)
{
System.out.println("this element has a null container : is
it the root element? ");
}
}

//it.prune();


}

}
}


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #628258 is a reply to message #628253] Wed, 24 February 2010 16:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Vlad,

Comments below.

Vlad Varnica wrote:
> The underlying question is "Should we query the in-memory model or the
> one which has been saved on the disk" ?
He's querying the one that's in the jar. He loads it into memory and
then navigates it.
>
> At Omondo I remembered a very bad experience with EMF.
Oh no, not again.
> The developer team said to me they have an EMF model manipulation
> which is in-memory and the used it to create an UML model. It was a
> good idea but the problem was that it was almost impossible to check
> the quality of the model.
Maybe you just can't think of a way rather than it being impossible.
> Finally we have migrated from a in-memory model to a disk model and
> have added unit testing.
And how exactly can one test a disk model without loading it into
memory. You're losing me somewhere.
> The result has been that many elements were not saved correctly and it
> was not possible to check it because the information was in-memory and
> not on the disk.
This seems to be straying very far from the topic of this thread.
> After all this lack of quality we have decided to only use directly
> the UML metamodel and save it on disk.
Could you be more confusing?
> What was the most amazing story is that we have developed EclipseUML
> free edition and studio edition till 2006 modeling tool with very high
> EMF profiles and saving users diagrams with wrong models information.
Sounds horrible. And no one noticed for years until you started saving
them. What were you doing before you saved them? Kept a live running
process going for years?
> Over 300 000 users have used wrong models and nobody never compained
> because they could not check it because the model was in memory !!
> Is-it really the good way to work ?
I doubt anyone can follow what you've described here. It sounds rather
incoherent. Clearly people have been saving and loading instances since
the very beginning.
>
> This is why Ed my first reply was not related to the source code but
> trying to move this user directly use the metamodel and not to be
> stuck in the middle of the mud :). It could have been better for all
> of us not to talk about it.
> don't you think so ?
Yes, it would be better if you didn't talk.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #628259 is a reply to message #516637] Wed, 24 February 2010 16:55 Go to previous messageGo to next message
Tim Myer is currently offline Tim MyerFriend
Messages: 81
Registered: July 2009
Member
Hi CaribeanAlien:

Is it perhaps a version issue?

Just out of curiosity, what does your classpath look like? I was able
to get a result similar to yours when I loaded up the UML2 2.2.0
resources jar (what you have in your code) when using the 3.0 versions
of EMF and UML2 on my classpath. The code works for me, too, when I use
UML2 3.0 resources.

---Tim---


Ed Merks wrote:
> Comments below.
>
> CaribeanAlien wrote:
>> Ed Merks wrote on Wed, 24 February 2010 06:52
>>> Comments below,
>>>
>>>
>>> Yes. It's just not clear looking at the source what little thing
>>> might be wrong or missing. It looks like you registered the package
>>> correctly. I tried running it and it worked correctly for me. Go
>>> figure.
>>
>>
>>
>> Are you saying that you succeed in displaying the elements?
> Yes.
>> It's quite new for me, maybe I have correct information, but I need to
>> look deeply into the results. From the TreeIterator I got, I just
>> parse the first level of the tree (shorting it with the prune()
>> method), and I got some elements (mainly the first was "Model", and
>> most of the others were "MetaClass").
> Not sure what you refer to as "MetaClass". If I eliminate your lookup
> loop, I see objects like this:
>
> >org.eclipse.uml2.uml.internal.resource.UMLResourceImpl@2bee2bee
> uri='pathmap://UML_METAMODELS/UML.metamodel.uml'
> >>org.eclipse.uml2.uml.internal.impl.ModelImpl 2125758132
> >>org.eclipse.uml2.uml.internal.impl.PackageImportImpl 624567610
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 360846722
> >>org.eclipse.uml2.uml.internal.impl.CommentImpl 806760470
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 845689448
> >>org.eclipse.uml2.uml.internal.impl.CommentImpl 859583292
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 882128020
> >>org.eclipse.uml2.uml.internal.impl.CommentImpl 1837526406
> >>org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl 1863085836
>
> Someone has already pointed out that you shouldn't be calling eGet on
> the eClass() itself but rather on the instance.
>
> System.out.println("\t" + esf.getName() + " : " + eobj.eGet(esf));
>>
>> So I will try in a close future to check if something is wrong with
>> the registering of packages, but I'm not so convinced about my chances
>> of solving it... :(
> It looks to me like it's all working correctly. What appears to be wrong?
>>
>> Anyway, if this can help to solve the problem : when I tried to access
>> features of elements, I got this strange thing : I catch the list of
>> features for one element, and then, I parse this list in order to do :
>> element.get(feature); => but sometimes, this instruction returns
>> "element doesn't have this feature", despite the fact that I got the
>> list from the element itself. Isn't it weird?
> I'm not seeing that either. It helps to very clearly explain your
> problem and to provide code others can use to reproduce the issue. This
> example works for me: (Obviously you'd have to point it at where the
> jar is on your system.)
>
> package snippet;
>
> import java.util.ListIterator;
> import java.util.Map;
>
> import org.eclipse.emf.common.util.EList;
> import org.eclipse.emf.common.util.TreeIterator;
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.ecore.EClass;
> import org.eclipse.emf.ecore.EObject;
> import org.eclipse.emf.ecore.EStructuralFeature;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
> import org.eclipse.emf.ecore.util.EcoreUtil;
> import org.eclipse.uml2.uml.UMLPackage;
> import org.eclipse.uml2.uml.resource.UMLResource;
>
> public class Snippet
> {
> public static void main(String arg[])
> {
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
> resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
> UMLPackage.eINSTANCE);
>
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
> UMLResource.Factory.INSTANCE);
> Map uriMap = resourceSet.getURIConverter().getURIMap();
> URI uri =
> URI.createURI(" jar:file:/c:/sandbox/galileo.modeling.sr1/eclipse/plugins/or g.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar!/ ");
>
> uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
> uri.appendSegment("libraries").appendSegment(""));
> uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
> uri.appendSegment("metamodels").appendSegment(""));
> uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
> uri.appendSegment("profiles").appendSegment(""));
>
>
> System.out.println("[readMM] : try to access to " +
> UMLResource.UML_METAMODEL_URI);
> Resource res =
> resourceSet.getResource(URI.createURI(UMLResource.UML_METAMO DEL_URI),
> true);
> EcoreUtil.resolveAll(res);
> System.out.println(">" + res.toString());
> TreeIterator<EObject> it = res.getAllContents();
>
> while (it.hasNext())
> {
> EObject eobj = (EObject)it.next();
>
> System.out.println(">>" + eobj.getClass().getName() + " " +
> eobj.hashCode());
>
> if (eobj.eIsProxy())
> {
> System.out.println("proxy PROBLEM");
> System.out.println(eobj.eClass().getName());
>
> EObject eobjResolved = EcoreUtil.resolve(eobj, resourceSet);
> if (eobjResolved.equals(eobj))
> {
> System.err.println("Proxy not solved");
> }
> else
> {
> System.out.println("Proxy solved : " +
> eobjResolved.hashCode());
> eobj = eobjResolved;
> }
> }
>
> EList<EStructuralFeature> listee =
> eobj.eClass().getEAllStructuralFeatures();
> ListIterator<EStructuralFeature> li = listee.listIterator();
> while (li.hasNext())
> {
> EStructuralFeature esf = li.next();
> try
> {
> System.out.println("\t" + esf.getName() + " : " +
> eobj.eGet(esf));
> }
> catch (Exception e)
> {//e.printStackTrace();
>
> }
> }
>
> if (eobj.eClass() instanceof EClass)
> {// if
> if (eobj.eContainer() == null)
> {
> System.out.println("this element has a null container : is
> it the root element? ");
> }
> }
>
> //it.prune();
> }
>
> }
> }
>
>
Re: Navigating on UML metamodel [message #628263 is a reply to message #516656] Thu, 25 February 2010 09:43 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
It is always a pleasure to get you spicy answer ED :p

It seems that you are confused by what mean in-memory and on disk. In memory is the way EMF works today by loading the model. On disk means that your UML model is automatically saved on disk and is therefore visible.
If a model is visible then you know exactly what you manipulate and you can add unit test to validate the model. If the model is in-memory then do you really know what you manipulate ?
Re: Navigating on UML metamodel [message #628264 is a reply to message #628263] Thu, 25 February 2010 11:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Vlad,

Comments below.

Vlad Varnica wrote:
> It is always a pleasure to get you spicy answer ED :p
I wish I could say the same, but generally my brain hurts trying to
comprehend you commentary.
> It seems that you are confused by what mean in-memory and on disk.
Indeed.
> In memory is the way EMF works today by loading the model.
Not just EMF. Generally something on disk is just bytes until you load
them into memory and decode them into characters and then parse those
characters into something even more meaningful.
> On disk means that your UML model is automatically saved on disk and
> is therefore visible.
Auto save doesn't exactly sound like a stunning innovation.
> If a model is visible then you know exactly what you manipulate and
> you can add unit test to validate the model.
So the model is only the bytes on disk?
> If the model is in-memory then do you really know what you manipulate ?
If the model is bytes on disk it seems to me you know even less about
it. I suppose there's likely some fundamental point I'm missing.
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Navigating on UML metamodel [message #628275 is a reply to message #516861] Thu, 25 February 2010 13:16 Go to previous message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Quote:
> I suppose there's likely some fundamental point I'm missing.


I think so !!
Previous Topic:Incoming flows of a decision node
Next Topic:Semantics of Association and Aggregation/Composition
Goto Forum:
  


Current Time: Tue Apr 16 07:19:51 GMT 2024

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

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

Back to the top