Overview of the samples¶
Codeable Models contains a number of example models and meta-models. In this section you find a brief overview
of the samples. The next section summarizes the meta-models.
The sample models can be found in the samples
directory. Some of them use reusable meta-models which
can be found in the metamodels
directory.
Shopping Model 1¶
File Name: samples/shopping_model1.py
This is a Codeable Models example realizing a simple sample shopping domain model. It is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
The example is explained in A first class model.
Shopping Model 2¶
File Name: samples/shopping_model2.py
This is a Codeable Models example realizing a simple sample shopping domain model focusing on class attributes. It is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
The example is explained in Class attributes.
Shopping Model 3¶
File Name: samples/shopping_model3.py
This is a Codeable Models example realizing a simple sample shopping domain model focusing on class relationships. It is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
The example is explained in Class relationships: associations and inheritance.
Shopping Model 4¶
File Name: samples/shopping_model4.py
This is a Codeable Models example realizing a simple sample shopping domain model. This is a cleaned-up version of the previous class del Shopping Model 1, Shopping Model 2, and Shopping Model 3 which uses coded model features. Those parts are explained in Improving the models through code.
The model is inspired by the model at: https://www.uml-diagrams.org/examples/online-shopping-domain-uml-diagram-example.html
Shopping Instances Model 1¶
File Name: samples/shopping_instance1.py
This is a Codeable Models object model example based on the previous class model samples. It uses the class model in Shopping Model 4.
The example is explained in A first object model.
Shopping Instances Model 2¶
File Name: samples/shopping_instance2.py
This is a Codeable Models object model example based on the previous class model samples. It uses the class model in Shopping Model 4. Compared to the previous sample Shopping Instances Model 1 it improve the model building through code.
The example is explained in Improving the models through code.
Shopping Activity Model 1 as Class Model¶
File Name: samples/shopping_activities1_class_model.py
This is a Codeable Models example realizing a sample shopping activity model as a class diagram. It is used to explain meta-modelling by using meta-classes and their relations from the Activity Metamodel.
It is inspired by the model at: https://www.uml-diagrams.org/online-shopping-uml-activity-diagram-example.html
The example is explained in A first meta-model.
Shopping Activity Model 1 as Instance Model¶
File Name: samples/shopping_activities1_instance_model.py
This is a Codeable Models example realizing a sample shopping activity model as an object diagram (classes as instances of meta-classes). It is used to explain meta-modelling by using meta-classes and their relations from the Activity Metamodel.
It is inspired by the model at: https://www.uml-diagrams.org/online-shopping-uml-activity-diagram-example.html
The example is explained in A first meta-model.
Shopping Activity Model 2¶
File Name: samples/shopping_activity_model2.py
This is a Codeable Models example realizing a sample shopping activity model and a workflow trace model derived from it.
It is used to explain meta-modelling by using meta-classes and their relations from the Activity Metamodel.
In particular, it looks into how to combine object, class, and meta-class del. That is, an activity class model is derived from an activity meta-model. The activity class model is used to define an object model for workflow traces. The trace objects are linked to domain model elements from Shopping Instances Model 2 (derived themselves from the class model in Shopping Model 4).
The example is explained in Combining object, class, and meta-class model.
The activity model is inspired by the model at: https://www.uml-diagrams.org/online-shopping-uml-activity-diagram-example.html
Microservice Component Model 1 as Class Model¶
File Name: samples/microservice_component_model1_class_model.py
This is a Codeable Models example realizing a sample component model, shown as a class model (class diagram). It is used to explain meta-modelling. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 1 as Instance Model¶
File Name: samples/microservice_component_model1_instance_model.py
This is a Codeable Models example realizing a sample component model, shown as an instance model (object diagram). It is used to explain meta-modelling. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 2 as Class Model¶
File Name: samples/microservice_component_model2_class_model.py
This is a Codeable Models example realizing a sample component model, shown as a class model (class diagram). It is used to explain meta-modelling with stereotypes. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 2 as Instance Model¶
File Name: samples/microservice_component_model2_instance_model.py
This is a Codeable Models example realizing a sample component model, shown as an instance model (object diagram). It is used to explain meta-modelling with stereotypes. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 3 as Class Model¶
File Name: samples/microservice_component_model3_class_model.py
This is a Codeable Models example realizing a sample component model at the class model level. It is used to explain meta-modelling with stereotypes. In particular, tagged values, introspection options, and default values features are used in the example. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Microservice Component Model 3 as Instance Model¶
File Name: samples/microservice_component_model3_instance_model.py
This is a Codeable Models example realizing a sample component model at the instance model level (i.e. instances of meta-classes are depicted in an object diagram). It is used to explain meta-modelling with stereotypes. In particular, tagged values, introspection options, and default values features are used in the example. It uses meta-classes from the Component Metamodel.
The example is explained in A meta-model with stereotypes.
Meta-Model Rendering¶
File Name: samples/metamodel_rendering.py
This is a Codeable Models example realizing the Plant UML rendering of predefined meta-del such as Activity Metamodel, Component Metamodel, and Microservice Components Metamodel used in the documentation.
Codeable Models Class Relations¶
File Name: samples/codeable_models_class_relations.py
This is a Codeable Models example modelling the Codeable Models classes, their attributes, and relations as a class model. The resulting views generated from this model are used throughout the API documentation to illustrate the relations of the various classes. Please use the API description in Codeable Models API documentation as a documentation of the meaning of the elements of this model.