|
As for business objects, their appeal (to me at least) is that you canI am not, not, NOT, *NOT* going to get into this discussion in any long-running way, but I am absolutely compelled to point out one thing here: this sort of (programmer) performance gain very easily translates into performance LOSS for the user. In the above situation, let's take the calculation. Is it performed when the Item object is loaded? Or when the property is requested? In the former case it will be calculated and often never used, while in the latter case it will be calculated over and over again. Unless of course the field is lazy-loaded, which means adding another boolean field to be compared to every time the property is accessed.
embed the business logic into them and not have to worry about it as the
consumer. Take something "simple" like item balances. How many rubber
chickens are available for sale? Well, is it the AvailQty bucket? Or is
it AvailQty-ReservedQty, or perhaps
AvailQty+InboundQty-ReservedQty-DamagedQty, or some other combination of
quantities. An item business object could have a property like
"AvailableForSale" which was the correct computed value, and everyone
would be singing the same tune. Can this be done w/out business objects?
Of course. But there's a big (programmer) performance gain in being able
to write:
Item x = Item.GetItem(12345);
int qtyForSale = x.AvailableForSale;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.