lunifera / lunifera-issues

Dummy repo - All the issues should be added here
0 stars 0 forks source link

Semantic model - to be discussed #2

Closed lunifera closed 11 years ago

lunifera commented 11 years ago

Semantic models should also be contained in this repo.

But what is about the base package org.lunifera.dsl ?

Should we really put semantic models in this package?

Like org.lunifera.dsl.semantic.entity

together with the xtext dsls

     org.lunifera.dsl.xtext.entity
     org.lunifera.dsl.xtext.entity.test
     org.lunifera.dsl.xtext.entity.ui

I mean, the semantic model is a dsl too! It allows us to model things based on the API. And Xtext is a DSL that allows us to model things based on a nice grammar.

So maybe it is fine if we mix these things up under a common base package.

Finally it would look like this:

     org.lunifera.dsl.semantic.entity
     org.lunifera.dsl.xtext.entity
     org.lunifera.dsl.xtext.entity.test
     org.lunifera.dsl.xtext.entity.ui

I think i like it!

rhandsch commented 11 years ago

What is org.lunifera.dsl supposed to contain? Of course the metamodel (xcore, or ecore based) and the xtext langue specification. Are compilers/generators for various platforms included as well? If yes, they might not fit below dsl.

What about

org.lunifera.persistencemodel.dsl
org.lunifera.persistencemodel.dsl.ui
org.lunifera.persistencemodel.gen.jpa
org.lunifera.persistencemodel.gen.db
org.lunifera.persistencemodel.gen.db.postgresql
org.lunifera.persistencemodel.gen.db.oracle
org.lunifera.persistencemodel.gen.db.db2
org.lunifera.persistencemodel.test

org.lunifera.uimodel.dsl
org.lunifera.uimodel.gen.vaadin
org.lunifera.uimodel.gen.rcp

where dsl contains the xcore and xtext definition and ´gen´and below contain the platform specific enhancers, compilers, generators. Howewer, I would prefer to have the metamodel (xcore) and language spec (xtext) in one project. Or dou you expect there will be several different xtext specifications for the same metamodel?

We could keep entity as well as synonym for the persistence (and service) layer, as well. Then it would all be below org.lunifera.entity.*.

cvgaviao commented 11 years ago

it is better you logout as lunifera and use florian account, don't you think ?

On 22/11/12 14:18, Lunifera.org wrote:

Semantic models should also be contained in this repo.

But what is about the base package |org.lunifera.dsl| ?

Should we really put semantic models in this package?

Like |org.lunifera.dsl.semantic.entity|

together with the xtext dsls

org.lunifera.dsl.xtext.entity org.lunifera.dsl.xtext.entity.test org.lunifera.dsl.xtext.entity.ui

I mean, the semantic model is a dsl too! It allows us to model things based on the API. And Xtext is a DSL that allows us to model things based on a nice grammar.

So maybe it is fine if we mix these things up under a common base package.

Finally it would look like this:

org.lunifera.dsl.semantic.entity org.lunifera.dsl.xtext.entity org.lunifera.dsl.xtext.entity.test org.lunifera.dsl.xtext.entity.ui

I think i like it!

— Reply to this email directly or view it on GitHub https://github.com/lunifera/lunifera-issues/issues/2.

florianpirchner commented 11 years ago

Thanks. I did not notice

Mit besten Grüßen Florian Pirchner

Am 24.11.2012 um 16:25 schrieb Cristiano Gavião notifications@github.com:

it is better you logout as lunifera and use florian account, don't you think ?

On 22/11/12 14:18, Lunifera.org wrote:

Semantic models should also be contained in this repo.

But what is about the base package |org.lunifera.dsl| ?

Should we really put semantic models in this package?

Like |org.lunifera.dsl.semantic.entity|

together with the xtext dsls

org.lunifera.dsl.xtext.entity org.lunifera.dsl.xtext.entity.test org.lunifera.dsl.xtext.entity.ui

I mean, the semantic model is a dsl too! It allows us to model things based on the API. And Xtext is a DSL that allows us to model things based on a nice grammar.

So maybe it is fine if we mix these things up under a common base package.

Finally it would look like this:

org.lunifera.dsl.semantic.entity org.lunifera.dsl.xtext.entity org.lunifera.dsl.xtext.entity.test org.lunifera.dsl.xtext.entity.ui

I think i like it!

— Reply to this email directly or view it on GitHub https://github.com/lunifera/lunifera-issues/issues/2.

— Reply to this email directly or view it on GitHub.

florianpirchner commented 11 years ago

Separate semantic model

Lunifera (for now the ui layer and the persistence layer) will heavily use the models as meta information at runtime.

Eg the UI Tiles will use the entity models (property set models) during runtime to do a m2m transformation to Ui Model which will immediatelly be rendered. So the semantic models are not only used by the dsl, but also in runtime mode for different issues.

I think it will make things really complicated if these models have a dependency to xtext. My idea is that OSGi services exist and return the semantic models. For the consumer of the services it does not matter how the semantic models have been created / prepared. Mostly they will be parsed by the xtext grammar for sure, but that is an implementation detail and invisible for the service consumer.

For instance EntityModelService:

interface IEntityModelService {
     LEntity getEntityFor(String fullQualifiedName);
}

So i think we really should extract the semantic models to their own bundle. But that can be the very last step. And after the problem with the genmodel using xcore is resolved.

Package structure

gen subpackage

Adding all the generator stuff to the gen bundles is a really good idea!

+1 for that feature!

sub project as first segment

My intention was to group all DSL related bundles to a common base package org.lunifera.dsl. But you are right. There is a leak in my suggestion. The sub project should be placed as a very early segment.

@rhandsch What is about that idea? It would merge our ideas. I think it is very intuitive then.

All bundles are...

It may appear curios that the semantic model is part of the dsl base package, but the semantic is also a part of the dsl and so i think it is fine to put it in there.

org.lunifera.dsl.persistencemodel.xtext
org.lunifera.dsl.persistencemodel.xtext.ui
org.lunifera.dsl.persistencemodel.semantic
org.lunifera.dsl.persistencemodel.gen.jpa
org.lunifera.dsl.persistencemodel.gen.db
org.lunifera.dsl.persistencemodel.gen.db.postgresql
org.lunifera.dsl.persistencemodel.gen.db.oracle
org.lunifera.dsl.persistencemodel.gen.db.db2
org.lunifera.dsl.persistencemodel.test

org.lunifera.dsl.uimodel.xtext
org.lunifera.dsl.uimodel.xtext.ui
org.lunifera.dsl.uimodel.semantic
org.lunifera.dsl.uimodel.gen.vaadin
org.lunifera.dsl.uimodel.gen.rcp

What do you think?

rhandsch commented 11 years ago

Sounds good! We might further shorten the name from persistencemodel to persistence because it is actually the name of the domain specific language. I'm not sure about the term semantic. Isn't it simply the model of our dsl? Then it could be

org.lunifera.dsl.persistence.model
org.lunifera.dsl.persistence.xtext
org.lunifera.dsl.persistence.xtext.ui
org.lunifera.dsl.persistence.gen.*
org.lunifera.dsl.persistence.test
florianpirchner commented 11 years ago

@cvgaviao Any objections?

Otherwise fine. Lets do it that way!

cvgaviao commented 11 years ago

well, I like the structure... the only concern was about org.lunifera.dsl.persistence.model

I could want to use the emf model without have to use a dsl based on it. but i could live with it :)

florianpirchner commented 11 years ago

Well, the idea was that the semantic model is not a Xtext grammar. But it is a DSL for its own. It offers great API and let you write code in the domain of the semantic model. So domain specific programming and domain specific language. Since its is in the DSL repo, it has the same base package org.lunifera.dsl.

So lets do it! ;-)