MDrivenText
(Adding page to Category:TOC because it contains a TOC.)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Proposed new ViewModel data textual representation.
This is the proposed new ViewModel data textual representation.


Goals: Text based modeling, more to-the-point, less bloated, easier to write format than json (specially true if you consider attribute values that in turn are strings that may have special chars like ',",{ etc )
'''Goals:''' Text-based modeling, more to-the-point, less bloated, in an easier-to-write format than JSON (especially true if you consider attribute values that in turn are strings that may have special chars like ',",{ etc).


====== How does the format look: ======
====== How the Format Looks: ======
  viewmodel ValueOfFirstColumn{   
  viewmodel ValueOfFirstColumn{   
   column NameOfAColumn{ValueOfThatColumn}   
   column NameOfAColumn{ValueOfThatColumn}   
Line 24: Line 24:
  }   
  }   


An Example if the ViewModel is named "class", has a nesting "attribute" and another nesting "role"
An example of when the ViewModel is named "Class", has a nesting "Attribute" and another nesting "Role":
  class Thing{   
  class Thing{   
   SuperClass{SomeSuper}   
   SuperClass{SomeSuper}   
Line 38: Line 38:
  }
  }


====== Definition of format ======
====== Definition of the Format ======
classifier+space+Key{ ===content===}
classifier+space+Key{ ===content===}
The ===content=== is defined as:  <code>[classifier+space+]Key{===content===}</code>


The ===content=== is defined as:  [classifier+space+]Key{===content===}
Every key must be unique in its list.


Every key must be unique in its list
Format treats multi or single relations the same - and to a certain extent, even attributes.


Format treat multi or single relation the same - and to a certain extent even attributes
A list property can be set in 2 ways:
* <code>classifier+space+key{}</code> repeated with unique keys
* or <code><nowiki>nameoflist{key1{} key2{} key3{}}</nowiki></code> (explicit form)
Why have classifiers and not always use the explicit form: easier for the eye to read and resembles C#.


<nowiki>A list property can be set in 2 ways; classifier+space+key{} repeated with unique keys , or nameoflist{key1{} key2{} key3{}} (explicit form)</nowiki>
What are classifiers: The definition of the target structure is a ViewModel, ViewModelName, and NestingNames


Why have classifiers and not always use explicit form : easier on the eye to read - resembles c#.
====== How does the format differ from JSON? ======
* JSON has <code>""</code> on identifiers - MDrivenText does not.


What are classifiers : The definition of the target structure is a ViewModel, ViewModelName and NestingNames corresponds to classifiers.
* JSON makes heavy use of commas as separators - MDrivenText does not.
* JSON handles arrays differently than properties with <code>[</code> enclosures; MDrivenText derives this knowledge from context.
* MDrivenText has a special meaning ViewModel/Nesting classifier separate from other properties.
* JSON must handle multi-links as arrays whereas MDrivenText collects keys based on the Nesting classifier to build lists.
* MDrivenText only has three language fixed elements: the {}, space, and double quote - the first builds structure, the second separates definitions, and the third is standard string enclosure. All other characters are part of the content.


====== How does the format differ from json? ======
====== What are use-cases? ======
* - json has "" on identifiers MDrivenText does not
Initially, a use-case will be used in MDrivenDesigner to provide text-based editing of classes, Statemachines, ViewModels, and Actions. This in turn will be the initial format when experimenting with other ways (than MDrivenDesigner) to change the model.


* - json make heavy use of comma as seperator - MDrivenText does not
'''How will the format be implemented - is this a new transformation?'''
* - json handles arrays differently than properties with [ enclosures, MDrivenText derives this knowledge from context
* We will use TajSon functionality and route all logic through the TajSon Mechanisms.
* - MDrivenText has special meaning ViewModel/Nesting classifier separate from other properties
Plans are to allow for a generic editable textual representation of any ViewModel.
* - json must handle mulltilinks as arrays - MDrivenText collects keys based in Nesting classifier to build lists
[[Category:MDrivenStart]]
* - MDrivenText only has three language fixed elements the {}, space and double quot - the first build structure - the second separates definitions - the third is standard string enclosure. All other characters are part of content
{{Edited|July|12|2024}}


====== What are the use-cases? ======
[[Category:TOC]]
Initially it will be used in MDrivenDesigner to provide textbased editing of classes, statemachines, viewmodels and actions. This in turn will be the initial format when experimenting with other ways (than MDrivenDesigner) to change the model
 
How will the format be implemented - is this a new transformation?
 
We will use TajSon functionality and route all logic through the TajSon Mechanisms
 
Plans are to allow for a generic editable textual representation of any viewmodel.

Latest revision as of 13:31, 26 March 2024

This is the proposed new ViewModel data textual representation.

Goals: Text-based modeling, more to-the-point, less bloated, in an easier-to-write format than JSON (especially true if you consider attribute values that in turn are strings that may have special chars like ',",{ etc).

How the Format Looks:
viewmodel ValueOfFirstColumn{  
  column NameOfAColumn{ValueOfThatColumn}  
  column NameOfAColumn1{ValueOfThatColumn}  
  column NameOfAColumn2{ValueOfThatColumn}  
  column NameOfAColumn3{ValueOfThatColumn}  
  nesting ValueOfFirstColumnOfNestedObject{    
    column NameOfAColumn{ValueOfThatColumn}  
    column NameOfAColumn1{ValueOfThatColumn}  
    column NameOfAColumn2{ValueOfThatColumn}  
    column NameOfAColumn3{ValueOfThatColumn}  
    }  
    
  nesting ValueOfFirstColumnOfNestedObject{    
    column NameOfAColumn{ValueOfThatColumn}  
    column NameOfAColumn1{ValueOfThatColumn}  
    column NameOfAColumn2{ValueOfThatColumn}  
    column NameOfAColumn3{ValueOfThatColumn}  
    }  
}  

An example of when the ViewModel is named "Class", has a nesting "Attribute" and another nesting "Role":

class Thing{  
  SuperClass{SomeSuper}  
  attribute Attribute1{    Type{string}  }  
  role Detail2{  
    Cardinality{0..*}    
    TargetType{Detail}      
    BackName{Thing2}
    BackCardinality{0..1}
    Aggregation{composite}
    IsNavigable{true}
    RoleClass{TheRoleClass}  } 
}
Definition of the Format
classifier+space+Key{ ===content===}

The ===content=== is defined as: [classifier+space+]Key{===content===}

Every key must be unique in its list.

Format treats multi or single relations the same - and to a certain extent, even attributes.

A list property can be set in 2 ways:

  • classifier+space+key{} repeated with unique keys
  • or nameoflist{key1{} key2{} key3{}} (explicit form)

Why have classifiers and not always use the explicit form: easier for the eye to read and resembles C#.

What are classifiers: The definition of the target structure is a ViewModel, ViewModelName, and NestingNames

How does the format differ from JSON?
  • JSON has "" on identifiers - MDrivenText does not.
  • JSON makes heavy use of commas as separators - MDrivenText does not.
  • JSON handles arrays differently than properties with [ enclosures; MDrivenText derives this knowledge from context.
  • MDrivenText has a special meaning ViewModel/Nesting classifier separate from other properties.
  • JSON must handle multi-links as arrays whereas MDrivenText collects keys based on the Nesting classifier to build lists.
  • MDrivenText only has three language fixed elements: the {}, space, and double quote - the first builds structure, the second separates definitions, and the third is standard string enclosure. All other characters are part of the content.
What are use-cases?

Initially, a use-case will be used in MDrivenDesigner to provide text-based editing of classes, Statemachines, ViewModels, and Actions. This in turn will be the initial format when experimenting with other ways (than MDrivenDesigner) to change the model.

How will the format be implemented - is this a new transformation?

  • We will use TajSon functionality and route all logic through the TajSon Mechanisms.

Plans are to allow for a generic editable textual representation of any ViewModel.

This page was edited 46 days ago on 03/26/2024. What links here