Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Try to model the domain (don't just make stuff up as the programmer). If the domain shows receipts with quantity * price = subtotal, then do that, but consult not other programmers, but the domain experts. Inspect the positioning of the API to see who the clients are and how this information ought to be communicated between the business roles involved (API consumer(s), API provider(s)), so as to mimic a business/domain interaction. If the API is internal to the business, then perhaps it doesn't matter, but even internally we can be sharing information between business roles/departments.
    – Erik Eidt
    Commented Feb 2, 2020 at 15:22
  • I'd be more interesting in whatever or not there is an appropiate way for the API to express that a value is missing. Consumer code should create an adapter anyway, and there it can deal with the missing value with whatever logic is prefered. Thus, arguebly expressing a missing value, if possible, is more flexible. The flip side is that abstracting this away from consumers could be part of the requirements for the system. Is it?
    – Theraot
    Commented Feb 2, 2020 at 15:27