• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing HTML Dependency/Skip logic in MySQL database  RSS feed

 
Gary Wolgast
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm looking for some opinions on an issue my development team is wrestling with. Some background info. We are developing an application that dynamically generates UI screens (eventually thousands) based on information stored in a database to be used in part of our application. For every UI screen in this section of the app, we store a representation of the JSF view that will get read from the database and rebuilt into an HTML screen. For many of our htmlInput Items, we need to store an expression that determines if that HTMLInput object is to be disabled. For instance, an input text field called TEXT2 may have a expression like this: EQUALS('TEXT1','1') which says that TEXT2 will be disabled if TEXT1 has the value '1'. This is a very simplistic example. We have everything working as expected. We are using Tomcat 6.0.18, MySQL 5.1, JSF 1.2, Spring 2.5, Hibernate 3.2.

This is the issue: How to store this expression "EQUALS('TEXT1','1') " in the database.

Each input item will have at most one of these expressions associated with it. One of the developers wants to just store it as a String attribute on the text item in the database. Another developer says we should normalize it into its basic components. Essentially create many database entities like CONDITION, DEPENDENCY, Equivilancy operators, Input type(s) (TEXT, TEXTAREA, Checkbox, Menu, etc.), LOGICAL OPERATORS ("AND", "OR") and digest these string expressions down to elementary objects. Then when it is needed, gather all the needed information and reconstitute the string back to it's original form. For any individual input form, this process may occur over 100 times depending on the input form.

I'm leaning towards the more simplistic solution of just storing it as a string, but the developer that came up with the digester/regurgitation scheme is pushing hard for his solution. Do any of you have an opinion about which way would be better? I'm not the final decision maker, but I am a senior member of the team and have influence on final decisions. Any opinions would be welcome.


Thanks
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What reason(s) is the guy giving for wanting the more complex solution? What problems is he seeing that his solution will solve?
 
Gary Wolgast
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
His main reasoning is that we may want to be able to create reports that show which input items have dependencies (and vice/versa). Also he mentioned that constants like "Y", "N", "1" could be persisted in the database and re-used. I think that the first requirement can be accomplished through some simple string parsing. The second one sounds a bit "over the top" to me. I'm a follower of the KISS principle whenever possible.
 
Gary Wolgast
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't anyone here even have comment or opinion?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!