/domainmodel-code-generator-csharp

Domain Model Code Generator for C#

Primary LanguageC#MIT LicenseMIT

Domain Model Code Generator for C#

Generator library that generate from BridgePoint domain model to C# Application Library running in memory.

How to use

  1. Create conceptual information model for your conceptual domain according to the style of eXecutable and Translatable UML modeling.
  2. Generate application library from the model. Please see Sample Generator Application.
  3. Or GUI Application. Please see GUI Application.

※ You can use BrdigePoint MicrowaveOven, LaundromatInHotel or ProcessManagement as a sample model. ※ Generated DTDL schemas of LaundromatInHotel are published at https://github.com/kae-made/artifacts-laundromat-in-hotel-tutorial/tree/main/code/csharp/LaundromatInHotel.


Built in your generator tool.

User can use Generator library as NuGet package.


Overview of Translation Rule

  • Generate an interface, base implement class for each class
  • Generate an state machine class for each class with state model
  • For each element of each class
xtUML -> C#
class -> DomainClassClassName, DomainClassClassNameBase(, DomainClassClassNameStateMachine)
attribute -> property
event -> DomainClassClassNameStateMachine.EventName
operation -> methods of DomainClassClassName
  • Relationships are defined in the DomainClassClassName interface as reference instance, get linked instances, link and unlink method.
  • Generate action code of function, transformer, entry action and methematical attribute
  • Generate wrapper class of each External Entity
    • TIM C# implementation can be used.
  • Generate adaptor class for other domain implementation