How to handle Domain Driven Design when domain is dynamic / changes

J86

In order to make it clear what I mean, let us build a hypothetical scenario where this might be needed.

Let us say I am building some software for a company that manages whiskey breweries in Scotland. Each brewery company can have a copy of this software to manage all the business logistics.

Assume that I have a Kettle object, and on it we'll have some properties, e.g. .Colour and .Material.

But what if the Glenfiddich brewery wants another property on the domain? e.g. .Size and some other brewery doesn't care about all the above and is only interested in .Content and .DateFermentationStarted?

In OOP is there a way I can make my Kettle object dynamic (have different properties and methods) depending on some parameter named Customer?

If I'm not mistaken, this is very different from Polymorphsim.

MikeSW

You can't apply much DDD in this scenario, because the Domain concepts definition change from one client to another. I mean we all have a Kettle but there can be of any property the client wants. How can you apply behaviour? More precisely on what?

At most your "domain" objects will be data structures. It does matter who gets a saying in defining objects and what the customizing options are. If for example, a client can choose from predefined properties then you have some room to maneuver.

But if they can add any property with any name, you're losing semantics and just end up with data structures made up of magic strings. And you can't enforce business rules, unless you also have a business rule editor that clients can use to define rules. And that would be quite complicated for both developer and client.

So, IMO, DDD is not really suitable for this unless you're building separate apps for each customer, but proper OOP still is. You'll be working with data structures though and probably an ORM will help here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to handle Domain Driven Design when domain is dynamic / changes

From Dev

Domain Driven Design - How to handle updates for parts of your aggregrate roots

From Dev

Domain Driven Design - How to handle updates for parts of your aggregrate roots

From Dev

Domain Driven Design - Domain or Security

From Dev

Layers in Domain Driven Design

From Dev

How to add scheduled jobs in domain driven design

From Dev

Domain Driven Design Bounded Context Domain Objects

From Dev

Domain Driven Design: infrastructure concern or domain concern?

From Dev

Domain Driven Design: infrastructure concern or domain concern?

From Dev

Access Control in Domain Driven Design

From Dev

Domain Driven Design and batch processing

From Dev

Implementing Domain Driven Design Cost

From Dev

Implementing Domain Driven Design Cost

From Dev

Where to put security when using DDD - domain driven design

From Dev

When we shouldn't use Domain-Driven Design approach?

From Dev

Domain Driven Design - When to seperate one bounded context into two

From Dev

Domain driven design: How to deal with complex models with a lot of data fields?

From Dev

How does Get method fits in domain driven design

From Dev

How much realistic should be a model in domain driven design?

From Dev

How to model capacity (value and unit) in Domain Driven Design?

From Dev

Domain Driven Design. Entity type design

From Dev

In Domain-Driven Design, how to determine if sending an email is an application level or domain level concern?

From Dev

Implementing Paging and Sorting with Domain Driven Design

From Dev

Implementing Domain-Driven Design and Transactions

From Dev

Domain driven design repository implementation in infrastructure layer

From Dev

Domain Driven Design in Node.js Application

From Dev

Fetching associated aggregates in Domain driven Design

From Dev

Domain Driven Design - CQRS + ES usage

From Dev

Where is the call to persistence in the domain driven design

Related Related

  1. 1

    How to handle Domain Driven Design when domain is dynamic / changes

  2. 2

    Domain Driven Design - How to handle updates for parts of your aggregrate roots

  3. 3

    Domain Driven Design - How to handle updates for parts of your aggregrate roots

  4. 4

    Domain Driven Design - Domain or Security

  5. 5

    Layers in Domain Driven Design

  6. 6

    How to add scheduled jobs in domain driven design

  7. 7

    Domain Driven Design Bounded Context Domain Objects

  8. 8

    Domain Driven Design: infrastructure concern or domain concern?

  9. 9

    Domain Driven Design: infrastructure concern or domain concern?

  10. 10

    Access Control in Domain Driven Design

  11. 11

    Domain Driven Design and batch processing

  12. 12

    Implementing Domain Driven Design Cost

  13. 13

    Implementing Domain Driven Design Cost

  14. 14

    Where to put security when using DDD - domain driven design

  15. 15

    When we shouldn't use Domain-Driven Design approach?

  16. 16

    Domain Driven Design - When to seperate one bounded context into two

  17. 17

    Domain driven design: How to deal with complex models with a lot of data fields?

  18. 18

    How does Get method fits in domain driven design

  19. 19

    How much realistic should be a model in domain driven design?

  20. 20

    How to model capacity (value and unit) in Domain Driven Design?

  21. 21

    Domain Driven Design. Entity type design

  22. 22

    In Domain-Driven Design, how to determine if sending an email is an application level or domain level concern?

  23. 23

    Implementing Paging and Sorting with Domain Driven Design

  24. 24

    Implementing Domain-Driven Design and Transactions

  25. 25

    Domain driven design repository implementation in infrastructure layer

  26. 26

    Domain Driven Design in Node.js Application

  27. 27

    Fetching associated aggregates in Domain driven Design

  28. 28

    Domain Driven Design - CQRS + ES usage

  29. 29

    Where is the call to persistence in the domain driven design

HotTag

Archive