Python-specific approaches to the redesign.
1) Abstract Factory Pattern - we need a python equivalent to support differentiation. Use this:
# Standard import
import importlib
# Load "module.submodule.MyClass"
MyClass = getattr(importlib.import_module("module.submodule"), "MyClass")
# Instantiate the class (pass arguments to the constructor, if needed)
instance = MyClass()
2) JSON support for differentiation - use flat models as much as possible, allow additional properties for message sub-types:
"paramkey": {
"_comment": "canonical url param key definitions",
"type": "object",
"properties": {
"additionalProperties": true
}
3) Database support for differentiation:
Four strategies to support subclassing (differentiation) in Hibernate.
The original design used #4 (Joined) model, it's a common design in IBM WCS and requires more complexity to gain more flexibility. I also used it in this design.
Comments