|
|
|
|
|
by lugg
2637 days ago
|
|
Not really sure how ORM solves anything here. That said, your old and new solutions both sound wrong to me. Tax is a line item. To me it's as much a line item as a product, service, shipping, handling, booking fee, or any other thing that gets summed to form the total order / transaction value. You then get to ref optionally in the way that makes sense to map attribution correctly. Tax belongs to an item? No problem. Two taxes, one item, no problem! One tax multiple items? No problem! |
|
The new solution does what you talk about, I guess I didn't explain it very well.
The use of an ORM is abstracting away a lot of the technical debt in the schema and isolating it so we can concentrate on fixing that debt without the worry that it continues to spread. It's much looser coupling than continuing to litter the codebase with manually written SQL.
Edit: reading more of the replies to your original comment - there is btschaegg's comment that having a narrow scope is what you should aim for[1]. There's also a reply (first one) on stackoverflow that talks about not leaking the abstraction[2]. Finally the key to our use of an ORM is that the ORM is not our model, we do not leak the abstraction, and we can drop down to manual SQL when we need it but that is still in a narrow scope.
[1] https://news.ycombinator.com/item?id=19592042
[2] https://softwareengineering.stackexchange.com/questions/3045...