We have developers with knowledge of these languages – Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from database etc. Which language will be the easiest and fastest to work with? (It is a web-app)
Share
A dynamic language rules for this. Why? The mappings are easy to code and change. You don’t have to recompile and rebuild.
Indeed, with a little cleverness, you can have your ‘XML XPATH to a Tag -> DB table-field’ mappings as disjoint blocks of Python code that your main application imports.
The block of Python code is your configuration file. It’s not an
.inifile or a.propertiesfile that describes a configuration. It is the configuration.We use Python, xml.etree and the SQLAlchemy (to separate the SQL out of your programs) for this because we’re up and running with very little effort and a great deal of flexibility.
source.py
model.py
builder_today.py One of many mapping configurations
loader.py
To make changes, you can correct a builder or create a new builder. You adjust the loader source to identify which builder will be used. You can, without too much trouble, make the selection of builder a command-line parameter. Dynamic imports in dynamic languages seem like overkill to me, but they are handy.