4

I need a DSL (for Xtext) for describing a pretty standard object model:

  • There are entities
  • They have fields which can either be primitives or references to other entities
  • References can be 1:1, 1:N, N:1 or N:M

Not wanting to reinvent the wheel, what DSLs exist that implements this?

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820

1 Answers1

1

I believe that the current version of Xtext embeds an example that looks just like what you need.

esmiralha
  • 10,587
  • 1
  • 16
  • 20
  • Yes, but it's incomplete. It has 1:1 and 1:N mappings but I'm missing optional mappings (i.e. where one side can be NULL) and N:M mappings. – Aaron Digulla Mar 01 '11 at 20:08
  • @Aaron Digulla: Xtext is a tool for creating DSLs, if you find the existing one unsufficient, you can extend it. Xtext allows you even to inherit existing model and concrete syntax, which you can extend as you wish. – Gabriel Ščerbák Apr 02 '11 at 04:43
  • @Aaron Digulla: I did and I have nothing more to say than you should use GPL if you don't want to use DSL. – Gabriel Ščerbák Apr 04 '11 at 17:50
  • @Gabriel: I'm completely aware what Xtext is and can do. I'm sure there are people out there who already wrote a DSL for Hibernate and frameworks like that. My question is specifically for such examples. So your comment is useless for me :-) – Aaron Digulla Apr 05 '11 at 08:58