Hibernate - A J2EE Developers Guide 244
Hibernate - A J2EE Developers Guide | |
author | Will Iverson |
pages | 351 (13 page index) |
publisher | Addison Wesley |
rating | 7 |
reviewer | Simon P. Chappell |
ISBN | 0321268199 |
summary | Overall a solid work |
What's To Like
The first thing that I liked is the way the book is written. Mr. Iverson has a very pleasant writing style that I found engaging. Not too formal and not too light. Naturally, there is a certain amount of Hibernate evangelism, but hey, if the author doesn't like the tool, then how am I supposed to feel good about it either? The evangelism does not feel like it strays from the bounds of truth, and there is much honesty in his first and last chapters where he discusses reasons for using a tool like Hibernate, and how Hibernate has influenced the design of the soon-coming version 3 of the EJB standard from Sun.
Chapters two, three and four cover the basics of using Hibernate. Each covers a different aspect, and each is independent of the other. Chapter two covers the use of the Hibernate mapping file as the reference that everything else is built from. This is the recommended mode of operation, where the database schema and data access objects are built for you. Chapters three and four are for those of us in the corporate world where the code or the database schema comes first and we have to adapt to and accommodate it.
Chapters seven and nine give the database theory-challenged amongst us a useful refresher in database relationships and transactions. The information, while provided in the context of Hibernate, serves as a useful refresher for the rest of us.
Hibernate has three query mechanisms. Given its relational database capabilities, one of the options is the use of plain old SQL, naturally. The two remaining options are the Hibernate Query Language (HQL) and the Criteria API. The HQL gets a fairly decent amount of coverage and left me to infer that it is the preferred means of expressing queries. The Criteria API gets only four and a half pages of explanation, which is still more than the single page dedicated to SQL.
The next to last chapter is a collection of real-world advice and tips for getting the best from Hibernate. This is a very useful chapter and looks like it contains good advice. The only thing I would suggest is that it's a little slim for a chapter of its own. Either the information could have been tucked in an appendix, or it could have been spread through the book in the form of embedded tips.
Naturally, the book has a website to accompany it.
What's To Consider
The book carries a copyright date of 2005 and a first printing date of November 2004. That being said, it should come as no surprise that the version of Hibernate covered is 2.1.2, but at the writing of this review (early April 2005) Hibernate 3 went final. I feel that the majority of the concepts and basic operations will be unchanged, but take this into account when deciding upon a purchase. While it is difficult to write books against the constantly moving target of an open-source or free software project, it is possible. I was involved in the technical review of a number of Struts books and they were challenged with the task of being available as version 1.1 was released. A massive undertaking, but one that they proved doable.
The typesetting seems crowded in this book. I'm not a white-space extremist, but I sure recognise when there's too little. The listings are often multi-page and have a slightly squashed feel to them.
Depending upon your point of view, chapter five is either a very useful annotated explanation of all of the available mappings within Hibernate, or it's a bad case of using available online documentation as filler (53 pages). Personally, I dislike this, but if you're in the market for an "all-in-one" style of book, this might work for you.
Summary
This is a solid work that will take you from novice to a good working knowledge of Hibernate. If you can live with the fact that the book targets Hibernate 2.1.2 while the current production version available from the website is 3.0, then give this book a try.
You can purchase Hibernate - A J2EE Developers Guide from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Chapelle? (Score:2, Funny)
A few things... (Score:5, Informative)
This book, however, I found extremely lacking. It didn't really teach me anything new that I didn't already learn from the webpages. Granted, I've been using hibernate for over a year now and have kept up with the technology, so perhaps this is still a book for someone new to the technology.
Re:A few things... (Score:3, Insightful)
If you're writing a toy application or a simple database report generator, sure. You don't need complex business rules and it's probably ea
Re:A few things... (Score:2)
dividing the responsibility of an object is fundamental to OO programming.
Just because the rules are not in the dAO does not mean the end up in the UI. Add another layer.
Re:A few things... (Score:2)
Exactly. Let Hibernate build the DAO's for you behind the scenes. Those will manage the data in and out of your domain objects (that can then focus on enforcing all of the business rules) and all you have to do is maintain an
Don't build yet another DAO layer for Hibernate to manage with Hibernate's automatically generated DAO classes. The DAO pattern doesn't let you use encapsulation, effective inheritance,
Re:A few things... (Score:2)
DAO's aren't objects, or are at best, badly designed objects. You can't use encapsulation with them, the uti
Re:A few things... (Score:2)
Re:A few things... (Score:2)
Exactly.
Domain objects with business rules, Hibernate builds the DAO's behind the scenes, UI presents the data from the domain objects to the world.
I'm objecting to going through the effort of describing DAO's for Hibernate to synchronize with the db and then having another place for your business rules. Hibernate takes care of the same problem that DAO's purport to solve and does without me needing to do anything other than maintain a
Re:A few things... (Score:2)
Then try Hibernate in action [amazon.com] (but if amazon prompts you to buy Hibernate : A Developer's Notebook [amazon.com] as well, skip it. The latter is a typical beginners book. I had the misfortune to buy them both AND read Hibernate in Action first, only to find out that reading the other is useless after that)
Is it better than Hibernate in Action? (Score:5, Interesting)
Re:Is it better than Hibernate in Action? (Score:4, Informative)
Hibernate in Action is the best available I think. I flicked through "Hibernate: A J2EE Developer's Guide" in a bookshop and didn't think it would teach me much - however it might be a better book as an introduction to hibernate. (It certainly looked better than "Hibernate: a developer's notebook")
I did like HiA but it still left me wanting more. A lot of the book spent time talking about common design patterns where I would have liked to see a bit more Hibernate/DB theory.
Re:Is it better than Hibernate in Action? (Score:2, Informative)
Hibernate: A Developer's Notebook [oreilly.com]
Hibernate: A J2EE Developer's Guide (Addison Wesley)) [aw-bc.com]
Java Open Source Programming: with XDoclet, JUnit, WebWork, Hibernate [wiley.com]
But they all fall short of Hibernate in Action imho.
Java never got a fair break. (Score:3, Interesting)
Is it going to be replaced by C#? Perhaps, but it is possible to fully exploit it today, and with tools like Hibernate it's possible to rapidly deploy applications on a grand scheme. In today's business environment it is often a matter of getting it done fast rather than best, and if it's turning into a problem with performance it is always possible to turn to another language once you have something in place.
Re:Java never got a fair break. (Score:2, Informative)
This development itself proves the big advantage Java has over C#/.Net in the enterprise arena: a far wider array of supporting libraries and frameworks, not to mention a selection of mature application servers. For this reason it will be quite hard for C# to catch up, especially sinc
Re:Java never got a fair break. (Score:2, Informative)
This is bound to be the case, considering how much longer Java has been around compared to C# - however, bear in mind that a large number of popular frameworks have already been ported to C#/.Net including NHibernate [sourceforge.net], Spring.NET [springframework.net] and Maverick.NET [sourceforge.net].
Re:Java never got a fair break. (Score:5, Insightful)
Re:Java never got a fair break. (Score:2)
Don't get me wrong I don't like writing english for code like cobol either. But if language institutes good layout format for all developers, I'm all for that. Let rest of languages participate in obfuscation contest and be winners, because thats
what all those punctuation mark
Re:Java never got a fair break. (Score:2)
It's easy to find an adequate Java programmer. Not so much for Python, Ruby, or Lisp.
Of course, just like any other profession out there, good programmers are hard to come by regardless of language. Good programmers could get rolling in any of the languages I mentioned in a couple days anyway.
The business world mostly gets away with a
Re:Java never got a fair break. (Score:2)
Re:Java never got a fair break. (Score:2)
C++ has neither real types or real templates.
C++ types are system and implementation dependent, and the temples are an imitation of something done better elsewhere (i.e. CL macros).
And BTW, Java does have an unsigned data type.
first JVMs (Score:2)
Current JVMs are reasonably fast. In fact, most performance gap between java and C comes from its safety features.
Safety, however, is very important for web apps. Writing regular sites in C is just asking for C-style memory attacks, like buffer overflows.
Finally, nobody really complains about python's or perl's speed.
Re:Java never got a fair break. (Score:3, Interesting)
Doubtful. I'm sure C# will get quite popular, but neither that nor will Mono have a foothold on the server like Java does anytime soon. Java's tools and microcosm of open and closed projects are being used by quite a bit by companines and organizations doing real, every day work. Granted, Java on the desktop never took off, but the whole C# vs. Java war is just a myth - there's plenty of room for both to exist.
I'm using Hibernate on my current project and whil
It was unfairly judged, but that doesnt make it OK (Score:2)
Then, people starting coding GUI apps in Java, with a misguided notion that it would be truly portable GUI apps. This is not only untrue, but a lot of people got angry because their sluggish machines couldn't handle it. This continues even today. A common comment about Eclipse, for example, is that it's a terrific IDE so long as you have
Re:Java never got a fair break. (Score:2)
Hibernate may be great but all the buzz these days is about ROR (ruby on rails). It takes a completely different approach to persistance layers and it still a bit immature but it has potential and some great brains behind it.
While java is looking over it's shoulders at C# languages like python and ruby are becoming more ubiquitus.
Re:Java never got a fair break. (Score:3, Interesting)
Not in it's current form it won't. RoR has some serious design flaws for major projects. One is that the object model is derived directly from the database, so if the database changes even slightly, this can seriously break code. Serious ORMs have mapping configurations that allow the object model to be isolated from such changes. Thi
Hibernate and J2EE (Score:2, Interesting)
I am curious to know if this books spend a decent amount of space on actually using Hibernate in the context of a J2EE application (i.e., instead of using CMP)? I currently work with CMP and I am not a huge fan, I am very interested in alternatives and wonder if this book is the place to start looking.
The title of the book implies that the book does cover this, but the review doesn't actually mention this specifically.
Re:Hibernate and J2EE (Score:5, Interesting)
1. Screw EJB and CMP
2. Use Spring instead of EJB's (or in conjunction with EJB's)
3. Use Hibernate for persistence
4. Configure Hibernate through Spring and use the Hibernate ORM support in Spring to further speed up development and decrease code (both Java AND xml)
Hibernate vs. JDO vs. EJB (Score:3, Interesting)
What is the latest on this battle?
There are so many soundbites floating around:
Hibernate is JDOish but does not follow Sun JDO Spec. But.. Gavin King of Hibernate became a member of JD02.0 Expert Group and would make it compatible with JDO 2.0 Spec.
JBOSS is adopting Hibernate as the underlying persistence mechanism for its Container-Managed Entity Java Beans.
EJB 3.0 rejected JDO 2.0.
So.. now I am confused. Who is the winner? Should I buy the book or not? Anyone care to enlighten us?
Re:Hibernate vs. JDO vs. EJB (Score:2)
Re:Hibernate vs. JDO vs. EJB (Score:2, Insightful)
oracle is not the de-facto enterprise db.
Re:Hibernate vs. JDO vs. EJB (Score:3, Informative)
Mod parent up. It's not caching. Databases can cache too. If you're an ISV and you want to sell to companies that don't neccessarily share your views on which DB vendor is the best, then stay away from stored procedures and make your SQL as standards compliant as possible. In which case, an ORM technology makes perfect sense.
Re:Hibernate vs. JDO vs. EJB (Score:3, Informative)
Shifting persistent objects into anything other than a standard SQL engine means you have to undersgtand and work with 2 different technologies when manipulating your persistence engine.
Frankly, I'd like to stay with one language, one deployment method, one set of
Re:Hibernate vs. JDO vs. EJB (Score:4, Funny)
Re:Hibernate vs. JDO vs. EJB (Score:2)
Re:Hibernate vs. JDO vs. EJB (Score:2, Informative)
Hibernate does not really compete with CMP Entity beans, but perhaps sessions beans. I see the breakdown as this.
If the requirements are hundreds of transactions a second, then EJB will probably be the best choice. It has the ability to swap out objects to disk and share resources very well. In my humble opinion it is the only way to scale Java apps up to many thoughsands of concurrant users.
With EJB's, the container handles and provides a ton of features that you the de
Re:Hibernate vs. JDO vs. EJB (Score:4, Interesting)
I disagree -- Hibernate is almost a drop-in replacement for CMP entity beans. It does nothing to address the issues that session beans address (implicit transaction management and transparent load balancing, to name the two big things session beans buy you) and does the important thing CMP entity beans do (O-R mapping and removing the need for an object to have code to load and save itself.)
Neither does EJB, especially as of EJB 2.0. Using local bean interfaces means no RMI overhead -- they're so against you using remote invocations that local bean methods are forbidden from throwing RemoteException!
Not, mind you, that I'm any big fan of CMP entity beans. Using them was the biggest architectural mistake I made when I was starting out in J2EE development. Lots of development overhead, bad performance, and very little real gain. Hibernate beats CMP entity beans in just about every respect.
Re:Hibernate vs. JDO vs. EJB (Score:2)
From my limited test with Hibernate I have found it to be a HUGE memory hog. Specifically RAM. Now given that the app is not distributed, RAM can become an issue. I also want to point out that when the system fina
Re:Hibernate vs. JDO vs. EJB (Score:2)
Re:Hibernate vs. JDO vs. EJB (Score:2)
And transcation can include X amount of queries.
thanks.
PS: someone on slashdot should enable Spell check button, since so many people are out of English speaking states. Maybe make it a requirenment...
Re:Hibernate vs. JDO vs. EJB (Score:2)
You are correct about transactions. However my point is fairly general, in that if you want to have a system scale (say 75% database reads, and 25% writes), at some point Hibernate will not be the answer. My experience is that Hibernate is RAM hungry, and EJB's are a pain to debug and develop. No solution is perfect, but Hibernate and EJB's don't really compete against each other.
Re:Hibernate vs. JDO vs. EJB (Score:2)
Re:Hibernate vs. JDO vs. EJB (Score:2)
I don't have much time right now, but I would love to talk more about this with you and see what issues you found, and how you solved them.
Thanks
Re:Hibernate vs. JDO vs. EJB (Score:2)
Re:Hibernate vs. JDO vs. EJB (Score:2)
I am willing to bet that 99% of all EJB 2.0 apps do not use the local interface.
Now having said that... It does look like the EJB 3.0 spec for O/R mapping will look a lot like Hibernate
This is great news.
Re:Hibernate vs. JDO vs. EJB (Score:2)
Well, with a name like Hibernate, I figure the book would put me to sleep.
Re:Hibernate vs. JDO vs. EJB (Score:2)
Gavin King is actually on the JSR 220 (EJB 3.0) committee and has completely thumbed his nose at JDO. He has posted on TheServerSide.com about how much JDO sucks. EJB 3.0 completely embraces Hibernate. In fact Hibernate 3.0 + Annotations is an implementation of EJB 3.0.
Re:Hibernate vs. JDO vs. EJB (Score:2)
Re:Hibernate vs. JDO vs. EJB (Score:3, Informative)
1) When we talk about EJB 3.0 in this context, we are really talking about Entity Beans. Entity Beans are currently crap - do not use them. Future versions of the spec are moving in a better direction though (see below). The Session Beans part of EJB 3.0 are very useful IF you need to services provided by the container (but that is outside this conversation).
2) JDO is a real thing, and it works rea
Re:Hibernate vs. JDO vs. EJB (Score:4, Informative)
Depends what for.
In spite of what you might read, JDO IS widely used, which was why the JDO 2.0 specification was recently approved against a lot of political pressure.
JDO does not limit you to relational stores. Hibernate does. JDO 2.0 is very close to Hibernate in terms of use and features, but can work with a very wide range of stored. You can get JDO implementations that work with CSV files, Object databases, XML stores etc. You can use exactly the same code and API to access these stores as you use to access relational stored.
Hibernate is a high-quality product, but JDO gives you choice.
There are nice free and open source implementations of JDO as well.
Re:Hibernate vs. JDO vs. EJB (Score:2)
This goes from the most fundamental one, namely to specify an ORM, to many details such as an API to get a single result instead of a Collection from a query.
thinking of hibernate, try OJB first... (Score:2, Informative)
Re:thinking of hibernate, try OJB first... (Score:2)
Me thinks someone has an affiliation with the hibernate crew
Cayenne - You'll like it better. (Score:2, Informative)
I am not affiliated with Cayenne at all - just a VERY satisfied customer.
http://objectstyle.org/cayenne/ [objectstyle.org]
XDoclet? (Score:4, Insightful)
I know, many people like maintaining configuration files manually. Some people also like nailing their tongue to flaming coals.
Personally I prefer using a handful of @hibernate and @spring tags. But I haven't found a decent explanation of how to use the tags (e.g., if you use A you must also use B). It can be annoying - I only recently discovered the @hibernate.joined-subclass tag that permits me to use a common base object (for an integrated 'id' space) without creating a "kitchen sink" monster table.
It's the "write once" paradigm (Score:2)
Once you accept this the benefits of using XDoclet are obvious. First, you only have to update information once - the configuration file and generated source files will be aut
Re:Embedding configuration in the source? Yuck (Score:3, Informative)
The parent is exactly on the mark. The forced separation of deployer/developer roles in J2EE has caused me to do lots of useless busywork since I first started using it back in the 1.0 days. I'm a contractor, and have worked in a bunch of J2EE shops since then -- and not one of them has ever made use of the ability to tweak the sorts of configuration parameters you'd typically include in your XDoclet tags. But until XDoclet started catching on,
NOOOOOOOO!!!! (Score:2)
If you wanted those flame wars, you could just head over to theserverside [theserverside.com]
But on a slightly more serious note, it seems that there are moves afoot for reconciliation between EJB and JDO. There's a link with discussions here [theserverside.com]. Enjoy the reading. theserverside does have some infamous trolls and makes slashdot look like the greatest thing since sliced bread.
Sqlmaps (Score:5, Informative)
Here's an example on how to execute a query called "myquery"
MyObject myobject = (MyObject)sqlMap.queryForObject("myquery",myinteg
And here is the query declaration:
<select id="myquery" parameterClass="java.lang.Integer" resultClass="mypackage.MyObject>
select * from mytable where id = #value#
</select>
Simple query to object mapping
Re:Sqlmaps (Score:2)
ie, From the front page of http://www.ibatis.com/ [ibatis.com] click on the small "Wiki, FAQ, IRC" link. Near the bottom of that page, locate a tiny "FAQ" link and click it, and go to a page that tells you that "Frequently 20Asked 20Questions This page does not exist yet." And suggests I try "Frequently Asked Questions" instead. Click this, and at long last you get to the FAQ
- The FAQ does not answer the questions "What is iBATIS?", "What doe
Hibernate makes you re-express the data model (Score:2)
What you have to do is write yourself a new Java class (according a to big complex set of rules), one for each entity in the model. And there are a lot of different ways to handle various association-types and cascading-persistence requirements.
Once you've done all this, you have Hibernate's methods for "easily" loading and saving the objects.
So in a way you have to re-express an alread
Re:Hibernate (Score:2, Insightful)
3 Letters: (Score:2)
Re:Hibernate (Score:2)
FYI, the various
Also,
Re:Hibernate (Score:4, Funny)
Re:Hibernate (Score:2)
Re:Hibernate (Score:2)
Re:Hibernate (Score:2)
Re:Hibernate (Score:2)
Java depends on interpretation and JITing to get to native, while
Re:Hibernate (Score:2)
Wrong, and wrong.
First, off JIT doesn't mean "zero interpreting", no JIT VM compiles all code. It's simply not efficient to do so. And all that code is interpreted.
Second, Sun's first VM for Java was an interpreter, but Java was not at all designed to be an interpreted language. In fact, it was designed with allowing JIT VMs in mind. (And Sun's J
Re:Not Interested (Score:4, Funny)
Re:Not Interested (Score:2)
They are ultra-double-plus-ungood.
Re:Not Interested (Score:3, Informative)
Re:Not Interested (Score:2, Interesting)
Often, without carefully tuning these querries, I'm getting horrible performance. With well tuned querries (and appropriate indexing), performace is acceptable. If hibernate was smart enough to say - build anonymous views then join on them when it was a benefit to performance -
Re:Not Interested (Score:4, Insightful)
Although it's possible to do summaries, it's not what it's for primarily. I think you'd be better off polishing up your SQL rather than learn Hibernate if that's what you're doing. Not that it would be any worse than what you're doing now (you could run the same SQL through it), it just seems like you could get bigger improvements from the time you'd spend learning it.
Isn't an SQL writer? Please clarify. (Score:4, Informative)
The Hibernate Query Language, designed as a "minimal" object-oriented extension to SQL, provides an elegant bridge between the object and relational worlds. Hibernate also allows you to express queries using native SQL or Java-based Criteria and Example queries.
So...I'm guessing you're using the phrase "SQL writer" in some new and unusual way. Does "SQL writer" mean "writes SQL output to standard output"? Do you mean "SQL optimizer?"
Hibernate can only talk to RDBMSs that use SQL. It writes SQL to them and recieves SQL from them.
Re:Isn't an SQL writer? Please clarify. (Score:2)
Read the grandparent post ("I'm heavily thinking about shifting from handwritten SQL and the Spring framework to hibernate") to get the context, and it's not hard to figure out.
Tip: substitute "generator" for "writer". Then try again.
Re:Not Interested (Score:2)
I would be interested in creating large object graphs at will easily, as I do that as often as I do summaries. I do find that if I'm going to pull those graphs, sometimes writing queries in specific ways will get me vast improvements.
Oracle is annoying, in that sometimes two queries that look very similar can have different performance - sometimes 'forcing' the oracle query runner to pick a certain place to start
Re:Not Interested (Score:2)
(I dont expect anything decent from JDO, since it is done by former ODMG people and DB vendors which shy interoperability like
Re:Not Interested (Score:2)
In case if your problem you might have to go for following solutions, Iterators can handle the dataset load, maybe paging (dumping 1.5m objects into the object heap is not really preferrable) and as
Re:Not Interested (Score:2)
Re:Not Interested (Score:2)
He basically set's three foreign key 1:1 relations but has forgotten about adding the key colums on one side of the relation. Why the db itself did not check that is weird to me, normally dbs cry at such situation at creation level.
This is definitely not a Hibernate issue, and if you could read more than three lines or would have bothere
Re:Not Interested (Score:3, Insightful)
Yeah, but you can't blame Hibernate for that idea. The whole Java world seems to love pseudo-SQL: EJB-QL, JDO-QL, etc.
Re:Not Interested (Score:2)
Re:Not Interested (Score:2)
objecta.relation1.relation1 do whatever you wantwith it
That was basically the only part of the OQL which I really loved which hibernate based the HQL upon. You dont have to care whether the DB joins or subselects it you ara in a plain object scope for this.
Two table joins? (Score:2)
Re:Not Interested (Score:2)
You might be punishing yourself too by missing out on a potentially useful product. I personally just filter that marketing garbage out.
Re:Not Interested (Score:2)
Re:if..then (Score:5, Funny)
Bleh:
push ax
push bx
push cx
call test_speed_C
move di,cs:[ofs_testC_result]
move ds,cs:[seg_testC_result]
move al,ds:[di+2]
call test_speed_asm
move di,cs:[ofs_testC_result]
move ds,cs:[seg_testC_result]
move ah,ds:[di+2]
cmp al,ah
jb bwahaha_msg
pop cx
pop bx
pop ax
Chicks dig asm, but I'll concede it's so-so for rapid prototyping though...
Re:if..then (Score:2)
Re:if..then (Score:3, Funny)
To follow the usual java method naming conventions, your method should be named performAce(). Also, from a readability standpoint, a method named performXXX() should probably return void. Secondly, any C programmer worth his salt will remove some (but not all) of the vowels from a method name to mark his territory (i.e. c.prfrmce).
Lastly, would you like fries with that hat?
hmm.. (Score:2)
Re:Can anyone tell me... (Score:2)
Re:Can anyone tell me... (Score:2)
I'd be interested in looking under the covers at what you have, but after working with struts, xml->xslt->browser consumable language, and back in the day plain old servlet/jsp, I've grown weary of page-oriented development of webapps.
I've recently built a smallish system using tapestry and have been amazed at the boost in productivity it gives me. I also used hibernate in the same project and found it gave a similar
Re:Can anyone tell me... (Score:2)
Spring offers the equivalent of #1, though you can also use other templating languages (Velocity, WebMacro) or other MVC frameworks (Struts, Tapestry). In simple cases, JSP with Spring is sufficient. What Spring does really well is to keep you from polluting your view logic with application log
Re:Java vs Ruby (Score:2)
"I don't want to start a language flamewar, but I just finished reading a slashdot article comparing Ruby on Rails to Java + Spring/Hibernate and was hoping that was enough to interject into this conversation with the hope someone would click on my free Nintendo DS, GC, PS2, Xbox link."
Don't worry, it happens.
Re:Coverage, it's not just for subjects. (Score:2)
(Or both, of course.)
Re:Makes sense (Score:2)
To me it makes somse sense to abstract the data access away from the business application. This metholdogy embraces the whole notion of object-oriented design, since switching out the data means you won't have to touch the business app - just the interfaces.
Re:Bogus! Was:Don't fear the SQL (Score:2)
MyObject obj = (MyObject)getmydamnobject(Object searchParamA, Object searchParamB);
Hell, I don't even want to have to cast it; what the hell else would I want? Why the hell would I try to cram an integer into a custom datatype?
Sadly.... ah fuckit.
Looks nice. I wish this all took less mental overhead; not saying it is *hard* persay -- just so much crap in the attic to pull down, dust off and use every time we need to write a decent prog.
We really are the mages of our time -- waving our ha
Re:Bogus! Was:Don't fear the SQL (Score:2)
1. how do I separately validate the syntax & query results? Can I run it in on a command-line? In a query tool, etc?
2. how do I diagnose subtle problems caused by hibernate join failures? Exactly what sql is it running?
3. how much flexibility does it have? Can it handle outer joins? Subselects? Group bys? Aggregate functions? No? Then why use such a poor subset? Yes? Then why not just use sql?
4. How do you l
Re:Don't fear the SQL (Score:2)
Sure, there's plenty of simple CRUD (create, replace, update,delete) stuff that could be hidden behind something like this if you want. It's tedious stuff - but hardly difficult.
But beyond that - applications are expected to provide a greater amount of analysis than they were ten years ago. Just doing CRUD isn't enough - people also want to see simple analytical data (trends, totals, medians, averages, rolling av