Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor
Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor [message #1775680] Fri, 03 November 2017 09:54 Go to next message
Jonathan Thöne is currently offline Jonathan ThöneFriend
Messages: 2
Registered: November 2017
Junior Member
Hello,

I have this small Xcore Model:

@Ecore(nsURI="something")
package com.contiautomotive.iip.cofmk.parameterLibrary

class ParameterLibrary {
	  String name
	  contains Parameter[] parameters
}

class Parameter {
	  String name
  boolean optional
	  ParameterTypes parameterType
  Blocks attachedBlock
}

enum ParameterTypes {
	  BOOLEAN = 0
	  STRING = 1
	  REAL = 2
	  INTEGER = 3
}

enum Blocks {
	  GLOBAL = 0
	  SYSTEM = 1
	  IEE = 2
	  PROCESS = 3
	  INSTANCE = 4
	  PROVIDEDPORT = 5
	  REQUIREDPORT = 6
}


If I now create a new Dynamic Instance of the class ParameterLibrary, open it with the Sample Reflective Ecore Model Editor and add a child Parameter, the Editor looks like the attached image "Before_Deleting.png"

If I now try to delete the Parameter i added to the ParameterLibrary before, it takes the Editor about 2(!) minutes (!!!) to delete the Parameter. But not only that it takes so long to delete the Parameter but also the Editor looks now realy strange. (see attached image "After_Deleting.png")

Anyone who can help me with this?
If i create a corresponding Ecore Model with the same functionality the Editor works just fine. Unfortunately i have to use Xcore in my project, so i would really appreciate if some good give me advise on this problem.
Re: Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor [message #1775728 is a reply to message #1775680] Sat, 04 November 2017 08:05 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 29115
Registered: July 2009
Senior Member
That's all expected, though not very nice, behavior. The Xcore model uses XBase, and that uses the JVM model to represent all the Java classes visible to the model where each *.class is loaded as a resource. When you delete something, the entire resource set is traversed to find any incoming references to the object being deleted. With such a big resource set, that takes long and of course forces all proxies to resolve, fully populating the resource set. Of course it's impossible for any of these "metadata" resources to reference the object being deleted so in principle that could be better optimized. But in the end, the dynamic editor is useful for testing, not doesn't seem very practical as an actual product editor...
Re: Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor [message #1775736 is a reply to message #1775728] Sat, 04 November 2017 11:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11585
Registered: July 2009
Senior Member
i wonder why it is 2 minutes. are you using java 9?. xtext(xbase) and thus xcore performance is terribly bad with java 9.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=526209
dont use xtext or xcore with j9.

=> it should be better if

BREE in Manifest is:
Bundle-RequiredExecutionEnvironment: JavaSE-1.8

JRE in .classpath is:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>

java compiler setting in .settings/org.eclipse.jdt.core.prefs is
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8



Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com

[Updated on: Sat, 04 November 2017 11:48]

Report message to a moderator

Re: Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor [message #1775767 is a reply to message #1775736] Mon, 06 November 2017 07:51 Go to previous messageGo to next message
Jonathan Thöne is currently offline Jonathan ThöneFriend
Messages: 2
Registered: November 2017
Junior Member
Thanks for your replies. I am using Java 8 in the project, so i don't think the behavior is caused by xtext/xbase problems with Java 9. What Ed wrote confirms what i suspected after Debugging the whole deleting process.
Re: Deleting Model Elements of an Dynamic Xcore Instance with Sample Reflective Ecore Model Editor [message #1775786 is a reply to message #1775767] Mon, 06 November 2017 12:24 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11585
Registered: July 2009
Senior Member
yes but that should never ever take 2 mins

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Previous Topic:[CDO] High Available CDO servers
Next Topic:newcomer question: automatic live validation
Goto Forum:
  


Current Time: Wed Jan 17 05:42:12 GMT 2018

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

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