Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 02 Jan 2014 04:02:39 -0600 Date: Thu, 02 Jan 2014 10:02:33 +0000 From: lipska the kat Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: ORMs comparisons/complaints. References: <%JGtu.29103$Wm1.26832@fx17.iad> <52c4d306$0$302$14726298@news.sunsite.dk> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 50 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-Fv0/c8u9tGYXC6p1NiKqgfnR+sX6vObs5ZJ7MiuYHtoU8tbxp5Udjwp6721tAE9srDyst2gPwko/BRW!JAfmdQcoC9iJOokG08jbwkbGo11HtlHHqjZYTmL6dc4Er2HU195IHbWEAtchl/Agyhe/dG3CzC0= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3470 Xref: csiph.com comp.lang.java.programmer:27171 On 02/01/14 08:34, Gordon Levi wrote: > Arne Vajhøj 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 -- Lipska the Kat©: Troll hunter, sandbox destroyer, treacherous feline and farscape dreamer of Aeryn Sun GNU/Linux user #560883 - http://www.linuxcounter.net