Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx12.iad.POSTED!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 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 Lines: 80 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Fri, 03 Jan 2014 04:29:40 UTC Organization: Public Usenet Newsgroup Access Date: Fri, 03 Jan 2014 00:29:40 -0400 X-Received-Bytes: 4554 X-Received-Body-CRC: 1292402325 Xref: csiph.com comp.lang.java.programmer:27186 On 01/02/2014 06:02 AM, lipska the kat wrote: > 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". Most BA, end user, customer, and PM requests send shivers down developers' spines. :-) > To add a single persisted field to an input form requires the > modification of most if not all of the layers of an application. If it's actually a persisted field in an input form (various types of data input mechanisms related to or from HTML, MS, Oracle, Adobe, IBM, etc), I agree. That by definition affects _every_ layer. > 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. From the implementation standpoint a persisted field addition, deletion or modification, in a complete stack scenario, will consume at least a man-day, and possibly several. It really won't make much of a difference as to whether a Java ORM or JDBC is involved...not on average. The actual problem with changes of this sort is that someone a bit higher up than the grunt coder altered the requirements, or the design. Proponents of agile have bent over backwards to accommodate these ineffiencies: this is just letting non-technological people dictate implementation. > 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 > The JPA specs are some of the best specs I've seen. The associated specs for the actual implementations are also quite good. If your eyes are glazing over when you try to read these, I'm pretty sure you've got a hell of a time with almost every other spec out there. Feel free to stick to SQL and waste substantial time doing NIH. It could just be me, but I like it when I get a substantial assist creating objects out of relational data. You just now above said "accept the overhead": guess what, there's a lot of overhead. AHS -- When a true genius appears, you can know him by this sign: that all the dunces are in a confederacy against him. -- Jonathan Swift