From 9b3a4c5a44b188db717ea788d88f48fafbceda6d Mon Sep 17 00:00:00 2001 From: Andrei Bondarenko Date: Sat, 14 Aug 2021 16:31:56 +0200 Subject: [PATCH] Defined SCD services interface --- bootstrap/primitive.py | 21 ++++++++++++++++++ services/scd.py | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 bootstrap/primitive.py create mode 100644 services/scd.py diff --git a/bootstrap/primitive.py b/bootstrap/primitive.py new file mode 100644 index 0000000..89e4fd8 --- /dev/null +++ b/bootstrap/primitive.py @@ -0,0 +1,21 @@ +from state.base import State, UUID + + +def bootstrap_type_type(model_root: UUID, state: State) -> UUID: + pass + + +def bootstrap_boolean_type(model_root: UUID, state: State) -> UUID: + pass + + +def bootstrap_integer_type(model_root: UUID, state: State) -> UUID: + pass + + +def bootstrap_float_type(model_root: UUID, state: State) -> UUID: + pass + + +def bootstrap_string_type(model_root: UUID, state: State) -> UUID: + pass diff --git a/services/scd.py b/services/scd.py new file mode 100644 index 0000000..9cab2b9 --- /dev/null +++ b/services/scd.py @@ -0,0 +1,48 @@ +from services.base import Service, UUID +from state.base import State +from typing import Any, List + + +class SCD(Service): + def __init__(self, model: UUID, state: State): + super().__init__(model) + self.state = state + + def create_class(self, name: str, abstract: bool, min_c: int, max_c: int): + pass + + def create_association(self, name: str, source: str, target: str, src_min_c: int, src_max_c: int, tgt_min_c: int, tgt_max_c: int): + pass + + def create_global_constraint(self, name: str): + pass + + def create_attribute(self, name: str): + pass + + def create_attribute_link(self, source: str, target: str, name: str, optional: bool): + pass + + def create_model_ref(self, name: str, model: UUID): + pass + + def create_inheritance(self, child: str, parent: str): + pass + + def add_constraint(self, element: str, code: str): + pass + + def list_elements(self): + pass + + def delete_element(self, name: str): + pass + + def update_class(self, name: str, abstract: bool, min_c: int, max_c: int): + pass + + def update_association(self, name: str, src_min_c: int, src_max_c: int, tgt_min_c: int, tgt_max_c: int): + pass + + def update_attribute_link(self, name: str, attribute_name: str, optional: bool): + pass