0

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?

2 Answers 2

3

The data and domain models presented in the Universal Patterns books and Fowlers Analysis Patterns are useful in that they provide a detailed and generalized overview of the structure of the models. I used them as a reference when creating more specific domain models and normally only use part of the model described in the books.

As far as the accountability patterns from Fowler's book, a Party is a different thing from a Role in that a given party may fulfill multiple roles. So to me it does make sense that a Party can either be a Person or an Organization. An example from the .NET framework is the IIdentity and IPrincipal interfaces. The IIdentity can represent a party whereas an IPrincipal is a combination of an identity and a set of roles.

Sign up to request clarification or add additional context in comments.

2 Comments

@eulerfx. Any implementations of Party & Role that you tend to use more often than not? Cheers
Implementations are often specific to a use-case, I'm not aware of any DDD project out there with a focus on party/role implementations, however the example from the .NET framework has several implementations.
1

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.)

1 Comment

Yes, that's what I'm looking for, but am finding the devil in the details of the implementation. Been 'playing' with a decorator pattern but its got more moving parts than I like. Will have a look at that SO answer in a short while. Cheers

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.