|
No, I think it is the correct thing to use container classes but you must be realistic when looking at possible volume of data. Let say that you have an application the lists all the customers on a web page or on in a swing table. Then you could do one of the following things with your container. 1. Container loads a subset and the subset is provided by the UI code. 2. Container is intelligent and maintains a block of results. As you ask for the next customer the container will fetch the next block if required, else it will return the entry that was already loaded as part of a previous block. 3. Design your application to never work with a set of customers that are too large to load at one time. So let's say the user first selects the district before viewing the customer detail. That way you have to only show the customers in that district (Depends on volume of data). 4. Write you container to be a wrapper around the ResultSet. 5. Use delayed instantiation (Load a minimal set of customer fields and then only load the detail when they need to be used the first time). It all depends. -----Original Message----- From: Brad Stone [mailto:brad@bvstools.com] Sent: Wednesday, January 09, 2002 1:31 PM To: java400-l@midrange.com Subject: Re: Java and Relations DBs.. > Add static helper methods to your customer and or invoice > classes that would > perform this type of operation as a single SQL query. > Only return the fields > that you need in that query. I added a new method that only does a count(*). It's still not that much faster. And since I really don't need fields in my query (only getting a count), I am not retrieving any fields from the DB. > > If you are creating an object model to just be a memory > representation of > the database then you will have problems. The application > should never be > designed to load all the data into memory in order to > perform an operation. I'm not loading _all_ of the data, just the data that I want to work with for each instance. Are you saying that I should not be using container classes? Just working directly with the DB? Brad _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.