Reputation: 3829
I have a task to replace a string lookup system which currently relies on mysql. A screen will pass a list of ID's and a language element to a class which then selects the requested strings out of a table in mysql.
I am looking to replace the mysql table with a properties file but I dont want to load all of the properties into the object in one go.
As the strings are used in an old legacy system to render parts of the screens and pdf reports I would want to load them into the properties object as and when they are requested, so first check the properties object and if it doesnt contain my key say "1234Eng" then I would load it into the properties object at that point so its available in future.
The idea being that as there are so many messages I would prefer to only load those which are used on pages people have visited.
Any advice\help is appreciated.
Upvotes: 1
Views: 68
Reputation: 7403
Are you really sure having the Properties object in memory is too slow too load and too big to keep around? Check that before going into a more complicated solution. Otherwise, don't reinvent the wheel and use an embedded database. I've had good experiences with SQLite, but there are also some pure Java embedded database, that can give you a mixture of on file and in memory access (see this thread for a comparison).
Upvotes: 1