Getting data at runtime question

Getting data at runtime question

Old forum URL: forums.lhotka.net/forums/t/861.aspx


esteban404 posted on Wednesday, August 09, 2006

I have a BO and need to attach a collection to it whose only member is a key value for another data system we use. The model I need to develop needs to allow users to add, modify and delete this single value like a normal collection. The remaining data needs to be read from the other system as a read only collection. This should produce a nice master/detail view in the grid -- all at runtime.

Let's see if I have this right: I create the Item and Items collection BOs normally. In the Item BO I include the ReadOnlyCollectionBase object as a collection field. The ROC object will only need to retrieve the info using a sproc. I think I can get what I need for 3 separate collections all modeled the same way an loaded into three grids. I'm also thinking of passing in a delimeter for grouping purposes so I could do it with just one grid. That's still in the "pipe".

So, if the user enters a new KeyValue, i.e. Purchase order number, they will expect the grid to update/populate immediately. How are most people handling the creation and display of such creatures? Threading in the GUI or as a lazy load? I see them banging the keys while the fetch is ocurring, so something will certainly need to handle the GUI portion outside of the BO. Personally, this seems a good candidate for a datareader (the Microsoft kind, not a CSLA object), but I tend to avoid those completely.

Thanks in advance,

_E

cultofluna replied on Wednesday, August 09, 2006

Hello Esteban,

I don't understand the complete picture, however I do want to make a comment on the GUI part. I've never done this, but I think I would create I timerpaused textbox that starts the search when a specified time has passed by after the last keystroke. When the pause is done the start of the search can be initiated. I don't know for sure, but this is what seems to happening in for example a html help file index. Try CodeGuru for tips, there is always someone there that has figured this one out already.

The remaining problem is when a fetch has started and the user determines to execute another keystroke. Personally I would cache the keystroke and execute the new searchvalue fetch after the currently active fetch has returned it's results. As a small improvement you could set a bool variable that is set true whenever a keystroke has occurred and the application is fetching, and false otherwise.
When the currently active fetch is ready and the bool variable is true, you don't need to bother about binding the BO to the grid and immediately start the new fetch. When the bool variable is false you can simply bind the BO.

I hope this makes sense to you :) Good luck!

Best regards

Copyright (c) Marimer LLC