"lipska the kat" wrote in message
news:WJCdnYC44fWipFjPnZ2dnUVZ8sidnZ2d@bt.com...
On 02/01/14 08:34, Gordon Levi wrote:
Arne Vajh?j <arne@vajhoej.dk> wrote:
Let us say that you need to add a field.
With an ORM you only need to update:
* one dataclass
* one mapping of data
With plain JDBC you need to change:
* one data class
* N SQL statements
* N places in the Java code
I don't understand this so I fear I must be doing something wrong in
my Java programs. If someone wants to add a field in a database why do
I have to alter anything in my program other than adding, for example,
getString(String columnLabel) if I want to actually use the new field
at that point in the program.
Well I'm not sure what kind of Java applications you write but in the
world I inhabit the client request "we just want to add one more field
to this form" is guaranteed to send a shiver down the spine as it's
usually followed by "How much?, for adding a single field? you gotta be
kidding".
To add a single persisted field to an input form requires the
modification of most if not all of the layers of an application.
Adding a single field to a product line for example would probably
require the modification of all the CRUD methods for that line, not to
mention the inclusion of the field in the search algorithms, modifying
the validation layer, incorporating the field in a logical place in the
HCI, modifying and refactoring the relevant code etc etc. Anything that
can reduce the amount of work required to implement such an apparently
trivial change has got to be a good idea.
Having said that, I don't used ORMs myself, I mean I've tried, I've
really tried but I start reading the documentation and my eyes glaze
over and I discover that I need to learn 'another' (query) language and
I decide that it's just not worth the effort. Stick to SQL, accept the
overhead and I don't think you can go far wrong.
Just my 2 euros worth
--------------------------
I find myself actually agreeing with you again.
Adding even a single field to the underlying data structures is *not*
straightforward at all in a typical Java application.
database but it is not relevant to my post. I believe that adding a