Re: What solution is better: DB or object?



Audrius wrote:
Maybe i didnt put my problem right...

I'm trying to acomplish such thing: I have a database where i store all
the information about Tests. My Test consists of various fields from
different tables in DB. So what solution is better, to use SQL queries
whenever i need some piece of Test's data (not all data at once), or to
use SQL query to read all the data related to particular test into some
object once and after I complete working with that test update all the
data from object back to db? By the way, application will be working
with one test at a time.

What solution would be better looking from performace and memory usage
standpoint?

I wont try using hibernate, but this solution would be really good.
Thanks for advice.


That's different! You're already using rdbms. I'd say that the frequency of your data needs would govern your strategy. If data does not change you might instantiate one (or several) objects from rdbms data. Depending on your logic it might make more sense to just pull the data you need, when you need it.


There are other factors: What other uses do other applications/users make of the database. Network round trip, etc.
.