Let say, we have a event management product for an user. One feature is, user could self-define new field to accommodate his own need, for example, he could add "do I take morning exercise today? Yes Or No " checkbox to the system, afer this, the new field will show up on the screen and its column is added to database without restart
How to design this system ? what technology is good ?
Usually we will define POJO class and mapped to database and show them on the screen. Here problem, if user dynamically add a new filed, we can't modify POJO in the runtime.
This is a challenge.
Joined: Jul 05, 2005
You can use JDBC, and keep schema in XML.
For dynamic schema, you cannot use "hard-coded" classes, you need to have generic ones, like EntityData, EntityType.
Try to think about what methods EntityData and EntityType should have.
SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus