complicated • The generated code is not clean or does not meet expectations • The tool is intrusive: the generator imposes choices (code style, framework, etc.) Why Telosys ? Black box Model Generated files Result : different from what we want!
templates Project conf Result : exactly what we want Generated files Black box Model Generated files Result : different from what we want! Telosys is fully customizable customization
Each project can make its own choices : You decide, Telosys adapts! It is possible thanks to : • model extensibility ( 50+ “annotations” & specific “tags” ) • customizable templates ( Velocity language improved with many additional features ) • native support for composite primary keys (and FK) Telosys is the only generator offering such flexibility
Very simple grammar , extendable with "tags" DSL #tag 1 model = 1 directory 1 entity = 1 text file ( « .entity » ) What does a Telosys model look like? Simple & easy
Key ) num : int { @Id @NotNull @Label("order number") } ; orderDate : date { @NotNull @Label("order date")} ; status : short { @NotNull @DefaultValue(0) #MyTag(123) }; comment : string { @Size(120) } ; // FK referencing Customer customerId : int { @FK(Customer) } ; // Links items : OrderItem[] ; // Many deliveryAddress : DeliveryAddress ; // One // No link to Customer (not in the aggregate, just FK) } Attributes Links Entity Annotation (pre-defined) Tag (user-defined) Neutral type (language-independent) composite PK supported with multiple “@Id” What does a Telosys entity look like?
lm list models • m print or set current model • cm check model validity • em edit model description • nm new model • dm delete model • le list entities in current model • ee edit entity • ne new entity • de delete entity
to generate any kind of file from a given model ( they can generate files for any language with any framework ) One model to rule them all MODEL declarative part processing part
@author ${AUTHOR} * */ public class ${entity.name}RestDto { #foreach($attribute in $entity.attributes) private $attribute.type $attribute.name; #end What does a Telosys template look like? http://velocity.apache.org/ Telosys template engine is Velocity (well-known, open source and well documented) Templates language is VTL (Velocity Template Language) • Directives : #foreach, #if, #set,... • Variables & objects (from model) : $entity, $AUTHOR, $attribute.type, ... • Specific Java Classes can be added (if necessary)
that can be used to generate a specific part of the application (persistence, entities, screens, rest handlers, etc) Telosys templates packaging (“bundle”) Each "bundle of templates" is usually stored in a Git repository Git repository
bundles • b print or set current bundle • ib install bundle • eb edit bundle • db delete bundle • lt list templates in current bundle • et edit template