Id,OwnerUserId,CreationDate,Tags,AnswerCount,CommentCount,FavoriteCount,ViewCount,Score,Title,Body "21091","1793","2008-08-21 20:29:48","","9","0","4","1316","7","Do you use MDA/MDD/MDSD, any kind of model-driven approach? Will it be the future?","

Programming languages had several (r)evolutionary steps in their history. Some people argue that model-driven approaches will be The Next Big Thing. There are tools like openArchitectureWare, AndroMDA, Sculptor/Fornax Platform etc. that promise incredible productivity boosts. However, I made the experience that it is either rather easy in the beginning to get started but as well to get stuck at some point when you try something that was unanticipated or pretty hard to find enough information that tells you how to start your project because there may be a lot of things to consider.

I think an important insight to get anything out of model-driven something is to understand that the model is not necessarily a set of nice pictures or tree model or UML, but may as well be a textual description (e.g. a state machine, business rules etc.).

What do you think and what does your experience tell you? Is there a future for model-driven development (or whatever you may want to call it)?

Update: There does not seem to be a lot of interest in this topic. Please let me know, if you have any (good or bad) experience with model-driven approaches or why you think it's not interesting at all.

" "51660","123","2008-09-09 11:38:54","","7","0","1","1048","5","Metamodelling tools","

What tools are available for metamodelling?

Especially for developing diagram editors, at the moment trying out Eclipse GMF

Wondering what other options are out there? Any comparison available?

" "70781","11562","2008-09-16 09:41:12","","8","0","3","1190","9","What do you think of Model-driven Software Development?","

I'm really interested to hear what you think about Model-driven Software Development for Java and/or .NET.

Does it save time? Does it improve quality?

" "119815","3966","2008-09-23 08:23:29","","1","0","","442","1","Transform .HBM model to annotated pojos","

We have our domain model declared in rusty old hbm files, we wish to move to POJOs annotated with the javax.persistence.* annotations.

Has anyone had experience doing so?

Are there tools that we could employ?

" "262279","2894","2008-11-04 16:13:04","","5","0","1","778","3","Tools (Best Practices?) for model driven development?","

Model Driven Software Development.

As I understand it it raises the abstraction level of the design to better reflect the domain the software will attempt to run in. That's alot to say in just one sentence.

The communication between the domain experts (customer) and the developers is crucial to make this methodology work. What I want to know is if there is a tool suite or set of best practices that will help in the initial thrust of MDSD? Once the domain is fleshed out what about mapping that model to an ORM (or whatever)?

I am just diving into the realm of MDSD and DSL so any constructive ideas or comments will be appriciated.

" "308803","","2008-11-21 13:43:45","","3","0","3","1040","4","What is model driven development good for?","

Microsoft, of Cairo fame, is working on Oslo, a new modeling platform. Bob Muglia, Senior Vice President of Microsoft Server & Tools Business, states that the benefits of modeling have always been clear.

In simple, practical terms, what are the clear benefits that Oslo bestows upon its users?

" "620188","74806","2009-03-06 19:49:53","","6","0","","7972","4","Recommended Model Based Testing Tools","

Does anyone have any suggestions on what Model Based Testing Tools to use? Is Spec Explorer/SPEC# worth it's weight in tester training?

What I have traditionally done is create a Visio Model where I call out the states and associated variables, outputs and expected results from each state. Then in a completely disconnected way, I data drive my test scripts with those variables based on that model. But, they are not connected. I want a way to create a model, associate the variables in a business friendly way, that will then build the data parameters for the scripts.

I can't be the first person to need this. Is there a tool out there that will do basically that? Short of developing it myself.

" "656522","76661","2009-03-18 00:18:28","","2","0","","532","3","Real-World QVT","

QVT (Query View Transformation) is a OMG specification of a Model-to-Model transformation language. Some tools already implement it (Eclipse, androMDA). I'm wondering whether it is really used in real-world cases. Will it ever take off and be used to tackle real-world problems? Is anybody using the QVT language?

" "696021","80112","2009-03-30 04:46:17","","6","0","6","1521","9","Are you doing MDA (Model Driven Architecture) right now? If so, what tools do you use, and how is it working out?","

Model Driven Architecture is the idea that you create models which express the problem you need to solve in a way that is free of any (or at least most) implementation technologies, and then you generate implementation for one or more specific platforms. The claim is that working at a higher level of abstraction is far more powerful and productive. In addition, your models outlive technologies (so you still have something when your first language / platform becomes obsolete that you can use for your next generation solution). Another key claimed benefit is that much of the boilerplate and ""grunt work"" can be generated. Once the computer understands the semantics of your situation, it can help you more.

Some claim this approach is 10 times more productive, and that it is the way we will all be building software in 10 years.

However, this is all just theory. I am wondering what the outcomes are when the rubber meets the road. Also, the ""official"" version of MDA is from the OMG, and seems very heavy. It is heavily based on UML, which might be considered good or bad depending on who you ask (I'm leaning towards ""bad"").

But, in spite of those concerns, it is hard to argue with the idea of working at a higher level of abstraction and ""teaching"" the computer to understand the semantics of your problem and solution. Imagine a series of ER models which simply express truth, and then imagine using those to generate a significant portion of your solution, first in one set of technologies and then again in another set of technologies.

So, I'd love to hear from people who really are doing MDA right now (""official"" or not). What tools are you using? How is it working out? How much of the theoretical promise have you been able to capture? Do you see a true 10X effectiveness increase?

" "1026496","126789","2009-06-22 10:43:03","","1","0","1","641","1","Unified Process and UML confusion","

Im a bit uncertain about the relation between the Unified Modeling Language (UML) and the different modelling perspectives (conceptual, specification and impelementation) endorsed by (R)UP among other OOA/D methodologies.

From what I understand the same type of diagram using the same notation can have different meaning depending on the perspective* being used. For instance the class diagram can represent an abstraction of real world systems / phenomena in the conceptual perspective and when perspective is later changed to specification/implementation the class diagram is used to abstract constructs of a computer program.

Questions:

1) It is my understanding that certain rules exist for a UML class diagram in general. For instance that a class can extend another class but that it can't extend an association. Where are the entities of the class diagram and the rules about how they can relate defined? Does it all take place at the M2 layer in the UML metamodeling architecture (see wikipedias illustratio of metamodel architecture)?

2) A related question. The way I see it, the general rules for a specific diagram span the modelling perspectives (again, it is absurd for a class to extend an association), but the different modelling perspectives will superimpose certain meaning to a particular type of diagram. For instance an association in the class diagram of the domain model (conceptual perspective) will inherently be bidirectional whereas it can be either bi- or unidirectional in the class diagram of the design model (specification / implementation perspective).

In the scenario just described the rule superimposed limits the properties of an association. Is it a correct assumption that rules superimposed by perspectives will always be a subset/limitation of the rules defined by the uml metamodel and never a superset?

Are these rules/limitations defined by the perspectives formalized (in a way similar to the metamodel) or are they mere conventions described in the OOA/D litterature?

* Perspectives are explained in paragraph 10.8: http://books.google.co.uk/books?id=r8i-4En_aa4C&printsec=frontcover&hl=da&source=gbs_v2_summary_r&cad=0

" "1864578","78453","2009-12-08 04:25:26","","4","0","2","1177","3","What are good tools for using Model Driven Development with Embedded work?","

I believe there has been some up-take of model-driven development / engineering (aka OMGs model driven architecture) in the real-time and embedded software development sectors. What tools and tool vendors have people had experience with?

Google gives me lots of academic papers and a vendor or two (IBMs Rational Rose Technical Developer and VisSim).

Additionally, any information on model format (UML?), target languages/environments for the platform specific models (C? RTOSs?), and testing (logic-based?) would be greatly appreciated.

" "1872955","226480","2009-12-09 10:21:02","","1","0","0","1130","0","Rhapsody TestConductor Experiences","

I was wondering whether anybody out there is actively using Rhapsody TestConductor? Or has tried it for a while, but then decided to turn it down for a particular reason? If so, what are your experiences, in which field do you apply it, what are the shortcomings, or why did you turn it down?

At the moment we're considering TestConductor as our tool of choice for testing as it's already integrated into Rhapsody, and would like to find out how applicable it is to our project (btw, we're using Rhapsody 7.4 in C).

P.S: Recommendations on good books about Model Based Testing are also appreciated.

" "2303999","174701","2010-02-20 22:27:41","","3","0","2","1038","7","What is your review process for Rhapsody development?","

My team is using the IBM's Rhapsody tool to do real-time embedded development. Unfortunately, we are unhappy with our current review process.

More specifically, we've had difficulty because:

  • there is a lack of a good diff tool for diagram changes
  • the Rhapsody diff tool doesn't generate reports that you can use in a review
  • source file history is spotty because source files are products in MDD thus not configured in a VCS at a high granularity
  • running diffs on source code sometimes pulls in unrelated changes made by other devs
  • sometimes changing a property of a model element changes dozens of source files
  • it's easy to change a source file through a property change and not know it

Does anyone have any tips for making peer reviews on Rhapsody development robust but low-hassle? Any best practices and lessons learned you would like to share? I'm not looking for a mature process write-up; tidbits I didn't know about would be great.

" "2485746","280391","2010-03-21 03:05:24","","13","8","7","6761","19","Is UML a programming language?","

Could UML be used to program a computer system on its own, without a supporting implementation language, e.g. diagrams straight to machine code (maybe via C or C++ etc), without human coding intervention.

" "2652918","318477","2010-04-16 12:34:28","","6","2","1","853","2","Where is the Android Metamodel located?","

I would like to use Android for Model-Driven-Software-Development.

For this, I need to locate the Android Model in the SDK. I already searched a while for it, but were not able to find it. Has anyone an idea where it could be?

Is it possible, that it is the AndroidManifest.xml-File in the folder android-sdk-\platforms\android-x\android.jar? After unpacking this file, I am not able to open that file correctly on Windows XP, because a lot of characters have the wrong character set.

Or is it also possible, that it is only located in the source code?

Thanks in advance, Dominik

" "2702206","58523","2010-04-23 21:56:34","","4","1","1","2036","5","What are the benefits and risks of moving to a Model Driven Architecture approach?","

I work for a company with about 350 employees and we are in the process of growing. Our current codebase is not structured very well and we are looking both at how to improve it immediately (by organizing objects into namespaces, separating concerns, etc.) and moving to a model driven architecture approach, where we model and design everything first with uml, then generate code from that model. We have been looking heavily at Sparx Systems Enterprise Architect (EA) (which is UML 2.0 capable) and we are also considering the tools in VS 2010. I know there are other tools out there (Rational XDE being one) but I really do not think we can spend $1500+ per license at this point.

I'm not looking for answers on which tool is better than another but more for experiences moving from a cowboy coding environment (that is, little planning and design, just jump in and start coding) to a model driven architecture. Looking back was it helpful to your organization? What are the pain points? What are the risks? What are the benefits?

" "3096702","27083","2010-06-22 20:03:41","","5","1","1","1165","7","Is there a MDSD/MDA success story for a real world application?","

I am currently facing a situation where I as an advocate of test driven development have to compete with an advocate of model driven software development (MDSD) / model driven architecture (MDA).

In my opinion, code generation is a valuable tool in my toolbox and I make heavy use of templates and automation when needed. I also create diagrams in UML when I think this helps to understand the inner working or to discuss architecture on the white board. However, I strongly doubt that creating software via UML (creating statecharts and sequence diagrams to create working code not only skeletons of code) is more efficient for multi tier applications (database layer, business/domain layer and a Gui, maybe even distributed). It seems to me when it comes to MDSD, the CASE tooling suddenly isn't just a tool anymore but it is the thing to satisfy: As I see it, on the one hand, MDSDevelopers profit from the higher abstraction UML gives them but at the same time they are struggling with modifing the codegenerator/template/engine to fullfill their needs which might be easily implemented (and tested) if used another tool out of their toolbox (VisualStudio, Eclipse,...).

All this makes me wonder if there has been a success story (suceess being that the product was rolled out in time, within the budged and with only few bugs and parts of the software have been reused later on) for a real world application which fullfills this creteria and has been developed using a strict model driven approach:

  • it has nothing to do with the the Object Management Group (OMG) or with consultants related to MDSD/MDA/SOA/
  • the application is not related to Business Process Modelling and is not a CASE tool itself
  • the application is actively used by end user
  • it has at least three tiers, including a user interface which goes beyond displaying raw table values and is not one of the common MDA/MDSD examples (""how to model a coffee machine, traffic light, dishwasher"").
" "4109062","426724","2010-11-05 18:48:09","","6","0","","1151","1","UML Modeling Tool For Use With Java+Playframework","

I'm looking for a good modeling tool to use for designing java applications that use the playframework. Considerations:

  1. Should be able to generate valid java code for skeleton of play app
  2. Should be able to round trip java code and update model appropriately
  3. Shouldn't be too cumbersome -- I don't want to be generating reams of complicated diagrams that serve no purpose. My goal is to be able to quickly model the design for an app I have in my head, hit ""Generate"" and have stubbed out java code the members of my team and I can start filling in.
  4. Cost is not a serious concern.
  5. Eclipse integration is a major plus
  6. Learning curve/availability of good resources to learn is an important consideration

Does such a modeling tool exist? Playing with Visual Paradigm now. Am I going down a blind alley by even wanting to do this? I know modeling etc. has kind of fallen out of favor with the focus on Agility and all, but it seems like this would be much quicker than a) trying to explain to everyone I work with how I envision the app working and b) manually writing tons of boilerplate code.

" "4149579","403455","2010-11-10 22:05:12","","2","0","1","3270","3","How can I create a reference to existing model objects?","

I'm new to MDSD/EMF but am making great progress thanks to Eclipse's support.

I created a toy model as answered yesterday as awynne suggested, and I'm very close. I'm only using EMF and its generated tree editor.

Here's a summary of my EMF meta-model:

- EClass: Widget
  - name

- EClass: WidgetReference
  - aWidgetReference : Widget [0..1] Containment = false

- EClass: WidgetContainer
  - myWidgets : Widget [0..*] Containment = true

- EClass: ReferenceContainer
  - myReferences : WidgetReference [0..*] Containment = true

- EClass: TopLevelClass
  - myWidgetContainer    : [1] WidgetContainer    Containment = true
  - myReferenceContainer : [1] ReferenceContainer Containment = true

What's happening now is that in the generated tree editor for the model, I create everything starting from the TopLevelClass. I can successfully create multiple widgets in the WidgetContainer, and I can create a single WidgetReference in the ReferenceContainer and associate it with a specific Widget.

In case anyone runs into this, there is a bug in the generated EMF editor code:

When I try to add more than one WidgetReference to the ReferenceContainer, the tree editor only shows the first WidgetReference under the ReferenceContainer. If I click on the WidgetReferences item in the tree, it does show multiple WidgetReferences in the properties view. It just won't let me see them in the tree, and therefore won't let me select them to change their reference to associate it to an actual widget.

The workaround to this is to create as many references as you need, save and close the model, and then re-open it. Upon re-opening it, all of the references will be shown.

Thanks for any help/guidance.

Jeff

" "4479883","532070","2010-12-18 20:00:38","","2","5","1","3298","2","MDA : Model Driven Architecture","

Need a idea for developing very simple application demonstrating concepts of MDA.

" "4570358","220485","2010-12-31 13:25:43","","2","0","1","139","1","What has been done in the field of versioning models?","

We had a rather nice lecture about Model driven architecture by a guy from Model Labs. One thing that got me intrigued was the version control for models ( not to be confused with different models of version control) - or the lack of thereof. By version control for models he meant a way to version XML, EMF files which preserves their semantic.

So, I'm interested in what has been done so far on that field (he mentioned something about SVN and Moodle, though I could have misheard him). The Google search yielded nothing so I'm turning to the wisdom of the Stack Overflow.

I'm looking mostly for information in the form of books, articles, links.

" "4837002","294000","2011-01-29 12:57:25","","3","0","2","466","2","I don't like MDD but like UML - why should I use MDD if I think it is useless ?","

I am a java software developer/architect and I like UML.

Saying that I also hate the java generated code.

I don't see any value trying to generate the skeleton of my application:

  • creating empty classes is really easy and I don't need a tool to do that
  • also I cannot reuse the generated code because the way it is generated makes it impossible to reuse

The dilemma for me is that my requirements changed so quickly that I need to be able to implement the new demand immediately into an existing code.

My problem is that if I generate my code from my model and then manually develop inside the generated codebase, I cannot generate code again using a model because my modification would be erased.

Except I copy/paste the changes back and forth. That is an enormous effort for too few results. Therefore I do not use MDD but still use a lot UML.

Could UML be successful in a project without MDD code generation ?

I am asking this question because I have a new boss who wants to introduce full MDD process with IBM RSA and today I prefer to have live code and model synchronization or merge with Omondo.

  • Why change a running and proven system?
  • Why systematically generate code from a model while I can do it directly in the code and just merge it later with the model?
  • Why get crap database code generation which cannot even be deployed while I can add stereotype in order to get java annotation and use them with hibernate to generate my database?

One of the reason for boss's change is to get a better project documentation in HTML format. I highly doubt this and think he is looking for more control on delivery and does not know what else to invent!

Other argumentative reasons:

  • Use a product from a large and stable company.
  • Have a full model available which could be deployed in any other language.
    (This is why for me MDD is stupid because it is impossible to deploy on any platform any server, any database just from a model. So why to waste my time?)

Please give me some arguments in order to come back at next meeting and crash this stupid new MDD fan who wants to reorganize the way we work today!

" "4863686","60617","2011-02-01 14:24:31","","2","0","1","775","0","Tool support for MOF (Meta Object Facility)","

I was looking into OMG's Business Process Definition MetaModel (BPDM) and found the meta-model definition as XMI/CMOF(Complete MOF) file (download here).

Now I was looking for any tools that support reading, editing and displaying the MOF file, but I could not find any. I only found out the Eclipse's ECore is somewhat based on Essential MOF (EMOF), but I could not exploit this relationship.

Do you know any tools, libraries, scripts with MOF support that could handle the mentioned file?

" "5265897","175399","2011-03-10 21:04:54","","2","2","","264","0","Is implementing a code generator a sort of model driven design/ model driven software developement?","

Is implementing a code generator a sort of model driven design/ model driven software developement or are both methods completely different?

For instance, when you use the Entity Framework code generation. Is this a kind of model driven design?

Does it makes any differents on using a model or a meta model when I use the term model driven design?

No more answers?

" "5492455","541106","2011-03-30 21:10:13","","2","0","2","1135","2","Ecore, genmodel and OCL","

I am defining the meta model of a domain specific modeling language by means of Ecore in EMF. I therefore generate an editor from the related genmodel I can use to create models conform to the meta-model. I would like to specify some OCL constraint on the values that some elements of the meta-model can assume. It would be very nice if I could specify these constraint in the Ecore model and have the related checks automatically generated editor Java code.

Is there a standard way to do that?

" "5797475","433392","2011-04-26 23:02:17","","2","0","","71","1","How compares MDSD to model interpretation coding-style","

Hopefully, this question isn't too generic:

Conventionally, MDSD is defined as the conversion of model specifications into sources of compilable programs.

Besides this, one could interpret a model.

While interpretation typically tends to be slower, the deployment of an updated model could be simpler.

In general: Why would one compile a model using MDSD? When should one interpret models?

" "5897996","649727","2011-05-05 12:53:41","","2","2","4","1477","6","Model-driven Software Development vs. Haskell","

Just reading the (german) Wiki-Article about Model-Driven SW-Development (MDSD). Summing up the Wiki-Definition:

  • MDSD is about the DRY-Principle (Dont repeat youself)
  • MDSD is about the Design of DSLs (Domain Specific Languages) and Generators
  • More concise description of problems (through the higher level of abstraction of the respective DSLs) is possible through MDSD.

Since I know and use higher-order functional programming I wonder, and my actual question is: Is MDSD nothing but a desparate attempt to inject (a part of) the powerful features higher-order functional programming offers into programming languages / paradigms which inherently lack those features?

(Or did I misunderstand and could MDSD even be used to substantially support higher-order functional programming?)

" "5913704","742062","2011-05-06 15:37:19","","3","0","3","1737","3","Model-driven development: What is a transform?","

As I understand it, model-driven development (MDD) allows automation whereby programs/models are automatically generated from their corresponding models via the application of transformations.

All I know about transformations is that they are some way of storing a developer's platform-specific expertise.

But what exactly is a transformation?

" "6321592","794676","2011-06-12 11:07:32","","2","0","","650","1","Is there an open source complete Java EE MDA framework?","

I'm looking for a Java EE MDA framework that generates a complete Java EE application. I mean starting by modeling with some tool like magicdraw sybase PowerDesigner then it generates the java classes (hibernate or JPA if possible) and finally the presentation layer is generated based on the model.

ie: Suppose my UML model has a class called Person (id, firstName, lastName), then the framework will generate the java source and the .class files. After that in the presentation layer I can let the CRUD operations be generated based on my model.

I have searched on the net but unfortunately [edit: could not find anything?] (except Spring ROO but it does not start from the UML model).

" "7402003","318292","2011-09-13 12:39:09","","5","0","","2381","2","What is the difference between Acceleo and Xpand?","

I have a DSL which is based on a custom metamodel, which in its turn is based on EMF/Ecore. I am trying to figure out which solution to choose, and I cant find any decent comparisons anywhere.

Does anyone have any reasons why I should choose one over the other?

What I know so far is that Acceleo uses a OMG standardized language, but it seems harder to use than Xpand.

" "8124875","541106","2011-11-14 16:39:33","","1","0","","656","1","Action Language for Foundational UML (ALF)","

Is there any Eclipse implementation of the OMG Action Language for Foundational UML (ALF)? thank you

" "8202231","1056442","2011-11-20 14:37:14","","4","1","","4356","2","How can I transform Entity-Based diagram to a JPA java code","

I have class diagram created with ""Sparx Enterprise Architect v8.0"" and i need to generate JPA-based classes with annotations that reflect relations to use it in the code. The problem is that i can convert it to EJB but not JPA which is required for my task.

" "8357340","1077463","2011-12-02 13:51:30","","2","1","","806","1","UI Acceleo Launcher Project doesn't work","

I've followed this simple tutorial wiki.eclipse.org/Acceleo/Getting_Started my aim is creating an UI launcher... However when I finish and a click on 'Acceleo Model to Text'>'generate' the folder 'src-gen' remains empty!!

On Error Log View this error is prompted:

java.io.IOException: '/elt/codegeneration/ecore2dataspace/files/generate.emtl' not found
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:409)
at elt.codegeneration.ecore2dataspace.files.Generate.<init>(Generate.java:90)
at elt.codegeneration.ecore2dataspace.ui.common.GenerateAll.doGenerate(GenerateAll.java:91)
at elt.codegeneration.ecore2dataspace.ui.popupMenus.AcceleoGenerateEcore2dataspaceAction$1.run(AcceleoGenerateEcore2dataspaceAction.java:76)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

It doesn't found the file generate.emtl although it is actually present in the jar file.

The strange thing is that when I try to start the plup-in in a separate Eclipse application (By Maniferst.mf) everything works!!!

I've Acceleo - Text generation from models Version: 3.1.0. Eclipse Platform Version: 3.7.0

Thanks

" "9383880","318292","2012-02-21 19:29:50","","2","0","","784","0","Loading same plugin twice with different version in Eclipse","

I have two different versions of an EMF plugin which loads a certain .xmi. The latter version has been changed so that the xmi from the previous version is incompatible. What I want to do is to load the xmi's with the first plugin and then programatically build a model using the newer plugin thus migrating older models. They are identical apart from some changes within an EMF model.

How do I load these plugins? Is it possible? Are there better strategies?

" "9444455","1163200","2012-02-25 13:36:32","","1","0","","224","0","Creating a meta model using UML convention and creating a data model out of it","

Sorry if the question sounds too vague. I will improve based on your feedback.

I have managed to prepare a UML model of a problem domain. This is essentially a class diagram describing class attributes and aggregation relationships amongst classes. Intention now is to fill data.

For example, class-A aggregates N instances of Class-B. I would like to create a data model that has data for one instance Class-A and 5 instances of Class-B.

Basically, data pertaining to this meta model is available in a document (e.g. xls, framemaker) and it should be possible to read the source and populate the data model.

Are there tools that will let me create this data model? Please advise.

" "9523258","356011","2012-03-01 20:09:13","","4","1","1","999","6","Is model driven architecture worth it and what is the state of the art in the tooling?","

We have a recurring problem in our shop where we end up with 3 or 4 different representations of the same class/entity.

A java version, an xml version, a hibernate version, a json version... you get the point.

Obviously this creates maintenance problems.

Model driven architecture is probably more than this, but what I'd really like is a system that lets me define a class or an entity once, in one way, and then generate various representations. (maybe I am not using the correct terminology for this)

It really isn't that straight forward, of course, because let's say we have a java object that we want to turn into JSON for sending over the wire - there might not be an exact 1-1 correspondence between the members in the java object to the fields in JSON - there might be some optimizations, or whatever.

I've looked at things like AndroMDA and EMF in the past, and found them either lacking or clumsy. I do not know how they stack up these days, or what other systems there are.

What are SO's opinions on MDA and or meta-data driven programming? Have the tools become mature enough for serious consideration?

Thanks.

" "9571845","403455","2012-03-05 18:24:16","","2","0","","451","2","Can I make an Ecore metamodel that enables models to reference Java classes?","

Suppose I want to design an Ecore metamodel that looks something like this, designed to be used to ""run"" a list of classes:

JavaClassRunnerList
   0..* JavaClass

And assume I have some Java project that has classes named PrintsHello, PrintsSeparator, and PrintsWorld.

I'd like to be able to then write models that look like this:

JavaClassRunnerList
   PrintsHello.class
   PrintsSeparator.class
   PrintsWorld.class
   PrintsSeparator.class
   PrintsSeparator.class

I want my model to be able to include a Java project and to recognize its classes as choices for the model references (possibly co-located in the same project the model is in.)

Is this possible?

" "9775717","998101","2012-03-19 18:24:42","","2","0","2","8605","8","Rational, EA, or something else?","

Does anyone have any thoughts on Rational Software Architect vs Sparx EA? Are there other tools I should be looking at? Specifically, I'm interested in the following;

  1. Adherance to some methodology (RUP, SOMF, etc.) -- we're not settled on one now, but need to pick one that suits a SoA architecture.
  2. Multi-modeling -- I need to model all the way from hardware (ideally with cost/spec tracking across physical and cloud) to deployment, classes/services, etc.
  3. Roundtrip -- reverse our code/data and then generate stubs as we add new classes to the model.
  4. NoSQL support
  5. Focus on code -- we're less data-centric, we don't need to model tables and entities that much.

It seems both rational and EA will do most of this, rational obviously leads with RUP. Neither seems to do the hardware mapping/costing, though sybase powerbuilder does -- not sure if im missing something here?

Any advice on how to properly evaluate/choose one? Anything else I should look at?

" "10125776","608692","2012-04-12 14:33:37","","2","0","1","986","1","How to validate an Object Diagram (aka ""Instance Diagram"") against a Meta Model?","

I have to develop an API that take as an input a Meta Model (class diagram) and his instance (object diagram) but I don't know how to do it in a programaticly way.

I made some research and I found that I can play with EMF API but I'm not sure how to do it and how to insert my diagram before the validation.

I'm a beginner and lost between all the document that are present on the internet, so excuse me if my subject aren't clear

I just need some orientation, advise to understand what I have to do.

EDIT: The subject is to validate an instance against his metamodel that are created with Magic Draw. So I have to export the file (ecore? XMI? I don't know who's the best) then create a Java API that parse these two file (I need to figure out how to inject/import them also) and return a boolean value about the validation. This is for the first step, after that I think I'll add OCL constraint to validate the instance, but for now I need to focus on a simple validation. How can I do that with EMF or other tool if required

" "10726556","191060","2012-05-23 19:27:33","","1","0","","336","0","How to get tool-readable XMI with Atlas Transformation Language","

I'm a beginner with Atlas Transformation Language and have already made some steps with transforming models based on severeal meta-models. Now I want to transform a specified model based on metamodel1 to a uml-model based on the uml-metamodel. The problem I have is that I want get a xmi-file which I could read with my uml-tool (it's Magic Draw). Where can I get a uml-metamodel which I could use in ATL to produce machine readable xmi-files. All my current approaches weren't successful.

" "10838004","127320","2012-05-31 16:59:52","","3","2","2","934","2","Model based UI generaton (runtime or build time)","

We have a EMF based meta-model that is used to configure our application. Until now we used the EMF editor (eclipse based) to create various configuration instances of our product. This has worked well so far but we now want to support the config creation from web UI.

What are the options I have for creating a rich UI from meta-models on Java platform? I know about Naked Objects, Roo etc but those generate end to end application with focus on persistence. I just need good looking UI that can populate the model.

Edit One of the comments suggest a combination of Magritte + Glamour. But those are for smalltalk. Are there any equivalents in Java?

" "11376162","541106","2012-07-07 15:16:39","","1","0","","1103","0","ACCELEO: creating file in path depending on the model structure","

In an Acceleo Model to Text transformation I would like to create a file for a UML class coherent with the packages of containing the class (the class namespace in the UML model). The problem I am facing is that I have to do that in line as the [file] command requires it so I am trying something like this

[file ((c.allOwningPackages().name.->sep('/')).concat(c.name.concat('.hpp')),false,'UTF-8')]

but I am getting this error on the concat:

 Cannot find operation (concat(String)) for the type (OclAny)

What is the right way of doing this?

" "11668563","1127860","2012-07-26 11:45:01","","2","1","0","742","2","How to use EMF with an own meta-model","

my goal is to create a meta-model for a model but one level higher than by default with EMF. The meta-model(2) should define the possibilities and restrictions for the possible modles(1). Then I want to generate Java-code of this model.

2 meta-model 1 model 0 Java-code

So the model(1) is a kind of DSL and the meta-model is the definition of that DSL.

How can I do this. Is it possible with EMF or is there any other plugin from the Eclipse Modeling Project?

Im searching for some functionality like in this tool: http://www.actifsource.com/ but without specifying an extra generator template.

" "11668907","1127860","2012-07-26 12:05:01","","1","0","","492","1","How to generate Java-code from model of EMF","

I created a model with EMF and generated an Eclipse plugin for this model. In the plugin I can now define an instance of that model. But now I want do generate Java-code from this instance. How can I do this?

" "11753821","541106","2012-08-01 06:38:46","","1","0","","190","1","running ACCELEO from ACCELEO on the DSL contained in model elements","

I have a UML activity with OpaqueActions containing a DSL. The DSL grammar is expressed by means of XText thus there is an EMF ECORE model and editor for it. I have an ACCELEO M2T transformation transforming UML activities in text and I'd like to trigger (from such transformation) another transformation (from the DSL meta-model to text) providing as input the DSL containing in the opaque actions of the activity. Is there any way to easily do that?

" "11989969","191060","2012-08-16 14:55:31","","1","0","1","1038","1","How to specifiy enumeration literal as default value in UML Attribute?","

I currently doing some model transformations using EMF-UML-Implementation. In my model transformation I create an uml class with some attributes. The attributes are type of enumerations I also created. Some of the attribute should get a default value. The default value should be enumeration literals.

The question now is, how do I get the enumeration literals to the defaultValue-property of the Property.

I already have found that I have to use ValueSpecification. But the UML superstructure says not much about that (page 139 f.). Which properties do I have to use for setting the defaultValue to enumeration literals?

I think the main problem I have is, that the use of ValueSpecification is unclear to me. Currently I only use default to set the default values, which is type of String.

" "12069894","265195","2012-08-22 09:16:45","","1","0","","98","1","Invoke ATL model transformation in MWE2","

Is it possible to invoke an ATL model transformation within an MWE2 workflow?

" "12431413","541106","2012-09-14 20:17:34","","1","1","","1235","3","XText multiple file extensions","

I'd like to define a language with different elements that shall be contained into different kind of files though linked (i.e. similarly to C++ with .cpp and .h files). Is grammar mixin the right way to do that? If so how should I proceed?

" "12458852","534932","2012-09-17 12:08:02","","1","0","4","4590","10","Load EMF Model instance in XTend","

I am building a code generator in XTend where I already have an input model and meta model. That is, I use ATL to generate the input model for my XTend code generator (as part of a transformation sequence to gradually lower the abstraction level, instead of at once; this is the reason i'm not using xtext to create the syntax).

So to be very clear, my input model for the code generator is a file in XMI format and NOT in the grammar of the xtext project (not even using that)! And i think this is causing me problems/confusion.

I created a new XText project using Existing models, right clicked on the .text file, run as , generate artefacts, and then i did the same for the mwe2 file.

What is the next step, am I doing it right? How can I start my code generator? All the examples are from the POV that you use XText to create a DSL. I have an EMF meta model, and an XMI based instance of that. How to process that further using XTend?

Any hint or pointer to a tutorial is helpful.

Solution:

The solution was as Sven suggested in my accepted answer, but also I would like to note that you need to use a genmodel to generate Java artifacts from your meta model. This link shows how: http://www.vogella.com/articles/EclipseEMF/article.html , see section 4. This may appear all too logical, but i think it's worth noting anyway.

" "12512605","1261166","2012-09-20 12:31:10","","1","0","1","100","0","Validate that ecore-model is compliant with metamodel","

What is the easieset way to see that an ecore-model is the model of a metamodel. I'm not interested in OCL, just that the model is a concrete model derived from the metamodel. I want to do this using Sphinx or any other API in eclipse

" "12911489","752129","2012-10-16 09:25:34","","2","0","","514","1","Developing Applications using Eclipse Modelling Framework","

I'm looking for an MDA (Model Driven Architecture) tools available. I have started with EMF(Eclipse Modelling Framework).

It's look fine for generating core classes.

How it will be helpful to generate one end to end application?

To generate UI elements (JSP/JSF/so on...)
To generate Entities and ORM's
To generate EJB's/Web Services 

Is there extensive modelling has provided in EMF to achieve these requirements?

or any other tools are available to capture an end to end applications in modelling and drive the same to development ?

" "13552693","1408877","2012-11-25 15:56:45","","1","0","","30","0","How can I solve this error when I´m writing a model based on a previous metamodel using xText?","

I have written this metamodel in a xText project:

Screen:
""Screen name: "" name = ID
    ""Level: "" level = STRING
    ""End: "" end = INT
    background = [Background]
    character = [Character]
    (enemies+=Enemy)*
    (elements+=Element)*

Background:
""Background{
    Id: "" id = ID
    ""Image: "" image = [Image]
""}"";
...

An all the metaclasses you see there (Background, Character, Enemy, etc) I haven´t had any problem creating the metamodel in ecore but when I try to define a specific model like this (using Ctrl+Space):

Screen name: s1
Level: ""easy""
End: 1000

I get an error: mismatched INPUT expecting RULE_ID and I can't keep on writing with Ctrl+Space. Any ideas why this is not working? Thank you.

" "14040951","536299","2012-12-26 13:01:22","","1","0","","112","0","Generic term for hbm2ddl.auto (entity classes to DDL) capability","

I would like to know what the generic term is for hibernate's Entity classes to DDL (hbm2ddl) capability.

Is it Domain Driven Design or Model Driven Development or something else?

" "14419244","806747","2013-01-19 21:50:00","","1","0","1","1215","3","xtext: Relation between AST, Metamodel and parse tree","

Can someone explain me the relationship between a parse tree, AST and metamodel. I know so far that xtext derive an EMF Ecore metamodel out of the grammar and generate a parser with antlr. But how will it then be parsed: An input goes first trough the lexer and then the parser creates a parse tree out of the parser rules, right? And out of the parse tree, Xtext creates also an AST? For what? And what purpose has the metamodel in this case? I'm a little bit confused of all the definitions.

" "14922826","606726","2013-02-17 15:42:01","","3","0","","578","2","How much is Eclipse EMF related to the OMG MDA standard?","

I am looking for a new MDA tool to try out for modelling and code generation. This is not for any work related project yet, but for testing purposes. I only used the Merode approach until now (using jMermaid for modelling and the accompagnied code generator) but want to try out something new.

Since EMF is integrated in Eclipse I see a lot of positive reasons to try it out. But after reading some documentation and online articles, I wonder how much it adopts the OMG MDA standards and how much it doesn't.

For example I found the following text

If, on the other hand, you have already bought into the idea of modeling, and even the Model Driven Architecture (MDA) big picture,3 you should think of EMF as a technology that is moving in that direction, but more slowly than immediate widespread adoption. You can think of EMF as MDA on training wheels.

on http://www.informit.com/articles/article.aspx?p=1323360&seqNum=2

But I can nowhere find a concise list of what points of the OMG standard are implemented and which ones are left out or interpreted differently. Anyone that can help out with that? (And if there are other, more recommended tools, I'm always open to suggestions.)

" "15108717","1731654","2013-02-27 09:39:55","","1","0","1","286","1","Is it possible to perform an MDA Transformation via C#","

I'm using the Enterprise Architect 10.0.1006 to create ""Platform Specific Models"" (PSM) from an ""Platform Independent Model"" (PIM). The PIM is an common codel which declares datatypes with a generic description. You can transform this common model to a specific Model (Java, C++, Php and so on).

But to do so, I have to open the project and perform the ""Transform Current Package"" Tab on every package I want to transform.

It works well but I want to know, if it's possible to write an automatic script in C# to perform this Task. There is a COM to change nearly everything in your projectbrowser. I can access every diagram, element or package through this COM. But I didn't find any method to transform the model.

My Question is: Can I execute this tranfsormation with an automated script using C#?

" "15699822","2172937","2013-03-29 08:29:39","","3","1","1","2808","1","UML class diagram metamodel","

Where can I find a simplified class diagram metamodel ? It's for a ATL ATLAS Transformation Language project, I need to transform a entity class diagram to SQL database. thank you .

" "15966601","2405757","2013-04-12 08:31:38","","1","0","1","1183","4","How to export Xcore to Ecore?","

Defining metamodels with Xcore is a lot easier than with EMF and Ecore. The problem is that I need the metamodels as Ecore files. Is it possible to export Xcore model to Ecore model? I don't see any export options in Eclipse.

" "16638131","2399437","2013-05-19 18:38:51","","2","0","","78","0","Reusing Ecore model componets","

is there a way to reuse EMF-Ecore model components in another Ecore model?

" "16648305","2277094","2013-05-20 11:16:27","","2","0","","161","0","Are the Model-driven architecture feasible?","

I want to ask some questions about MDA:

First, I know that there exist tools that you can write code in one language and then the code be generated in another, for example in 'GWT' Java code is transformed to Javascript, or some mobile development tools that transform HTML+Javascript to native code for different platforms. Are these transformations consider as MDA or is something different?

Except that using MDA part of the code is generated automatically are there any other reason that increase programmer's productivity?

Compared to traditional development, will switching to MDA worth the value (immediately) and is that possible in reality?

" "17085426","1069981","2013-06-13 11:01:48","","1","0","","277","1","Eclipse Modeling Framework and XPAND - How to create iOS metamodel?","

I want to define a model driven approach with Eclipse Modeling Framework (EMF) and XPAND. Therefore I want to define a platform specific metamodel (PSM) with Ecore and write XPAND templates for code generation for the iOS platform.

My question is this:

Is it possible to define such a PSM for the iOS platform in EMF? Because iOS or other platforms have own data types. I can also define data types with EDataType but they have to be related to the Java data types?

" "18824049","1221966","2013-09-16 08:58:19","","2","0","","333","0","Enterprise Architect - MDA converst Map to List","

I am using EA for creation of PIM. When I generate java code directly I am getting correct data type where I want - Map where I set qualifiers on association properties which as I understand meas that it is going to be a map. And that works as expected. Hovewer when I do the MDA transformation and generete code - properties are conveted to List (which is bad) bug setters and getters method keep using Map as in the following example:

public class Check {

private List< Comp> comps;
private List< Gratuity> gratuities;

public Check(){

}

public Map<String, Comp> getcomps(){
    return comps;
}

public Map<String, Gratuity> getgratuities(){
    return gratuities;
}

I am using default transformation package for Java. I tried to add following line to Java transformation for connector is source section

%connectorType%
%PI=""\n  ""%
{
%TRANSFORM_CURRENT()%
%TRANSFORM_REFERENCE(""Connector"",connectorGUID)%
Source
{
%TRANSFORM_REFERENCE(""Class"",connectorSourceElemGUID)%
access=%qt%%connectorSourceAccess == ""Public"" ? ""Private"" : value%%qt%
qualifier=%connectorSourceQualifier%
%TRANSFORM_CURRENT(""Source"",""access"")% 
}
Target
{
%TRANSFORM_REFERENCE(""Class"",connectorDestElemGUID)%
access=%qt%%connectorDestAccess == ""Public"" ? ""Private"" : value%%qt%
%TRANSFORM_CURRENT(""Target"",""access"")%
%PI=""\n""%
}
}

but that doesn't seem to help

" "19705929","1414826","2013-10-31 11:58:10","","2","0","","3019","3","Parse OCL in Java?","

I am writing a Java program for a course that takes a UML class diagram, which is a metamodel, as input and allows the user to create diagrams of the type specified in the metamodel. The user should then be able to model instances of what this diagram modeled.

As such, I am parsing the generated XML file that represents the UML and extract all classes and associations. So far, so good.

But then there are constraints which I'll need to know about and warn when the user violates them. However, I have no idea how to do the OCL parsing. I have looked into dresden OCL but I'm not sure if this is what I want, as I need to parse the OCL during runtime, as opposed to importing a model and generate java code from OCL using eclipse.

As such, I'd really appreciate it if someone could point me to a way of parsing OCL and extracting its basic syntax.

Best Regards, João Fernandes

" "20771844","2834737","2013-12-25 10:39:35","","2","0","1","800","0","Acceleo: using custom UML Profile as metamodal, and its stereotypes in templates?","

I'm new to Acceleo. I use IBM RSA (8.5.1). I created a custom UML Profile (with a few stereotypes extending default metaclasses, it's pretty usual). The UML profile is a .epx file. In addition, I created a simple model on which I applied my custom UML Profile, and ""tagged"" a few classes with my custom stereotypes.

My questions (sorry if it is trivial, but I didn't find a straight answer...):

  • Can I use my custom UML Profile as metamodel in Acceleo? Simply saying, instead of writing in my module file the following: [module main('http://www.eclipse.org/uml2/3.0.0/UML')] (this one works okay) can I write something like this: [module main('platform:/resource/MyProfileProject/MyProfile.epx')]? If I try this, I get an error message: ""The metamodel couldn't be resolved"". I tried to convert my UML Profile from .epx format to .xmi and to .uml. None of those work.

  • If this can be made working somehow, can I use my custom stereotypes as type qualifiers in Acceleo templates (in ""for"" cycles, etc.)?

Any help is appreciated. Thank you in advance. Marcell

" "21716052","2755899","2014-02-12 00:16:25","","1","0","","1254","2","Error on load EMF model dynamically","

I am following the article http://www.ibm.com/developerworks/library/os-eclipse-dynamicemf/ to load dynamically metamodels.

I load the model instanced document using this

ResourceSet load_resourceSet = new ResourceSetImpl();
// ResourceSet load_resourceSet2 = new ResourceSetImpl();

/*
 * Register XMI Factory impl ementation using DEFAULT_EXTENSION
 */
load_resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(""*"", //$NON-NLS-1$
            new XMIResourceFactoryImpl());

/*
 * Add bookStoreEPackage to package registry
 */
load_resourceSet.getPackageRegistry().put(""http:///com.ibm.dynamic.example.bookstore.ecore"",
        bookStoreEPackage);

//  load_resourceSet2.getResourceFactoryRegistry().getExtensionToFactoryMap().put(""*"", //$NON-NLS-1$
    // new XMIResourceFactoryImpl());

/*
 * Load the resources using the URI
 */
Resource modelo_esquerda = load_resourceSet
                .getResource(URI.createURI(""./BookStore.xmi""), true);

But, I´ve got this error message

Exception in thread ""main"" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'BookStore' is not found or is abstract. (.\BookStore.xmi, 9, 34)

The XMI file already exists on directory.

What I can do?

Thank you

" "22513896","3100186","2014-03-19 17:39:34","","4","2","1","746","4","What is the differences between Traditional code-based engineering and model-driven engineering approaches?","

I've found this paragraph in the literature but I didn't understand the meaning of it

Design practice is moving from traditional code-based engineering, with a strong division of work along the development life cycle, to model-driven engineering approaches where all people in the design flow can have their saying on the models.

Any help would be very appreciated

" "22845028","3488996","2014-04-03 17:39:03","","1","0","","983","1","Defining my own datatypes within my own metamodel using EMF Ecore","

I was wondering how can I define my own datatypes within a metamodel created using EMF Ecore ?

The goal is to have a class that may contain many attribute. Each attribute has one Datatype.

The problem I am facing now is when I want to set the attribute datatype [in a model which is conforme to my metamodel ] in the Property View (Eclipse EMF), I get an empty list.

I want something similar to when adding an EAttribute , you get the choice between different Etype (EString, EBoolean,...).

I appreciate any help.

Thank you.

" "23413096","3593528","2014-05-01 17:32:51","","2","0","1","4487","2","Use YANG Tools as a Java code generator for MD-SAL in Opendaylight","

Recently I study the API definition for Opendaylight.

As we know, YANG is a modeling language for NETCONF. However, Opendaylight uses it as a Java code generator for MD-SAL.

So I am wondering :

  1. How does YANG Tool help generate Java code for MD-SAL?

  2. Do you have some YANG code generator tutorials?

Thanks.

" "24055973","3679797","2014-06-05 09:05:41","","1","0","1","847","4","Choosing between ATL and QVT for model to model transformation","

I want to transform a model (in XMI format) based on the JaMoPP Java 5 metamodel to another model (also in XMI format) based on a basic C++ metamodel that I created using Xtext. After some research, I found two tools for Model To Model transformations: ATL and QVT.

What are the main differences between the two and what are some reasons to use either one instead of the other?

" "24180107","3679797","2014-06-12 08:49:40","","1","0","","362","0","what's the difference between QVTo and QVTr transformation?","

I want to do a model to model transformation, from a model based on Java metamodel to a model based on C++ metamodel. I did some research and I found that QVT allow a bidirectional transformation but there is two types of QVT and I don't understand the difference between them, who is the more suitable for my project QVTo or QVTr ?

" "24251927","1375882","2014-06-16 20:46:34","","1","0","","753","0","How to programmatically create Oracle ADF Essentials components - API for ADF and JDeveloper","

Some prominent IDE's have API that let developers create modules (IDE plugins, extensions) that interact with editors and other IDE components. E.g. Embarcadero Delphi has Open Tools API, that allows developers to create (and integrate into Delphi IDE) modules that programmatically creates forms, places components on them, writes code inside files and so on. These are great features because they let developers to integrate those frameworks (VCL, ADF and so on) into Model Driven Development (MDD) workflows (be it commercially provided or custom made by team of developers).

The question is - have JDeveloper such features - to create modules programmatically. E.g. one can imagine the workflow where UML class diagram is created by some third party tool. Is it possible to write some MDD transformation module (as JDeveloper plugin) that programmtically generates required ADF business components and web forms?

Certainly business components and forms can be created manually but does Oracle ADF or JDeveloper expose some API that could let create those components and forms programmtically without interaction with users. All the input data can be provided as XML file (that is output from UML designer or some other tool).

As far as I know there is JDeveloper Extensions but in Oracle forums I have received answers that JDeveloper Extensions are not intended for such a use.

I guess that ADF Essentials is becoming quite popular and there should be some interest to integrate ADF Essentials into MDD workflows. Maybe there are some hidden JDeveloper Extensions features or maybe even separate open source projects that already enable such integration.

Certainly, ADF business components and forms are usual code (XML, Java) files and the process to generate them can be reverse-engineered. Maybe there are some ongoing efforts to do that? I could contribute to them and not to start new project from scratch.

JDeveloper itself has some MDD features but I am not sure if these are rich and flexible enough.

" "24462670","401828","2014-06-28 01:10:03","","1","0","","137","1","Implement same domain model in Python and C# - What should be the same and what should vary?","

I am, as a hobby and best-practice exercise, to implement the same domain model (a simple GPS / GIS library, inspired in ISO 191xx stardards and OGC Abstract Model) both in Python and C#.

It first, I tought: ""well, ISO/OGC gave me a finished UML, so I will have each class in C# and in Python to have the same signature"".

I quickly found myself stuck in the ""strict/static vs duck typing"" problem, since I cannot count on method signatures in python. For example:

  • Overloading constructors is quite common and natural in C#, but in Python you have to resort to *args **kwargs and conditionals;
  • Properties are encouraged in C#, but most source code I have seen around in Python tend to set the fields directly, although the use of @property or property() is quite straightforward.
  • (and so on).

Actually there is (obviously) an obvious and very well documented ""difference in mindsets"" between one language and the other, and I would like to respect those differences while at the same time ending up with ""the same"" application, that is, equivalent domain model, architecture and functionality.

So my question basically is:

If I am to implement the same abstract model (""UML-like"") in Python and C#, how should I proceed, and specifically, which constructs should be invariant, and which should be different?

" "25505240","413531","2014-08-26 11:54:47","","1","2","1","245","2","PHP: Generate code from abstraction (xml, json, data base, ...)","

Note Feel free to suggest a better title as I think 'generate code' and 'abstraction' might not be the best expressions for what I want to ask :)

I'm looking for a good pattern/standard way to generate PHP code from some sort of abstraction layer.

Example

I've built a set of classes that act es text-processing filters. These filters can be chained together to transform some input-text into some other output text, e.g.

Input ""Hello 'CRUEL' World"" 
>> RegexFilter('(.*?)') [extract everything between '']
>> ToLowerFilter [lowercase the extracted text]
Output: cruel

Resulting Code

The corresponding source code looks something like this:

$input = ""Hello 'CRUEL' world"";
$pattern = ""#(.*?)#"";
$first = new RegexFilter($pattern);
$second = new ToLowerFilter();
$first->setNextFilter($second);
$ouput = $first->Transform($input);
echo $output; // cruel

I would like to create some sort of abstraction layer, so that the end user (non-programmer) can built his own filter chain without writing code by himself. By ""abstraction"" I mean something like XML, JSON, stored in a database, etc.

XML example (suggestion)

<filters>
 <filter name='Regex'>
  <properties>
   <property name='pattern'>'(.*)'</property>
  </properties>
  <nextfilter name='ToLower'>
   <properties/>
  </filter>
 </filter>
</filters> 

Remark: The example is very simplistic. Think of more advanced things like ""complex objects as properties for filters"", ""inheritance of filters"" (the above filter could get the name ""RegexToLowerFilter"" and can be referenced by other filters), etc.

Approaches / Ideas

Is there standard way to tackle this sort of problem? So far I've thought of building a custom XML, JSON, etc. serializer/deserializer for every filter but that seems like a lot of work and is potentially error prone because it's done individually for every filter. Further I guess that would require to make every possible dependency also serilizable in the same fashion - which can be problematic when using third party libraries (e.g. JsonPath).

I suppose the most elegant way would be the creation of Domain Specific Language. Unfortunately building a compiler is not the easiest task and probably not always appropriate for every problem in that space. (Then again, feel free to correct me :))

TL;DR

I'm looking for a suitable way / pattern to built an abstraction layer between the (non-progammer) end user and my source code. The solution should take the ""simplified"" abstraction and ""generate"" the corresponding code.

" "26303001","2947716","2014-10-10 15:34:21","","1","1","","1177","1","Generate code from Business Process Model and Notation (BPMN) with androMDA","

I know that AndroMDA generate code from UML model,

my question is: it is possible to generate code from BPMN model (Business Process Model and Notation) with androMDA (i.e create a new cartridge which support BPMN)?

" "27670698","555447","2014-12-27 19:21:17","","1","0","","1671","3","Xtext: Cannot resolve reference","

I have the following Xtext grammar:

grammar dsl.miniproject.Question2.EclipsePluginLanguage with org.eclipse.xtext.common.Terminals

import ""platform:/resource/Question2/model/EclipsePluginModel.ecore"" 
import ""http://www.eclipse.org/emf/2002/Ecore"" as ecore

Plugin:
    {Plugin}
    'Plugin' Name = EntityName
    '{'             
        (documentation = Documentation)?
        (functions += Functionality)*
        manifest = Manifest
    '}'
;

Documentation:
    {Documentation}
    'description =' documentation = STRING
;

Manifest:
    {Manifest}
    'manifest'
    '{'
        (dependencies += Dependency)*
        (extensionPoints += ExtensionPoint)*    
        (extensions += Extension)*
    '}'
;

Functionality:
    {Functionality}
    'function' Name = EntityName ';'
;

Dependency:
    {Dependency}
    Name = EntityName '=>' depends = [Plugin|EntityName]
;

Extension:
    {Extension}
    Name = EntityName '->' extends = [ExtensionPoint|EntityName]
;

ExtensionPoint:
    {ExtensionPoint}
    'ExtensionPoint' Name = EntityName 
    '{'
        'ref' functions += [Functionality|EntityName] ';'       
    '}'
;

EntityName:
    ID ('.' ID)*
;

However when writing a sample script ex:

    Plugin x{
        description = ""test""

        function f;
        function f2;

        manifest{

            dep1 => x

            ExtensionPoint ep.ep1{
                ref f;
            }

            ext1 -> ep.ep1
        }    
}

I get the following error:

Couldn't resolve reference to Plugin 'x'. Couldn't resolve reference to Functionality 'f'. ... etc

This is my first attempt at xtext and I cannot figure out what I'm doing wrong

Thanks in advance for any help!!

" "27762014","3233595","2015-01-04 03:18:06","","1","0","","337","1","OCL Stereotype Constraint: Any association that is coloured all connected classes have the same colour","

Quite new to OCL, thanks for the help.

So I have a profile with the stereotypes as shown:

Can someone tell me how to write an invariant constraint that says any association that is Coloured means that all connected classes must have the same colour value in their colour property?

I had this so far:

Context UML::InfrastructureLibrary::Core::Constructs::Association
inv: Association.allInstances() -> forAll(a:Association|a.oclIsTypeOf(Coloured) implies 
    a.associatedElement.colour = a.colour)

Pretty sure this is wrong because a.associatedElement does not exist.. but I do not understand how to access this 'all connected classes' or what that means. Perhaps I need something like

a.[association].colour ?

Thanks

" "28780153","4614123","2015-02-28 09:23:38","","1","0","","1872","0","Papyrus UML: add a type to a property using a Profile (Metamodel Extension)","

I'm defining a profile using Papyrus UML in Eclipse. I extended metaclass ""Class"" and ""Property"" with several Stereotype classes. I can see new Stereotypes in my actual model correctly. I want to do the same defining my own types in my profile to use them for properties inside classes in my model.

Example: i want to have a property in a class with the type HashMap that is not defined inside basic Java Type. I can define a <<Primitive Type>> class in my profile naming it ""HashMap"" but it's not clear to me which UML metaclass I need to extend.

Please provide me a step by step example of profile definition if you have time. Thanks a lot!

" "29744024","4809675","2015-04-20 09:29:51","","2","0","","383","0","Xtext assign object in xtext file","

Trying to make a meta model for Mongoose and MondoDb, using metamodeling concepts, eclipse and xtext.

I am trying to assign object that i created in my test.mydsl file to another object in the same file, but i get error in my test.mydsl file.

I am trying to assign created Schema(sc1) object to Collection(col) object, but currently getting an error

error message

the feature 'validate' of 'paket.impl.NCollectionImpl@67d76e14{platform:/resource/test/classes/test.mydsl#//@collections.0}' contains an unresolved proxy 'paket.impl.SchemaImpl@361d8284{platform:/resource/test/classes/test.mydsl#|0}'

my grammar for Schema and Collection

Schema returns Schema:
    {Schema}
    ('Schema' '<' Name=EString) '>'
    '{'
        (schemaExpression+=Expression ( "","" schemaExpression+=Expression)*)?
        (verificationDocumentElement+=VerDocElement ( "","" verificationDocumentElement+=VerDocElement)*)?
    '}';

NCollection returns NCollection:
    {NCollection}
    ('Collection' '<' Name=EString) ',' (validate=[Schema|EString])? '>'
    '{'
        (document+=Document ( "","" document+=Document)*)?
    '}';

my test.mydsl

Database<db1>{

    Schema<sc1>{
        var ja=lp   
        ime:{
            type:String,
            min:123.0
        }

    }
    Collection<col, sc1> 
    {

    }
}

I tried all, but unsuccessful.

Any ideas what to do?

Thanks

EDIT:

Maybe I was not clear enough. The major problem is with ""validate"" attribute in NCollection rule. When I create my Schema object(sc1 in test.mydsl) and then try to pass it to Collection(col in test.mydsl) as a ""sc1"", the ""validate"" attribute cannot accept it like string, and I don't know how to pass it like Schema object. I hope this explanation helps.

" "29959782","2757620","2015-04-30 05:38:04","","1","0","","287","1","EMF/UML and OCL API for Scala","

A part of an application I am developing in Scala needs to read and parse EMF/UML models along with OCL expressions defined over these models. My OCL expressions are pretty much query expression defined over these EMT/UML models.

My Questions:

1) What are the API options in order to read and parse EMF/UML models?

2) What are the API options in order to parse and evaluate OCL expressions (queries) over EMF/UML models.

" "30334503","4682769","2015-05-19 19:28:39","","2","4","1","2082","2","Acceleo transformation using a custom ecore metamodel","

First of all , i am new to the modeling features of eclipse, so the question may be trivial, but i am searching for days and haven't found an answer.

I have created an ecore metamodel file with an ecore modeling project. The URI is this : /com.auth.dotnetPSM.PSMmodel/model/PSMMetamodel.ecore

I have also generated (via an ATL transformation) an xmi model file. the first element is like this:

<?xml version=""1.0"" encoding=""ISO-8859-1""?>
<RESTfulServicePSM
    xmi:version=""2.0"" 
    xmlns:xmi=""http://www.omg.org/XMI"" 
    xmlns=""/com.auth.dotnetPSM.PSMmodel/model/PSMMetamodel.ecore"" 
    name=""WSAT"">

In the ATL project everything is working as expected.

Now i need to create an M2T transformation using Acceleo. So for starters, i created two modules, a main :

[comment encoding = UTF-8 /]

[module PsmToCode('/com.auth.dotnetPSM.PSMmodel/model/PSMMetamodel.ecore')]
[import org::eclipse::acceleo::psm2code::files::ResourceModelClasses/]

[template public PsmToCode(aRESTfulServicePSM : RESTfulServicePSM)]
[comment @main/]
[for ( aCSharpResourceModel : CSharpResourceModel | aRESTfulServicePSM.hasCSharpRModel)]
        [aCSharpResourceModel.generateResourceModelClasses()/]
 [/for]
[/template]

and another one:

[comment encoding = UTF-8 /]
[module ResourceModelClasses('/com.auth.dotnetPSM.PSMmodel/model/PSMMetamodel.ecore')]

[template public generateResourceModelClasses(aCSharpResourceModel : CSharpResourceModel)]

[file (aCSharpResourceModel.parentName.toUpperFirst().concat('.cs'), false, 'UTF-8')]

[/file]
[/template]

When i run this, i get a Package with uri '/com.auth.dotnetPSM.PSMmodel/model/PSMMetamodel.ecore' not found. (file:/H:/Users/doumas/workspace/PIM2PSM/WSATPSM.xmi, 6, 15) exception. What am i doing wrong?

Thanks in advance.

" "30412913","3632206","2015-05-23 12:54:06","","1","0","","232","0","Are there visual/graphical MDD tools for Ruby on Rails?","

This is going to be pretty vague, so I hope I done get banned for it.

I've been learning about various dynamic web tools such as ruby on rails that can require a huge number of referencing between files (master view controllers, assets etc). Typically, when designing a rails application, I now draw the whole thing out in inkscape so that I have a visual representation of how all the files are connected to one another.

It would be really useful if I could translate the simple workflow diagram into some skeletal code. For example dragging a red block onto the page would create a controller, dragging an arrow in a direction towards a named view would then create the def in the controller etc etc. It's just an idea, but I wondered as a result if there were any graphical tools I could manipulate in order to do this kind of task?

If such a tool doesn't exist I'm happy to try and code one up myself - any ideas for a starting point?

" "32154850","5254741","2015-08-22 10:05:36","","1","0","","207","0","Active Model Driven Architecture (MDA) Tools","

Could you provide a list of active MDA tools like AndroMDA? Tools like arcstyler or optimalj seems to be discontinued.

" "34046283","4850941","2015-12-02 15:16:50","","1","0","","321","1","Differences between MDSD & MDD","

I would like to know if there is any difference between:

  1. Model-Driven Software Development (MDSD)
  2. Model-Driven Development (MDD)

I always find these two terms in many articles and public literature, but no one highlights the differences.

" "37269243","3053097","2016-05-17 07:01:47","","1","0","","298","0","ATL to EMFTVM compiler","

Several approaches intended to run EMFTVM model to model transformations have appeared (see http://modeling-languages.com/executing-atl-transformations-java/).

However, all of these deal with EMFTVM transformations. I am in the case in which I have to run generated ATL transformations (with a HOT). Could I use a compiler from ATL to EMFTVM and use the Java code to run this resulting transformation afterwards?

" "37659674","2754014","2016-06-06 14:10:31","","2","0","","713","2","How to set custom metamodel in Acceleo project?","

I try to make generator from my custom metamodel. I created it by Obeo Designer - it is ecore metamodel.

So I create new Acceleo Project, choose my metamodel URI (http://org/model/ros) from ""Runtime version"" and try to run it.

But project can't run and i get exception:

Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://org/model/ros' not found. (file:/C:/Users/Jakub%20Kitaj/Downloads/ObeoDesigner-Community-8.1-win32.win32.x86/ObeoDesigner-Community/workspace/TestAcceleo/model/example.ros, 2, 120)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2625)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2458)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1335)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:78)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:190)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:261)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 6 more

I think i should set my custom metamodel but how can I do this?

EDIT:

I add this code line:
resourceSet.getPackageRegistry().put(""http://org/model/ros"", Package.class); but I get same error. http://org/model/ros is my metamodel nsUri and Package.class is instance of element from my metamodel object. :(

What can I do else? :(

" "38420076","6454129","2016-07-17 10:05:45","","2","0","0","800","0","Class diagram from ecore","

I have .ecore metamodel. How can I automatically generate class diagram from it?

" "40820434","6454129","2016-11-26 16:25:25","","1","0","","59","0","ETL is interpreted or compiled language","

Is Epsilon transformation language (ETL) interpreted or compiled language?

" "41781254","6454129","2017-01-21 15:45:50","","1","0","","69","0","OCL - calling rule","

What does the below code do? How can I write this OCL expression when there is one element instead of elements?

In other words, I don't understand which elements does the code collect? Since ""collect"" is used when we have more than one element, if I have one element (instead of elements), what changes occure to ""-> collect (s|thisModule.CreateMatchClass(s))"" part of that expression?

s.source.elements -> collect (s|thisModule.CreateAnyMatchClass(s))

" "43020588","1911196","2017-03-25 18:56:10","","1","0","","156","0","UML to HUTN (Human-Usable Textual Notation)","

The epsilon project (based on eclipse) promises here to transform XMI to HUTN. I can't find any documentation for this purpose. Is it too trivial? I don't get it

Thanks for any advice

" "43457276","7213321","2017-04-17 18:29:29","","1","0","","452","0","Acceleo: The generation failed to generate any file","

First of all , I am new to Acceleo and the modeling features of eclipse. What I am trying to do is just to create a simple test file. So for starters, I created a main module:

comment encoding = UTF-8 /]
[module generate('file:/C:/Users/maria/Documents/workspace/org.eclipse.acceleo.module.m2tTransformation/model/PSMMetamodel.ecore')]   

[template public generateElement( aServicePSM : ServicePSM)]
[comment @main/]
[file ('test.java', false, 'UTF-8')]
Test
[/file]
[/template]

When i run this I get:

The generation failed to generate any file because there are no model elements that matches at least the type of the first parameter of one of your main templates. 
The problem may be caused by a problem with the registration of your metamodel, please see the method named ""registerPackages"" in the Java launcher of your generator. It could also come from a missing [comment @main/] in the template used as the entry point of the generation. 

Also the URI I use is the nsURI attribute value I set to the root of metamodel. I am sure that my input model does contain ServicePSM elements. What am i doing wrong?

Thanks in advance.

" "43549529","5123608","2017-04-21 18:19:09","","2","1","","107","2","Generate a new Ecore metamodel based on another one in Java","

I am a beginner in Eclipse EMF. I have created an Ecore metamodel which I want to transform into a new Ecore metamodel in Java that takes into account some characteristics of the first metamodel. I have searched the web but the exlpanations I've found were not clear to me.

How can I get access to the first metamodel from a Java app and how can I generate a new metamodel with the corresponding .ecore and .genmodel files?

Is such a task even possible?

Thanks!

" "45888912","8518336","2017-08-25 20:24:25","","1","0","","41","0","How to create a new meta-formalism?","

I'm newbie with the using of EMF. I understand the theory of MDA and MDD, and does some practice using Atom3 and AtomPM. I know how to create a meta-model and meta-formalism (meta-meta-model) and how to create transformation rules using the two previous tools. So, i need to know how to create a new meta-formalism(meta-meta-model) using EMF and how to create a meta-model using it. and how to create a model using the new meta-model. Think you.

" "48951992","790053","2018-02-23 16:11:41","","1","0","","1094","5","How to build EMOF models in IntelliJ and generate code from them?","

What is the best way to build models in IntelliJ, in the style of Eclipse EMF ?

Is there an equivalent of Eclipse EMF in IntelliJ ? And is there something that adheres to standards such as EMOF in the same way that EMF Ecore is aligned to it ?

I found a plugin that seems to help with that here, but I am wondering if there are other/better options.

" "49150984","5385862","2018-03-07 11:37:56","","2","0","","108","1","MDA (Model Driven Architecture)","

I have a doubt about MDA.

And this is my doubt, I can used the MDA concepts in a architecture that is not related to it(e.g ER), ?

" "50426449","9643227","2018-05-19 14:39:31","","1","0","","430","0","Acceleo Trasformation - Package with uri '*' not found.","

When I try do to an acceleo trasformation I get this error:

Exception in thread ""main"" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/mmt/qvtd/UmlToRdbms#rdbmsMM' not found. (file:/D:/Utenti/davi9/mde-workspace/Assignment2/Models/dummy.xmi, 7, 108)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
    at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
    at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:391)
    at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:356)
    at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:488)
    at org.eclipse.acceleo.module.sample.common.Generate.<init>(Generate.java:90)
    at org.eclipse.acceleo.module.sample.common.Generate.main(Generate.java:144)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/mmt/qvtd/UmlToRdbms#rdbmsMM' not found. (file:/D:/Utenti/davi9/mde-workspace/Assignment2/Models/dummy.xmi, 7, 108)

.....

How can I solve this problem?

" "54508906","11010289","2019-02-04 00:17:47","","1","0","","58","-1","EMF recursive subproperties","

As you can see, the metamodel has a Test, which has properties. These can also have subproperties.

I want now to code a method, which gives back the properties as well as all other subproperties. Here is the naive approach without recursion. Please help me.

public EList<TestProperty> getProperties() {
        if (properties == null) {
            properties = new EObjectContainmentEList<TestProperty>(TestProperty.class, this,
                    Iec62264Package.TEST__PROPERTIES);
        }
        for (TestProperty property : properties) {
            properties.add(property.getSubProperties());
        }
        return properties;
    }

Metamodel

" "54517986","7392308","2019-02-04 14:10:23","","2","1","","89","3","UML - Is it possible to add ActivityPartitions to StructuredActivityNodes?","

In the UML Specifications on page 476 there is the following diagram:

If I'm not mistaken, it should not be possible to add ActivityPartions (which are a specialization of ActivityGroups - just like StructuredActivityNodes) to a StructuredActivityNode, right? According to the diagram the only relationship between StructuredActivityNodes and ActivityGroup is a generalization/specialization relationship. There should be a composition relationship as well if Partitions in StructuredActivityNodes would be possible.

Am I wrong? I'm asking because it is possible in some tools (VisualParadigm for example) but not possible in other tools.

" "55088928","11179872","2019-03-10 14:54:54","","1","0","","79","1","Action Language for Foundational UML (ALF) web system","

Is it possible to use ALF to model and generate simple information system/web app? Or is it better to use standards like IFML + some other technologies to model and generate it?

" "55325144","11179872","2019-03-24 15:03:12","","1","0","","33","0","Is ALF part of MDA?","

Action language for fUML (ALF) is a language based on fUML and Model-Driven Architecture is an approach which uses models to develop software.

But how is ALF related to Model-Driven Architecture (MDA)?

" "57173321","1187220","2019-07-23 23:17:16","","1","0","","60","0","Xtext/ANTLR: How to fix this error? The following token definition can never be matched prior...?","

I have made a grammar and the editor does not show any error, when I select 'Generate XText Artifacts', I get the following error:

error(208): ../mestra.dmxlightshow/src-gen/mestra/parser/antlr/internal/InternalDmxLightShow.g:3668:1: The following token definitions can never be matched because prior tokens match the same input: RULE_MIDI_CHANNEL error(208): ../mestra.dmxlightshow.ide/src-gen/mestra/ide/contentassist/antlr/internal/InternalDmxLightShow.g:10741:1: The following token definitions can never be matched because prior tokens match the same input: RULE_MIDI_CHANNEL

MIDI_CHANNEL / MidiChannel is only used in the following fragments:

MidiNoteTrigger:
    'Note' onOff=ON_OFF 'Channel' mc=MidiChannel ('Note' note=MidiNote | 'NoteRange' noteRange=MidiNoteRange) velocity=MIDI_VALUE;

MidiCcTrigger:
    'CC' 'Channel' mc=MidiChannel 'Number' ccNumber=(MIDI_VALUE) ('Value' value=MidiValue | 'ValueRange' valueRange=MidiValueRange);

MidiAftertouchTrigger:
    'Aftertouch' 'Channel' mc=MidiChannel ('Value' value=MidiValue | 'ValueRange' valueRange=MidiValueRange);

MidiProgramChangeTrigger:
    'PrgChg' 'Channel' mc=MidiChannel 'Bank' bank=MidiValue 'Program' program=MidiValue;

MidiChannel: 
    channel=('OMNI' | MIDI_CHANNEL);

At the start of each rule (except MidiChannel' there is a keyword ('Time', 'Note', 'CC', 'Aftertouch', 'PrgCh', so I hoped following rules would be all unique.

And the definition of MIDI_CHANNEL is:

terminal MIDI_CHANNEL:
    ('1' '0'..'6') |
    (    '0'..'9');

How can I fix this error?

The full grammar is below:

TESTS I DID

  1. Changing the rule into a different name and written out numbers:

    terminal MIDI_CHANNEL_NUMBER: ('1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | '13' | '14' | '15' | '16');

    Result: same error with different name (MIDI_CHANNEL_NUMBER)

  2. Removed the reference to MIDI_CHANNEL_NUMBER (so the rule is never used):

    Result: ERROR IS STILL PRESENT. I did not expect this as it is nowhere used.

  3. Removing numbers 10 to 16 from the list

    Result: Error is still present.

  4. Removed ( and )

    Result: Error is still present.

  5. Changing values to 'x' and 'y'

    Result: Error disappears. But I don't want values x and y, but 1 to 16.

FULL GRAMMAR

// Grammar 
grammar mestra.DmxLightShow with org.eclipse.xtext.common.Terminals

generate dmxLightShow 'http://www.DmxLightShow.mestra'

// Main structure

Mestra:
    'songs:'    songs   +=Song+ 
    'triggers:' triggers+=RuleTrigger+ 
    'commands:' commands+=Command+;

// Song structure

Song:
    'song' name=ID ':'
      'bank' bank=MIDI_VALUE 'program' program=MIDI_VALUE ';'
      rules=Rules
      ('order'      sequenceRefs+=[Sequence] (',' sequenceRefs+=[Sequence])* ';'
       'sequences:' sequences   += Sequence+)?;

Sequence:
    'sequence' name=ID ':'
       rules=Rules
      ('order'  stepRefs+=[Step] (',' stepRefs+=[Step])* ';'
       'steps:' steps   += Step+)?;

Step:
    'step' name=ID  ':'
       rules=Rules;

// Rules

Rules: 
    {Rules} rules+=Rule*;

Rule:
    'rule' (ruleTriggers=RuleTriggers ':')? ruleCommands=RuleCommands ';';

RuleTriggers:
    triggerRefs+=[RuleTrigger] (',' triggerRefs+=[RuleTrigger])*;

RuleCommands:
    commandsRefs+=[Command] (',' commandsRefs+=[Command])*;

// Rule Triggers

RuleTrigger:
    name=ID type=(/* DmxRuleTrigger | */ MidiRuleTrigger) ';';

// DmxRuleTrigger: // Not supported

MidiRuleTrigger:
    type=(MidiTimeTrigger | MidiNoteTrigger | MidiCcTrigger | MidiAftertouchTrigger | MidiProgramChangeTrigger) ';';

MidiTimeTrigger:
    'Time' time=Time;

MidiNoteTrigger:
    'Note' onOff=ON_OFF 'Channel' mc=MidiChannel ('Note' note=MidiNote | 'NoteRange' noteRange=MidiNoteRange) velocity=MIDI_VALUE;

MidiCcTrigger:
    'CC' 'Channel' mc=MidiChannel 'Number' ccNumber=(MIDI_VALUE) ('Value' value=MidiValue | 'ValueRange' valueRange=MidiValueRange);

MidiAftertouchTrigger:
    'Aftertouch' 'Channel' mc=MidiChannel ('Value' value=MidiValue | 'ValueRange' valueRange=MidiValueRange);

MidiProgramChangeTrigger:
    'PrgChg' 'Channel' mc=MidiChannel 'Bank' bank=MidiValue 'Program' program=MidiValue;

MidiChannel: 
    channel=('OMNI' | MIDI_CHANNEL);

MidiValue:
    value=MIDI_VALUE;

MidiValueRange:
    start=MIDI_VALUE '-' end=MIDI_VALUE;

MidiNote: 
    'Note' note=MIDI_NOTE;

MidiNoteRange: 
    'NoteRange' start=MIDI_NOTE '-' end=MIDI_NOTE;

Time:
    'Time' time=INT type=('ms' | 's' );

// Commands

Command:
    name=ID type=(DmxCommand /* | MidiCommand */ ) ';';

// MidiCommand: // Not supported

DmxCommand:
    parGroup=ParGroup dmxSubCommands=DmxSubCommands ';';

ParGroup:
    (parGroup=  'AllGroupsAll' | 
                {ParGroup} 'AllGroupsCenter' |
                {ParGroup} 'AllGroupsAllExceptEgoRisers' |
                {ParGroup} 'AllGroupsLeft' |
                {ParGroup} 'AllGroupsRight' |
                {ParGroup} 'LedBarAll' |
                {ParGroup} 'LedBarCenter' |
                {ParGroup} 'LedBarLeft' |
                {ParGroup} 'LedBarRight' |
                {ParGroup} 'DrumsAll' |
                {ParGroup} 'DrumsLeft' |
                {ParGroup} 'DrumsRight' |
                {ParGroup} 'EgoRisersAll' |
                {ParGroup} 'EgoRisersLeft' |
                {ParGroup} 'EgoRisersRight' |
                {ParGroup} 'FrontAll' |
                {ParGroup} 'FontCorners' |
                {ParGroup} 'FrontMiddle' |
                {ParGroup} 'FrontInner' |
                {ParGroup} 'FrontOuter' |
                {ParGroup} 'FrontLeft1Inside' |
                {ParGroup} 'FrontLeft2' |
                {ParGroup} 'FrontLeft3' |
                {ParGroup} 'FrontLeft4Outside' |
                {ParGroup} 'FrontLeftAll' |
                {ParGroup} 'FrontLeftInner' |
                {ParGroup} 'FrontLeftOuter' |
                {ParGroup} 'BannerAll' |
                {ParGroup} 'BannerLeft' |
                {ParGroup} 'BannerRight' |
                {ParGroup} 'FrontRight1Inside' |
                {ParGroup} 'FrontRight2' |
                {ParGroup} 'FrontRight3' |
                {ParGroup} 'FrontRight4Outside' |
                {ParGroup} 'FrontRightAll' |
                {ParGroup} 'FrontRightInner' |
                {ParGroup} 'FrontRightOuter');

DmxSubCommands:
    {DmxSubCommands} 
    (mode=DmxModeSubCommand)? 
    (preset=DmxPresetSubCommand)?  
    (delayTime=DmxDelayTimeSubCommand)? 
    (strobeTime=DmxStrobeTimeSubCommand)? 
    (stepNumber=DmxStepNumberSubCommand)? 
    (hold=DmxHoldSubCommand)? 
    (once=DmxOnceSubCommand)? 
    (DefaultColor=DmxDefaultColorSubCommand)? 
    (AlternateColor=DmxAlternateColorSubCommand)?;

DmxModeSubCommand:
    'Mode' DmxModeSubCommandData;

DmxModeSubCommandData:
    type=('trigger' | 'loop' | 'once' | 'restart');

DmxPresetSubCommand:
    'Preset' DmxPresetSubCommandData;

DmxPresetSubCommandData:
    presetName=                          'def2alt' |
               {DmxPresetSubCommandData} 'alt2def' |
               {DmxPresetSubCommandData} 'switch_def_alt' |
               {DmxPresetSubCommandData} 'def2act' |
               {DmxPresetSubCommandData} 'actual2def' |
               {DmxPresetSubCommandData} 'switch_def_actual' |
               {DmxPresetSubCommandData} 'alt2actual' |
               {DmxPresetSubCommandData} 'actual2alt' |
               {DmxPresetSubCommandData} 'switch_alt_actual' |
               {DmxPresetSubCommandData} 'solid' |           
               {DmxPresetSubCommandData} 'dual_colors_def_alt' |
               {DmxPresetSubCommandData} 'dual_colors_alt_def' |
               {DmxPresetSubCommandData} 'chase_left2right' |
               {DmxPresetSubCommandData} 'chase_right2left' |
               {DmxPresetSubCommandData} 'switch_left_right_left' |
               {DmxPresetSubCommandData} 'switch_right_left_right' |
               {DmxPresetSubCommandData} 'fade_alt2def' |
               {DmxPresetSubCommandData} 'fade_def2alt' |
               {DmxPresetSubCommandData} 'fade_def_alt_def' |
               {DmxPresetSubCommandData} 'fade_alt_def_alt' |
               {DmxPresetSubCommandData} 'fade_chase_left2right' |
               {DmxPresetSubCommandData} 'fade_chase_right2left' |
               {DmxPresetSubCommandData} 'fade_chase_left_right_left' |
               {DmxPresetSubCommandData} 'fade_chase_right_left_right' |
               {DmxPresetSubCommandData} 'rainbow_no_fade_left2right' |
               {DmxPresetSubCommandData} 'rainbow_no_fade_right2left' |
               {DmxPresetSubCommandData} 'rainbow_fade_left2right' |
               {DmxPresetSubCommandData} 'rainbow_fade_right2left';

DmxDelayTimeSubCommand:
    'DelayTime' time=Time;

DmxStrobeTimeSubCommand:
    'StrobeTime' time=Time;

DmxStepNumberSubCommand:
    'StepNumber' (last='Last' | value=INT);

DmxHoldSubCommand:
    'Hold' onOff=ON_OFF;

DmxOnceSubCommand:
    'Once' onOff=ON_OFF;

DmxDefaultColorSubCommand:
    'DefaultColor' color=DmxColor;

DmxAlternateColorSubCommand:
    'AlternateColor' color=DmxColor;

DmxColor: 
    ShortDmxColor | LongDmxColor;

ShortDmxColor:
    {ShortDmxColor} (intensity='I')? (red='R')? (green='G')? (blue='B')? (white='W')?;

LongDmxColor:
    intensity=DMX_VALUE red=DMX_VALUE green=DMX_VALUE blue=DMX_VALUE (white=DMX_VALUE)?;

// Terminals

terminal MIDI_VALUE: 
    ('1' '2'      '0'..'7') |
    ('1' '0'..'1' '0'..'9') |
    (    '1'..'9' '0'..'9') |  
    (             '0'..'9');

terminal DMX_VALUE: 
    ('2' '5'      '0'..'5') |
    ('2' '0'..'4' '0'..'9') |
    ('1' '0'..'9' '0'..'9') |
    (    '1'..'9' '0'..'9') |  
    (             '0'..'9');

terminal MIDI_CHANNEL:
    ('1' '0'..'6') |
    (    '0'..'9');

terminal MIDI_NOTE: 
    ('C' | 'D' | 'E' | 'F' | 'G' | 'A' | 'B') 
    ('b' | '#') 
    ('0'..'9') | ('1' '0'..'1');

terminal ON_OFF: 
    ('ON' | 'OFF');
" "57173543","1187220","2019-07-23 23:51:29","","1","4","","37","0","Numbers in XText not accepted","

I have the following rule:

terminal MIDI_VALUE: 
 (             '0'..'9') |
 (    '1'..'9' '0'..'9') |
 ('1' '0'..'1' '0'..'9') |
 ('1' '2'      '0'..'7');

This rule is meant to read values from [0..127].

However, it does not accept values from [1..16], while 0 and 17 to 127 is accepted.

When I hover over the error I get:

mismatched input: '16' expecting RULE_MIDI_VALUE.

How can I fix this?

2nd Example

This example is maybe even more trivial:

DmxDelayTimeSubCommand:
    'DelayTime' time=Time;

Time:
    time=INT type=('ms' | 's' );

While the input

    AllFrontBlue AllGroupsAll Mode loop DelayTime 255 ms;

Shows an error over 255 showing when hovering over it:

Mismatched input '255' expecting RULE_INT

While RULE_INT is a predefined terminal:

terminal INT returns ecore::EInt: ('0'..'9')+;

I get this error for all values below 256 (all values from [0..255]).

" "57792236","11078057","2019-09-04 16:08:38","","2","3","","111","0","Model, Meta-model and Meta-metamodel","

The argument

i'm studying software engineering, and i'm on "model driven engineering" course slides.

The main topic of this slides is, obviously, the model.

the definition for the general concept of a model is:

A model is an abstract representation of a system, wich represent it from certain point of view

then continues defining the meta-model concenpt:

A meta-model is a model used for build and understand a model. every model must conform to a meta-model

my course slides make the example of map of subway (model) and it legend (meta-model)

ok, so far so good.

Then it doesn't stop and continue with meta-metamodel definition

a meta-metamodel is a model used for build and understand meta-model. every meta-model must conform to meta-metamodel.

The doubt

Now i'm thinking about what a designer do in an analysis of a generic problem.

example

pick the problem of mantaining the information of a zoo in wich there are:

  • Animal
  • Cage (in which are stored animal)
  • Workers(that feed animal)

Now, in my mind a model of this "domain" is:

and a meta-model of this model is:

ok, now who/what is the meta-metamodel?

" "57976997","10955827","2019-09-17 14:55:59","","1","1","","59","1","The relation between Class Diagrams and OCL","

I know the following:

  • OCL is a constraint language that to specify constraints on my class diagram models
  • I know, that in the OMG world for class diagrams there are 3 levels of models: M1 (model), M2 (meta-mode), M3 (meta-meta model)
  • M3: defines what a class diagram is and what it consists of
  • M2: Is the meta-model of my problem/domain (e.g.: meta-model of a shelf that contains books)
  • M3: is the model instance (e.g: a Shelf that contains two specific books)

What i would like to know:

  • Is there a a common meta-model for class diagrams and OCL; basically something that defines the relationship between model elements and constraints
  • I suppose it should somehow be defined at M1 level

I am asking because:

  • I would like to define a meta-model for a constraint language (lightweight OCL) that would allow for me to reason about my model elements (books on the shelf).
  • How would i connect the meta-models of my domain and of my constraint language?
" "58590361","5206736","2019-10-28 11:45:38","","1","0","","38","0","Is there a Simple OSLC Metamodel Showing Entities and Relationships?","

There seems to be any amount of RDF-format for the OSLC but what I'm looking for is a simple E-R-like view of the OSLC metamodel which shows the concepts and relationships which can be used to understand the organisation and possible queries.

Is there a (graphic) representation of the OSLC metamodel anywhere?

" "61018736","6210971","2020-04-03 18:58:55","","1","1","","38","0","How much does Enterprise Architect support OCL language?","

http://wp13117963.server-he.de/blog/2007/01/15/ocl-support-in-enterprise-architect/comment-page-1/#comment-2035

I am facing an issue mentioned in the above article. i.e. Enterprise Architect is not giving any error when I create a constraint on an attribute with wrong syntax.

"