Say you have a web application with lots of business rules built around if-then string constant comparisons. They are used both on the client side and on the backend code, and are currently hardcoded in both places with a lot of duplication, and sometimes with errors. What is a smart way to reorganize them? Unfortunately, in most cases they must exist, since the use of polymorphism would be much more disgusting. Anything specific for flex / java? Is there an easy way to save all these constants in one place and compile it both in the client code and on the server?
Edit: I'm really looking for a way to share string constants between flex and java with checking the compile time of everything. The only idea I can think of is a code generator.
source
share