4 ms·
The example given allows the application layer to instantiate a customer object with a list of order objects in one database query. Yes, you could do that by r
by drdec 6y ago
The example given allows the application layer to instantiate a customer object with a list of order objects in one database query. Yes, you could do that by returning JSON or XML, but why have the extra step of parsing the text? Directly accessing the result set and acting on the object instances will be more efficient.
- intrasight 6y agoThe example is better expressed as a join.
- wayneftw 6y agoNo it's not. A join means you have to wastefully repeat the same parent fields for every row. That's wasted cycles serializing and deserializing and it's more work on the client. It's absolutely ridiculous to make a blanket statement about this very useful feature. I've done the benchmarking on many applications of this tactic. It very often works better with multiple select statements. I'll certainly trust hard performance numbers against an ill conceived opinion any day.