Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David,

David kerber wrote:
My primary job is database design and management; the java side is where
I'm weak, and I've spent a LOT of time on these queries, including
pushing through some design changes that have helped a lot, but not enough.

Okay. Forgive my comments about proper database care and feeding...
usually this list attracts programmers that don't know much about databases.
No problem; I took it in the spirit it was intended (trying to be helpful).

map.put(myDataObj, myDataObj)?
I thought of that, but there is a lot more data in the object than just
the stuff I need to search on.  Once I identify the particular object
instance I need (which only needs those 3 fields), there are about a
dozen other fields I need to retrieve from it to process each record.

That's fine. If you only use 3 fields for identification, there's no
harm in keeping all that data together in a single object. It's not like
it uses up any more memory. Actually, you might be saving a bit of
memory since you won't need separate key and value objects.

When in doubt, abstract: write yourself a helper class that bundles all
this odd logic together. Then, your business code will be a lot simpler
to read, and you can separately unit test your
SpecializedTreeSetHashMapLinkedList class (or whatever). ;)
Yeah, that's what I'm working on right now.  It's coming together,
though somewhat slowly since I'm still getting my head around the
different kinds of maps and lists, and what each of them is good for.

It's always worth it to read though the entire java.util API. There are
some great classes in there.
Yeah, I'm discovering that. It seems like every time I ask for suggestions about how to do something that I'm struggling with in my app, somebody suggests something from java.util, and it ends up working great. This time around, it was TreeMap, which led me to SortedMap, which so far (about 80% done) looks like it's going to work great. After a couple of false starts, I'm using hash maps with the Key being the pKey of my db objects (which I already have available from other objects in the app), and the Value being a SortedMap of the data for each object. This gives me instant access to the map I need, and a separate HashMap keeps the pointer to the key I need to track my place in each SortedMap. I'll post back when I'm done as to how it goes, but so far it's looking good. If I were using java 6, I would have some even more helpful navigation methods, such as higherKey(), but what I've got isn't bad.

D



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to