advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

Review: Interview: Bruce Tate on the "Politics of Persistence" Beans:

Managed Persistence

BB: What do you think of EJB3?
BT: My most serious criticism was that EJB3 manage persistence at all, and after I wrote the paper "Don't Make me Eat the Elephant Again," they broke persistence out of the EJB3 specification.

I still think that too much is cooked into the behavior that's wrapped around the annotations. The container is much more sophisticated than it has to be. You just have a usage model that makes it easier to program. I much prefer an approach where you have a POJO, not just a programming model that looks like a POJO and wraps the same old EJB2 stuff.

BB: If I'm a developer, why do I care what the container is doing under the hood?
BT: The container under EJB defines the scope of the services that you're allowed to add. With an approach like Spring, it's much easier to add any arbitrary service to a POJO.

For example, I've got this session bean which uses a transaction strategy. I don't necessarily want the JSR 220 persistence underneath it. I ought to be able to use any persistence framework underneath it that I want to use. So this is my criticism of EJB. Persistence frameworks shouldn't be in the scope of enterprise JavaBeans. I'm glad they changed it.

BB: What do you think of container-managed persistence?
BT: Container-managed persistence has been a huge failure. With EJB 1.x, we had remote interfaces without local interfaces. We could not manage relationships in the database. We had to manage them in the model, so joins had to happen in the application instead of the database. In some situations, that was horrible for performance.

In EJB 2.x, we had a whole new set of problems and some of the same old problems. But basically it all comes down to this: you had to know too much to understand how to use EJB with container-managed persistence. It was just too complicated a model. An EJB entity bean, the component, was too different from a POJO. If I wanted to do object relational mapping, I wanted to go all the way from a relational database schema to an object model. But EJB entity beans only got me part of the way there.

BB: What about the ease of learning for Hibernate? Is that a valuable feature?
BT: I like Hibernate a lot. I like it because it provides more leverage and more power through object relational mapping. But if you're trying to use Hibernate to insulate you from the relational database, then you're probably going to get yourself in trouble. That's the case with all object relational frameworks.

BB: Why shouldn't you isolate yourself from the database?
BT: Making the conscious decision to isolate yourself from the work of writing code is different from isolating yourself from understanding the details of the relational database. Hibernate is a tool to give you better programming leverage. You can use Hibernate effectively because you understand what's going on under the covers.

The Complexities of Mapping

BB: You have an object, and you have a relation. They're two different beasts, and the complexities of mapping one to the other often makes people think that this is not the right approach.
BT: Ted Neward and I have had a playful—but spirited—debate on this topic. Ted had a blog comparing the use of object relational mapping to entering Vietnam. You can get yourself into some development scenarios that are tough to get yourself out of.

Some people believe it's perfectly okay to use an object relational mapper to shield you from having to know anything about the database. I think that if you understand what's going on under the covers, then you can use the tools for leverage. They will solve some problems and they will add other complexities.

If you have developers with a good understanding of SQL but not great understanding of Java, then object relational mappers aren't necessarily a good idea.

BB: What kinds of complexities do the tools add?
BT: I have a lot of knobs and levers for performance tuning. How do I gather enough information to use all those knobs and levers? These are very difficult questions but they're solving a difficult problem: how do I look at the database as an object graph instead of as relations?

When I'm doing batch-type operations or when I'm doing reporting, I'm using relational constructs. The use of relational constructs is a clue that I should be doing something else.

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Avaya DevConnect Center
 Service Component Architecture/Service Data Objects Solution Center
 Intel Go Parallel Portal
 Internet.com eBook Library
 IBM Software Construction Toolbox
 Microsoft RIA Development Center
 Destination .NET
XML error: not well-formed (invalid token) at line 53
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Is .NET on Linux Finally Ready?
Red Hat Takes on HPC Market, Microsoft
Python's New Release Bridges the Gap
No Flash Seen on iPhone Horizon
Apple Yields to Complaints Over iPhone NDA
Microsoft Shows Some Ankle With Visual Studio
Gentoo Linux Cancels Distribution
It's Official: Windows 7 at PDC, WinHEC
Oracle Keeps Building on Spoils From BEA
Intel, Oracle Head For 'The Cloud'

C++Ox: The Dawning of a New Standard
Getting Started with Virtualization
Master Complex Builds with MSBuild
eCryptfs: Single-File Encryption in Linux
CCXML in Action: A CCXML Auto Attendant
Ballmer: Current Woes Won't Halt Tech, Microsoft
Microsoft Uses VMworld to Hype Its Hypervisor
Microsoft Charges Ahead in Virtualization
Microsoft Shows Some Ankle With Visual Studio
Top 5 Reasons to Adopt SQL Server 2008

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES