StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Is There a Safety Limit to the Number of BOs...Expand / Collapse
Author
Message
Posted 02/04/2008 9:19:17 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 4:17:25 PM
Posts: 410, Visits: 1,530
I have a rather (in my opinion) complex form involving 14 business objects (so far).  Should I be considering some kind of safety limit to the number of business objects I am throwing on a form?  Also, I have three ChildFormDialogs on the same form...is there concern for those, as well?

Thanks,
Bill

Post #13981
Posted 02/04/2008 3:27:59 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 04/11/2008 10:01:54 AM
Posts: 105, Visits: 650
We have a form with 26 Business objects, 11 sub classed BrowseDialogs, and a few other components with no problems.  Our form takes a second to load up in the application, but we haven't heard any complaints about form load times or anything so we haven't tried to change it to make it faster.

Hope this helps.

Robin Giltner

Post #13987
Posted 02/04/2008 3:43:15 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 4:17:25 PM
Posts: 410, Visits: 1,530
Excellent!  That is good to hear.

Sounds like my form is a walk in the park compared to yours.  These things can get complicated quick, though.  All a user has to say is, "Do think we could add a ... ?"

No, wait...here's the real problem.  We say, "Sure."

Post #13989
Posted 02/05/2008 10:00:19 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
Yeah, I have some forms that have as many as 10+ ChildFormDialogs and 20+ BOs...however, I will start to thread things, etc. if the forms starts to feel, "sluggish."   This is generally due to the number of objects being instantiated and then loading the BOs....so you can always mask the loading slowness by using threads.
Post #14007
Posted 02/05/2008 6:00:11 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 7:00:12 PM
Posts: 1,213, Visits: 3,084
Trent, I have a few forms that could probably benefit from some threading. Could you say a bit more about this, especially with regards to how this works with the FormLoad option for BOs, combos/lists, what objects do you load in background, etc. I sorta know about threading, but have much to learn in this area.

Thanks!
Post #14053
Posted 02/05/2008 7:39:26 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 10:49:29 PM
Posts: 4,379, Visits: 4,412
Sure.  It really depends on what I am trying to accomplish.  But let's take the scenario that you have a lot of BOs that must be loaded and there may be a number of child BOs that need to be loaded as well.  In this case, the easiest solution is to use the ThreadManager class and load each of the child BOs (and potentially the parents as well) on a thread.  For example, let's take the scenario below:

Tables with Respective BOs
Customers (Parent BO)
CustomerNotes (Child)
CustomerProducts (Child)
CustomerOrders (Child)

Now let's assume that I have the primary key of the parent (there are a lot of different scenarios that you can work this format into).  I am going to load the parent first, then load all of the children at the same time.

'-- Load the parent record
Customers.FillByPrimaryKey(customerPK)

OK, once the parent is loaded (and if you have the PK you may not really need to wait for the parent to load...but you get the idea) I want to spawn 3 threads to load all of the children at the same time.  The best way to do this is to create a method for each child BO to load:

Private Sub Fill_CustomerNotes()
    CustomerNotes.FillByParentPrimaryKey(Customers.cust_Pk)
End Sub

Private Sub Fill_CustomerProducts()
    CustomerProducts.FillByParentPrimaryKey(Customers.cust_Pk)
End Sub

Private Sub Fill_CustomerOrders()
    CustomerOrders.FillByParentPrimaryKey(Customers.cust_Pk)
End Sub

But I still need to call these on a thread.  Drop a ThreadManager on the form and name it something like, threadManagerChildrenRecords.  Once the parent BO has been loaded (or you are ready to load the children) start a process for each fill method:

threadManagerChildRecords.AddProcess(Addressof Fill_CustomerNotes, "Notes")
threadManagerChildRecords.AddProcess(Addressof Fill_CustomerProducts, "Products")
threadManagerChildRecords.AddProcess(Addressof Fill_CustomerOrders, "Orders")

Once each thread completes, the ThreadCompleted event will fire and you can test on the name of the thread specified in the AddProcess call.  In most cases, though, you can just handle the AllThreadsCompleted event of the thread manager to launch your post query logic (i.e. populate a list, grid, etc.).

This is a pretty basic overview, but it should at least give you some ideas.  We have taken this to another level in our medical software to even load the form (folders in our medical software) on a background thread and the once completed bring it to the main thread...this would require a much longer explanation.  But we use the logic explained above for the loading of child records in a number of occasions once the form has been loaded.  Hope that makes sense

Post #14057
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:22pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.