True wisdom is in knowing you know nothing - Socrates
Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
Matt Kohanek wrote:
Or would it be better just to make a ProjectHolder object to hold these three things?
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
True wisdom is in knowing you know nothing - Socrates
True wisdom is in knowing you know nothing - Socrates
True wisdom is in knowing you know nothing - Socrates
True wisdom is in knowing you know nothing - Socrates
Matt Kohanek wrote:Now I need help iterating through that I guess?
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
True wisdom is in knowing you know nothing - Socrates
Ernest Friedman-Hill wrote:Matt --
Please don't try to make maps of maps of maps, or 3-way maps, or anything as strange as that. Further, don't try to use Ganesh's code, which isn't going to compile. Try to use the simplest solution. The problem you're solving may seem strange to you, but it's really not strange at all; it's a very typical object modeling problem, and you want to solve it the same way it's been solved a million times before. Don't try to invent anything new and confusing, but rather try to study how other people have successfully approached it.
The traditional Java solution would be to create classes named Project, Device, and Channel, give each class instance variables to refer to the other types as needed, and then create the interconnected objects. You could then (for example) store all your Projects in a Map with their name as the key, and the Projects as the values, and easily look up Projects. You could then ask each Project for its Device and/or Channel.
Finally -- and I hope I'm not too out of line here, but I'm starting to feel bad watching you suffer this way -- when you ask for help, try stepping back a little and asking more about the problem, rather than how to implement a solution. To the best of my recollection, you've never asked "I have a bunch of data regarding interconnected objects stored in X format, and I want to display them as Y. What would be a good approach?" I suspect the answers might surprise you.
Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |