lunifera / lunifera-issues

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

[lunifer-dsl] Prefix elements from semantic model #15

Closed florianpirchner closed 11 years ago

florianpirchner commented 11 years ago

We should prefix all the element from the semantic model. So they can be separated very easily from runtime elements with the same name.

For instance the uiModel

So its very easy to use the semantic element in the presentation element and confusions can be reduced to a minimum.

class UiTextField {
           private YTextField modelElement;
            UiTextField(YTextField modelElement) {
                     this.modelElement = modelElement)
            ....

Another big advantage is, that i do not have to deal with full qualified class names.

OrganizationModel

For the organization model i am using O... OOrganization, OUnit, OPersion

EntityModel

EntityModel uses L... LEntity, LProperty,...

cvgaviao commented 11 years ago

Don't understood. isn't namespace (package) for this purpose ?

florianpirchner commented 11 years ago

In the past it became common practice to add a prefix to emf model elements.

For instance e4 application model starts with M... MApplication, MAction,...

Ecore model starts by E... EAttribut, EObject, EClass,...

Genmodel start by Gen... GenAttribute, GenClass,...

XBase starts by X... XAnnotation,...

JVMTypesModel starts by JVM... JVMType, JVMTypeReference,...

cvgaviao commented 11 years ago

well, I really don't see any advantage.

I used to prefix or suffix things in old age, when I used to program Assembler, COBOL, Pascal, LISP or Clipper. I'm program Java since 1995 and I already see lots of libraries that has conflicting class names, but never had to prefix them. :)

florianpirchner commented 11 years ago

I first encountered that problem in redView. 3 classes that had the same name in different packages. One tripple for each uiField.

Was horrible to handle the class names with their packages.

cvgaviao commented 11 years ago

Yep, I got this kind of problem in my own framework. But I resolve it not prefixing all classes but the only the involved ones: ClassField, FormField, BindingField