Multiple Tables Revisited


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
It is still going through the QA cycle, but the plan is to make it commercially available by the beginning of April.  We have been putting it through it's paces in hundreds of different environments through Unit testing to make sure that there aren't any issues. 

If this is holding you back we might be able to do something.  But it is coming out very soon.

Robert Linton
Robert Linton
StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)StrataFrame Beginner (21 reputation)
Group: Forum Members
Posts: 13, Visits: 49
Hi Ben,

I'm evaluating SF for use with a new project. I understand you can't commit on any timeframes, but would you say the availability of the LinkBusinessLayer object is days...weeks...or months away??

After reviewing several frameworks, it's really surprising to me that this ultra-common scenario is rarely handled in an elegant manner...it's like many-to-many is not even considered during the design of most frameworks, but there's always some qwerky workaround.

Our app has a lot of relavent mm relationships...I can't imagine having to create and manage two objects (view/save) for each one of these: I like your framework so far, and I'm really looking forward to this enhancement.

TIA,

Rob

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
We're also creating a new LinkBusinessLayer class that contains 3 different business objects that form a many-to-many relationship (table 1, table 2, and the link table). This class will be used in code as if it were a single object, maintaining all of the relationships.
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

Ben,

Thanks for the “MergeDataFrom method” suggestion; I’ll give it a try.  However iterating through the AllFieldsList collection rather than the columns on the DataTable when saving would be a great enhancement. Being able to work with a single instance rather than two would simplify code and make it easier to understand

-Larry

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
Yes, generally we iterate through the fields within the internal data table to save, however, it would not be hard to iterate through the AllFieldsList collection rather than the columns on the DataTable... would probably be faster as well. I'll take a look and see what sort of enhancement this would require.



You also might have your "savable" business object standing by. You could clear it and then use the MergeDataFrom method to copy only in only the columns that should be saved on the business object.



private void SaveRecords()

{

//-- Clear the business object being used to save

SavingBO.Clear();



//-- Copy in the data to be saved from the list view bo

SavingBO.MergeDataFrom(ListViewBO, MergeDataTableOptions.MergeFromCompleteTable_ReplaceExistingDuplicates);



//-- Save the business object as it will only have the columns that can be saved

SavingBO.Save();

}



Hope this helps Smile
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K
I’m still wrestling with the situation where I require fields from other tables for display purposes and the fact that the business object must match the single table structure in the DB to save it. It would be nice if there were a way to mark individual fields as savable or not, or if the object were smart enough to only try and save/update fields defined by object mapper, allowing you to have a single instance of an object that could provided the required behaviors without being so closely tied to the underlying data structure. However I imagine doing so would require some significant changes to the framework. Therefore my question what is the recommended approach to handle this situation? Should I create two instances of the object, one that includes fields from other tables for display purposes and one without for updating? Or should I simply add the other objects/tables to my form and pull the added fields from them on the form? Most of what I’m doing is manipulating a List View to allow the user to work with the information is a user friendly way before saving the results (mostly just foreign keys) to the DB. Some other solutions come to mind, but I’d like your input on what is the most efficient way to do this within SF.
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
Yes, a business object can have any structure you define when you're working with the business object locally (whether it matches a structure in the database or not). However, any business object that attempts to save to a table in the database must match the table's structure.
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

Okay I understand how to fill the business object to bring in the additional fields from other tables to populate the list view. What I’m not clear on is updating and saving the object. If I didn’t have additional fields I would drop the object on the form, populate it, and then populate the list view from the existing object on the form to save an extra trip to the database.  However if I try the same approach using a business object containing extra fields I receive a “The given key was not present in the dictionary” error message when I try to save the object. I’m assuming that this is a result of having the extra columns on the underlying data table and the fact that they are really defined in the business object. So do I solve this by having two instances of the business object, one for updating and one with additional fields for populating the list view?

 

-Larry

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
Looking forward to the training videos.


So am I, Larry Smile



As for the view, you can build a business object off of the view if you're using SQL Server as your schema, but you can't if you're using the Database Deployment Toolkit for your schema; we don't support that, yet Wink
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

Thanks for the suggestions. I hadn’t considered using a view, but it turns out that object mapper will let you select a view.

 

Looking forward to the training videos.

 

-Larry

 

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