domain-driven-designdata-modelingdomain-modelobject-model

universal data models and domain model implementations


One universal data model author I am reading contends that in his experience, 50% of all enterprise systems are 'universal' in their need to deal with Parties, Work Efforts, etc, 25% is universal within that business' industry, with the balance being unique to a given business (ie, Coke v Pepsi).

But I am not aware of code that builds on this, and can't think of anyone really looking at patterns from a domain perspective, as opposed to a data modeling one, since Fowler did so in the mid 90's.

Does anyone with a DDD orientation have any opinion based experience as to the usefulness of universal data models?

Do you literally have sub types of Party limited to Person and Organization, with everyone else in Roles? How do you implement that if so?

Any implementation guidelines or open source systems that you like?


Solution

  • Do you literally have sub types of Party limited to Person and Organization, with everyone else in Roles? How do you implement that if so?

    For one minimal implementation, see this SO answer.

    The short story is that a particular role (which might not be the best word) references the supertype if it's a role that can be filled by both individuals and organizations. "Customer" is probably a good example.

    A particular role references the personal subtype if it can only be filled by a person. "Staff" or "Employee" might be a good example.

    And a particular role references the organizational subtype if it can only be filled by an organization. "Employer" or "Former employer" might be a good example.

    (Not all those examples are in the linked answer, but I think the PostgreSQL source code makes it pretty easy to figure out what you might need to do.)