DBConnection question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DBConnection question

Bruno Brasesco
Hi,

I have a DB with 5000 Customers.

I have a Presenter with a ListPresenter that hold all Customers, here i have
a performance problem
(because i have read the DB and set all instances variable of Customer
object from aDBRow).

I want to make a DBListPresenter (or DBComboBox) to load Customers on
demand, each time that "drop dow arrow" of the ComboBox is pressed.

But I can not find the #message to catch this event.

Regards Bruno


Reply | Threaded
Open this post in threaded view
|

Re: DBConnection question

Christopher J. Demers
Bruno <[hidden email]> wrote in message
news:aomj5c$nsbrn$[hidden email]...
> I have a DB with 5000 Customers.
>
> I have a Presenter with a ListPresenter that hold all Customers, here i
have
> a performance problem
> (because i have read the DB and set all instances variable of Customer
> object from aDBRow).
>
> I want to make a DBListPresenter (or DBComboBox) to load Customers on
> demand, each time that "drop dow arrow" of the ComboBox is pressed.
>
> But I can not find the #message to catch this event.

I usually use ReStore http://www.solutionsoft.co.uk/restore/  (a relational
to object tool) for this kind of thing so I don't have much direct
experience with this.  However I have some rough ideas, and perhaps someone
who has actually solved a similar problem can jump in.

One approach would be to use a proxy approach.  I have not looked at the
details, but perhaps you could make a DBListModel that would create its
collection on demand.  You could also query the database and create a bunch
of CustomerProxy records that can look up their details on demand.  Then the
first time a CustomerProx record needs to display itself it could fully
populate itself.

You could also query and display just the customer names in the combobox,
and then load the object based on the selection. This is less OO but may be
easier for you to implement quickly.

Good luck,

Chris