problem with BBS & standart .NET grid


Author
Message
hector
hector
StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)StrataFrame User (228 reputation)
Group: StrataFrame Users
Posts: 52, Visits: 559
Hi folks :

I have a problem with BBS & standart .NET grid.
I have 2 BO on a form ... Let Say ParentBO and ChildBO...
As the names implys one is parent and other is child.
I setup ParentRelationship and ParentBusinessObject properties of these BO's properly as i always do.
I also setup the BBS and grid as in SF Help document (Topic :Understanding the Business Binding Source (BBS) Control)
When I call ParentBO's Save I got a exception from SF's internal method PushDataToChildren.
When ı debug the problem i noticed that there is a one parent BO (ParentBO) but more then one child BO (which i never declared).
And these extra child BO's ParentRelationship was nothing...

This is first time I am using BBS...

When i worked on BBS deeply, I have also noticed that BBS ınternally, create an BO of same type for each row.

And I also noticed the problem is those Child BOs which internally added by BBS in SF.

Is this normal working logic of BBS?

Am i missing something in this picture?

Please advice ...

Kind regards...
Replies
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Nope, you're not missing anything from the picture.  The foremost limitation of the SF BusinessObjects is that they are a single object that contains many actual records.  One class and one instance contains multiple records, but the BO only talks to one record at a time.  It was designed this way to be similar to the way some older programming languages work.  However, with .NET, it's an issue because .NET expects collections for data sources, and a BO is only a single object.  So, the BO has to try to act like both a single object and a group of objects as well.  That's why we created the BBS.  It wraps a BO and turns it into a collection of instances. They all share their internal data table behind the scenes so they each behave like they are the same business object, but each is pointed to a specific row.  Since all of the children share the same internal DataTable, they don't all need to be children of the parent, just one of them does... the original one you linked up in your code.  I'll have to take a look at this and see why the ParentBusinessObject reference is getting set on all of the child objects.

FYI, this was the first item on our list of enhancements for SFv2; separate objects and collections.  We use an entity model with multiple classes instead of shoehorning all logic into one class: Entity, EntityCollection, EntityWinFormsView, EntityWpfView, EntityWebView, etc.  I'm sure you'll probably be one of our first beta users when we post it.
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Ben Chase (2/25/2013)
... I'm sure you'll probably be one of our first beta users when we post it.

Hi Ben,
Count me in, been waiting for SF2.0 for a long time<smile!!!>

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search