Fact-Based Modeling #49
-
|
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Hi Mike, Thank you for taking an interest in NORMA and ORM. I'm glad you enjoyed the class. This seems like a discussion of the NY Yankees on a Red Sox board, but I'll at least get my toes wet, even though I really don't want to turn this git discussion into a long product comparison. The FactEngine product certainly has some features, especially the live FactEngine back end, that NORMA does not. It is also a cloud-based tool and comes with significant costs. Much of the ORM Solutions work is not on core NORMA and currently has limited distribution. While FactEngine focuses on a cloud hosted (or self-hosted for $$$) data back end, the work I'm doing (not yet in broad release, but feel free to talk to me private) is targeted at more of a full stack application generated from the model. This includes client-side model representation, data transport, generated write of arbitrarily complex model changes to the generated database, standalone client processing of the model elements, client-side model validation, etc. I'm moving rapidly towards this goal (and you can see some pieces on the @ ormsolutions channel on youtube), but am admittedly not to the point of the slick packaging which Victor has in his FactEngine project. [Huge tangent on ORM, feel free to skip] There is another school of thought that producing the perfect database (meaning one that fully implements the ORM model) will solve all of the worlds ills. The problem with this approach is that ORM constraints apply to a fully populated model, but can make it incredibly difficult to get to the fully populated stage if fully enforce. For example, given a model with object type A (with a generated id) and two xor subtypes B and C (absorbed into the A table) with a mandatory functional reference from C to B (this is not a complicated model), you are already in a situation where populating A is extremely difficult. Why? You need to get a row in the database to get a generated id you can reference, but a row-level-enforced exclusion constraint on the subtype partition (and all check clauses are row-level, even in a db that supports deferred constraints) means that you can't get an id for an A without knowing its subtype (even though the subtype pattern is satisfied by the end of the transaction). This is crazy complicated by hand, not to mention with an automatically generated imported. Basically, the complexities of enforcing all constraints mean either tons of end-of-transaction triggers (which will not make your db faster) or a db that is almost impossible to populate. This kind of defeats the purpose: the database is there to say 'yes, you can easily store your data in a performant fashion', not 'no', especially before the transaction commits. As for the core modeling experience, much of Boston seems to be a direct pull from NORMA. For example, the verbalization specs were published by Dr. Halpin (Terry), but things like verbalization colors are not part of that spec and are clearly pulled by Boston directly from the NORMA tool. NORMA, however (and IMO), has a much cleaner rendering of the ORM elements as published by Terry's specifications than Boston does. There are also some philosophical differences on rule entry. The NORMA rules (formal rule editors are in the Pro version of NORMA) are based on model navigation, not language parsing. This gives a much stronger feedback loop than you will see in a text-based rule system. If you enter the rule in and it verbalizes something that you did not intend then you immediately know if there is an issue. This feedback loop is very important as rules become more complex. You'll see more movement from NORMA in the next year or so. I went a full five years with an external (not tooling-related) position, and just finished another 5 as a single dad with full custody of 2 very young ones. Basically, August (and onwards) was the first time in a decade that I have been able to devote regular daylight work hours to NORMA and related products and frameworks. You won't see all of the work in the open source tool, but other parts will gradually be publicized and productized. [Note: I really don't want to turn this into a back-and-forth on NORMA vs Boston features. I honestly don't know enough about the other tool for a deep dive, and I think discussion here should be on the NORMA tool and implementation.] |
Beta Was this translation helpful? Give feedback.
-
|
Out of curiosity, I had AI come up with a hypothetical DSL for ORM. Here's what it came up with. Obviously, it would require some tweaking, but it's not awful. Object-Role Modeling DSLIntroductionThis document defines a textual Domain-Specific Language (DSL) for Object-Role Modeling (ORM). ORM is a fact-oriented modeling approach that focuses on modeling the domain in terms of objects playing roles in relationships, with constraints applied to those roles and relationships. This DSL provides a terse yet comprehensive way to express ORM concepts and constraints. Unlike traditional entity-relationship modeling, ORM focuses on facts and the constraints on those facts. This makes it particularly well-suited for capturing complex business rules and constraints in a domain model. The DSL defined here aims to provide a textual representation that is both human-readable and precise enough to be potentially machine-processable. Basic SyntaxEntity TypesFact Types (Relationships)Binary fact type: Ternary or higher fact type: Value TypesConstraintsMandatory Role ConstraintSpecifies that an entity must play a particular role: Uniqueness ConstraintSpecifies that a relationship is unique in one direction: Combined mandatory and uniqueness (exactly one): Natural VerbalizationThe DSL supports natural verbalization of constraints to make them more readable: Combined Uniqueness and Mandatory RoleThis is equivalent to: Bidirectional PredicatesPredicates can be expressed from both sides of a relationship using a slash: This defines the relationship from both perspectives, with the first verbalization favoring the entity on the left, and the second verbalization favoring the entity on the right. Value ConstraintRestricts the allowed values for a value type: Or using a range or condition: Subset ConstraintSpecifies that one relationship is a subset of another: Equality ConstraintSpecifies that two relationships must have the same population: Exclusion ConstraintSpecifies that two relationships must not overlap: Ring ConstraintsConstraints on relationships where the same entity type plays both roles: Frequency ConstraintSpecifies the allowed number of instances: Shorthand notations: SubtypingSpecifies that one entity type is a subtype of another: External Uniqueness ConstraintSpecifies that a combination of roles from different relationships uniquely identifies an entity: Derived Fact TypesSpecifies that a fact type can be derived from other fact types: ExamplesExample 1: Basic ConstraintsExample 2: Relationships and ConstraintsExample 3: Ring Constraints and Derived FactsComplete Example: University Academic SystemThis DSL provides a concise yet powerful way to express Object-Role models with various constraint types. It can be extended as needed to capture additional constraint types or domain-specific requirements. |
Beta Was this translation helpful? Give feedback.
Hi Mike,
Thank you for taking an interest in NORMA and ORM. I'm glad you enjoyed the class.
This seems like a discussion of the NY Yankees on a Red Sox board, but I'll at least get my toes wet, even though I really don't want to turn this git discussion into a long product comparison.
The FactEngine product certainly has some features, especially the live FactEngine back end, that NORMA does not. It is also a cloud-based tool and comes with significant costs.
Much of the ORM Solutions work is not on core NORMA and currently has limited distribution. While FactEngine focuses on a cloud hosted (or self-hosted for $$$) data back end, the work I'm doing (not yet in broad release, but feel fre…