Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » extending Xpand models(can you do it ?)
icon5.gif  extending Xpand models [message #516283] Tue, 23 February 2010 13:50 Go to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
I'm currently trying to see what it is possible to do using Xpand + MWE + Xtext (and ecore), and if I can use it for my intership.

So I've got a question, as I can't find exactly what is possible and what is not Very Happy

My point is to create databases, creating first a generic metamodel for a database, and using a more specific model for each database I'll have to create.
I want to generate API for those specific models automaticly, in any langage (providing I have the needed template, of course).
So there are my questions :

Can a model refer to another model, extending it ?
Can I do recursive extending, having a model refer to a model that refers to a model and so on ?

Can i redefine types ?
As in a "age" type, on which I define constraints (obviously an non-negative int).
Can I than use it as a simple type to classes, as we usually use int, string, bool ?



One day I shall master M2T, but that day has yet to come...
Re: extending Xpand models [message #516487 is a reply to message #516283] Wed, 24 February 2010 08:31 Go to previous messageGo to next message
Darius Jockel is currently offline Darius JockelFriend
Messages: 63
Registered: July 2009
Member
Hello!

MaximeLecourt wrote on Tue, 23 February 2010 08:50

Can a model refer to another model, extending it ?
Can I do recursive extending, having a model refer to a model that refers to a model and so on ?


Ecore is a framework to define metamodels and models providing the features you mentioned. You can use multiple inheritance. You can also
partionate your model in different files.

Quote:

Can i redefine types ?
As in a "age" type, on which I define constraints (obviously an non-negative int).
Can I than use it as a simple type to classes, as we usually use int, string, bool ?


What do you mean by redifine. It is possible to subclass existing (maybe abstract) types. If the subtyp also inherit from a 'simple type' you can use it like other simple types in your model.

Regards
Darius

Re: extending Xpand models [message #516615 is a reply to message #516487] Wed, 24 February 2010 15:33 Go to previous message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
Darius Jockel wrote on Wed, 24 February 2010 03:31
If the subtyp also inherit from a 'simple type' you can use it like other simple types in your model.



It's exactly what I meant.

Thank you

Maxime


One day I shall master M2T, but that day has yet to come...
Previous Topic:[JET2] <c:iterate> tag bahavior
Next Topic:[xtend] How to write this transformation?
Goto Forum:
  


Current Time: Thu Apr 25 17:49:13 GMT 2024

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

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

Back to the top