Domain Modeling and Data Architecture
Domain Modeling and Data Architecture
This domain tests whether you can shape entities, attributes and associations that stay correct under real data volumes, security rules and change. Expect judgement questions: which relationship type, when inheritance pays off, and which modelling shortcut turns into a defect six months later.
Core rules
- Persistable entities map to database tables. Non-persistable entities exist only in memory and cannot be fetched with a Retrieve activity - pass them as parameters or create them in the microflow.
- Use generalization when subtypes share attributes and must behave polymorphically in microflows, pages and XPath. If two concepts share one field, an association is cheaper than inheritance.
- Reference sets model many-to-many; plain references model one-to-many. Every association has a delete behavior (cascade vs. prevent), and 1–1 associations need an owner or you accumulate duplicate rows.
- Calculated attributes are computed by the runtime and cannot be set. They replace a lot of before-commit logic because they are evaluated at retrieve time.
- Validation rules and event handlers run inside the commit transaction. Keep them short and never call external services from them.
Worked example
Customer → Order → OrderLine, where each OrderLine references one Product and an Order may carry several tags. Tags are shared and have no lifecycle of their own, so a reference set from Order to Tag is right: no join entity, and delete behavior prevent protects tags still in use. Order → OrderLine uses cascade delete, because a line has no meaning without its order. Index-style thinking matters too: if users page through orders, the Order association on OrderLine must be a join you can filter on, and any attribute used in a frequent XPath constraint should be one the database can index.
Traps
- Modelling a status as five entities instead of one enumeration with five values.
- Forgetting delete behavior and leaving orphaned rows behind.
- Trying to retrieve non-persistable objects by XPath instead of passing them in.
- Overusing inheritance until every retrieve needs two extra joins.