User Tools

Site Tools


Table of Contents

Data Modeling

The term "data modeling" may be a bit inaccurate. Generally, I'm trying to think about common themes in software design.

We would like to be able to define some sort of model, possibly hierarchical, with some of the following properties:

  • Attributes
    • May be simple types, enumerations, other objects, or collections of either
  • Validation
    • Validation of individual attributes
    • Validation of an object as a whole
      • For when multiple attributes must be validated together
    • Validation across multiple objects
      • Uniqueness
  • Default values
  • Ways of mapping to GUIs (native or web)
    • Things like human-readable labels, help text, hidden fields, etc.
    • Data binding (updating from model to GUI and back)
  • Serialization
    • Human-readable
    • Database
  • Parent/child references
  • Change notification

However, this seems prone to over-engineering, ending up with something "enterprisey", and/or something that works for a few cases but breaks down when you need to do anything complex.

For example:

  • A boolean or enum might enable/disable other fields, or otherwise affect their behavior

Related Tools

See also Code Generation

  • Cinnamon (Linux desktop) added a new settings API that uses a schema and generates configuration screens:
  • GNOME has GSettings / dconf (also used by MATE as of version 1.6).
  • KConfig (part of KDE Frameworks 5) generates code for configuration based on an XML description. Also KConfigWidgets for creating configuration dialogs.
  • Mo+ "model oriented programming language and IDE for model oriented development" sounds kind of interesting, but is Windows-only. Has its own GUI.


  • attrs (Hynek Schlawack)
    • "attrs is an MIT-licensed Python package with class decorators that ease the chores of implementing the most common attribute-related object protocols"
    • I don't see an obvious way of adding custom metadata (e.g. field labels)
    • TraitsUI
    • Enaml (declarative GUI)
    • Allows adding arbitrary attributes (e.g. "widget") to the SchemaNode objects
  • Django
    • Models define some additional properties that help to create interfaces
  • SQLAlchemy
    • Column and Table objects accept an info argument, which is an arbitrary dictionary of user-defined data
    • QtAlchemy
  • dip (GPL / Commercial; comes with PyQt license)
  • - "Object Data Mapping for Python"
info/data_modeling.txt · Last modified: 2016-03-01 17:50 by sam