On Sun, Feb 20, 2011 at 6:34 AM, Vangel V. Ajanovski <[email protected]> wrote: > If you already use a database in the project and if the project is depending > on the operation of the database, than I would say that there is no reason > that is sufficient to justify the use of a property file beside the > database. Especially when you have many users which are all configuring > their stuff. > > Reinventing a wheel in such case would be to NOT use the database (you will > have the problems of multi-user concurent access and file-locking, > versioning, ACID transactions). > > I would also add that you shouldn't split the user profile personal data > from the user profile configuration data - they are both user personal data > and according to privacy-related laws should be > protected. If you split it, than you will have two separate locations to > deal with and protect (database and file). > > Most web applications I have seen that have a lot of user configuration > data, store it in a single table that will mimic the property file, that has > a composite key like this: > (#userid, #property-key, value) > > Is this what you're currently doing? Because from what I read, it sounded > like you are creating separate entity classes for separate properties.
Originally I was using Entity classes which was making things more complicated than they needed to be and that prompted my original question. The single table that mimics the property file is what I'm doing now and I wanted to make sure there weren't any built in facilities for reading and writing these files or the keys to a database that I was overlooking. I started experimenting with Apache Commons Configuration an it lets me use a properties file, XML or a database. Changes from the web interface get written to the file and changes to the file get immediately read back into the web application. Thanks for your suggestions! Mark --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
