That's not to say I don't get caught up in VFP code. I may need to move on, but that doesn't change my feelings for VFP. Wait, are we talking programming languages or girlfriends here...
Thanks for the clarification Rick.
~Brett
That's not to say I don't get caught up in VFP code. I may need to move on, but that doesn't change my feelings for VFP. Wait, are we talking programming languages or girlfriends here...
Thanks for the clarification Rick.
~Brett
Well, wwBusiness predates collections and the original was built prior to collections available in the language.
There are lots of problems with FoxPro collections as well and I NEVER EVER use them. They're expensive (slow), the don't work like typical collections work in regards to indexers. So much so in fact that in Web Connection there now is wwCollections which creates two classes that use internal arrays to manage the collection. But you still can't iterate over them with FOREACH() because FoxPro doesn't expose any implementation mechanism for collections (which is another dead end of collections).
So long story short the one to many scenario in wwBusiness is not particularily well implemented as the implementation of is geared more towards single record based manipulation. If I had to do this over now I would do this differently, but that time is way past at this point :-)
+++ Rick ---
oInvoice aLineItems aRow[1]
http://www.west-wind.com/wwthreads/ShowMsg.wwt?MsgId=0Y40USMEN
_and_ because VFP arrays are so much more feature rich than VFP Collections, like using SCATTER and such. So is that the gist of it, or is there something else?
I've just been doing a lot of ASP.NET MVC stuff lately and while reworking some circa 1999 code thought I'd make it more object driven and immediately ran into this.
Also, speaking of Business Object stuff, how do you normally deal with needing to have those children ordered? For example, suppose you've got a Business Object oCart that has an array of oCartItems that's being added to by the user. But, because of group discounting at say a Category level, you need to display those cart items grouped by Category instead of natural order. Which of course might require resorting for every add. Do you make your array more heavyweight, deal with it display side, or is there some simple solution that I'm missing (like 90% of the questions I ask here <g>). Actually, as I typed this, I realized I'd be persisting to data for every hit so I'd be loading fresh each time but I'm still curious about this. I'm sure there are situations where you need to have those children ordered differently, or no?
~Brett