473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Reusable lookup tables

I have to deal with several lookup tables like for example:
Quality SpecificWeight Hardness TearStrength

So I would create a Quality Class to store the values for a single
record.

I know it would be possible to use a HashMap<String, Qualityand fill it
with the appropriate data. All examples I find use the main method for
this.

However I need to reuse the same lookup tables for different
applications. So my idea is to put this lookup tables in a library jar
file that can be shared by this applications.

What is the best approach?

Regards,

Ronald.
Jun 26 '07 #1
2 3555
Ronald Verbeek wrote:
What is the best approach?

Regards,

Ronald.
That depends. How does a Quality object look like ?
You could probably use a property file instead of hardcoding the table.

java.util.Property can read its content using an InputStream.

Best,
Robert
Jun 27 '07 #2
Op Wed, 27 Jun 2007 09:55:14 +0200, schreef Robert Larsen:
Ronald Verbeek wrote:
>What is the best approach?

Regards,

Ronald.
That depends. How does a Quality object look like ? You could probably
use a property file instead of hardcoding the table.

java.util.Property can read its content using an InputStream.

Best,
Robert
Typical data lookup objects like the Quality object have a String key and
several double values and sometimes String values and the appropriate get
methods to retrieve the values.

I already found that it is possible and workable to use a static
initializer block to initialize the HashMap or TreeMap (I want some
lookups sorted for use in a JComboBox). But if someone can suggest a
better approach it is still much appreciated.

Regards,

Ronald.

Jun 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DKode | last post by:
Ok, My staff has determined that we will be using custom business objects for a new app we are creating. we have an object that is called Employee. The employee object has about 8 lookup...
2
by: CoreyWhite | last post by:
The future of computer architecture will use lookup tables. Currently computer processor speed outweighs the benefits of using computer memory for lookup tables, except in some cases. As computer...
9
by: Koen | last post by:
Hi all, My application uses a lot of lookup tables. I've splitted the frontend (forms, reports, etc) from the backend (data). The database has around 10 different users. The values in the...
3
by: my-wings | last post by:
I've been reading about how evil Lookup fields in tables are, but I've got to be missing something really basic. I know this subject has been covered before, because I've just spent an hour or two...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
10
by: junky_fellow | last post by:
what are lookup tables ? How can they be used to optimise the code ?
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
3
by: dbuchanan | last post by:
Hello, (Windows forms - SQL Server) I fill my datagrid with a stored procedure that includes relationships to lookup tables so that users can see the values of the combobox selections rather...
1
by: paulquinlan100 | last post by:
Hi Im having problems getting a column in one of my tables to display the lookup values correctly. The database is split, in the backend the rowsource for this particular field is set to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.