Skip to content

Standardize way to map fields on DDD elements #48

Open
@qejk

Description

@qejk

Currently, there are two ways to map(describe) fields in DDD elements - via methods and objects:

  • Entity: require to map fields as a method
  • ValueObject: require to map fields as a method or object
  • Aggregate/Process: require objects
  • Command, Event - both store fields as objects
  • Command Handlers, Event Handlers - methods (on aggregate, processor)
  • API endpoints - methods

We should have standardized way to map fields, so there is no confusion what type of mapping we need to use on each DDD element and how to access them everywhere(this is very important). Another option is to allow both mappings (by doing in every place where its needed - a check for fn/object and acting accordingly) however by doing so - this can be confusing on long run.

By allowing objects were supporting extensibility, but the cost of confusion that you can extend anything from anywhere easily like that can let to bad design choices in developers code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions