| By Jim Milbery | Article Rating: |
|
| May 1, 2001 12:00 AM EDT | Reads: |
13,191 |
Last month in JDJ (Vol. 6, issue 4) I introduced the topic of object/relational mapping. Databases such as Oracle8i or DB2 store data in tables and columns. Thus, customer data is stored in a "customer" table and information relevant to the customer such as ID, name, and address are stored as columns. All the data for a single customer within the customer table is equivalent to a "record." From the EJB perspective customer data is represented by a customer "class" and the data elements are represented by "attributes." Con- ceptually, the mapping process is a simple one. Each database table is an EJB class (CMP or BMP), and each and every column in the table becomes an attribute. Individual customer records are instantiated as EJB objects as necessary.
This month I tested the latest release of THOUGHT Inc.'s CocoBase Enterprise O/R mapping tool on my Windows 2000 server. Java-centric software companies such as THOUGHT Inc. take full advantage of both Java and the Internet when it comes to software development. They continually enhance their products with new features and bug fixes.
Last month I previewed "Service Release 8," and this month I was able to upgrade to "Service Release 9" - which included more than a dozen feature enhancements. The installation of CocoBase is packaged as a Java class file; it's a simple process to extract the installation files and install the software. The Java installer isn't fully Windows 2000 compatible yet, so CocoBase doesn't create desktop icons or menu items - all the software must be accessed via a series of command scripts. Nevertheless, it's a simple process to create your own desktop icons that point to the most common functions. The starting point for working with CocoBase is the Enterprise Administration Interface. THOUGHT Inc.'s choice of terminology here is a little off the mark as the admin interface is really the heart of CocoBase. All the major functions of the software are accessible from within this one interface - which is itself a Swing-based GUI program (see Figure 1).
CocoBase can connect to any of your enterprise data through a powerful JDBC interface. The software also comes equipped with a built-in SimpleText, Hypersonic SQL, In- stantDB, database, and you can use this data source to get accustomed to the many tools within the CocoAdmin interface. I elected to work with the SimpleText database and to create a new database map (as shown in the upper window in Figure 1).
You're free to map multiple CocoBase objects to a single database table, and I quickly created a variation on the Employee Table that would list only those employees that make over $20,000 annually. I called this new object EmployeeGT20000 and generated a new data map for this object from within CocoBase within a few minutes. I chose to build this object based on a CocoBase-supplied "where clause" against the salary field using a variable for the salary. Technically speaking, this object could be used to represent any group of employees by supplying different values for this parameter. This new object extends the Object class and either doesn't implement any proprietary interfaces or implements a number of interfaces including Cloneable, CBProp (a CocoBase class), and java.io.Serializable.
Once I had defined the EmployeeGT20000 map, I used CocoAdmin to generate Java source code into a package that I defined as "jmpkg". I could easily have added custom attributes and derived fields as part of the generation process. In either case, the resulting code is straightforward Java code as shown in the right-hand panel in Figure 1. The generated code includes get/set methods for all the attributes, a "where-clause" facility, and a facility for managing query information. Feel free to extend and modify this code. CocoBase can be used to manage data using both the BMP and CMP entity bean types. THOUGHT Inc. provides interface code for a wealth of third-party application servers including Allaire, Borland, IBM WebSphere, HP/Bluestone Sapphire, iPlanet, BEA WebLogic, and Sybase. (The development environment integrates with a number of popular Java IDEs such as VisualAge for Java, Borland's JBuilder 4, and iPlanet's Forte for Java.) This review covers only a fraction of CocoBase's capabilities and I'd encourage you to review the PDF documentation for additional details.
Summary
CocoBase's O/R tool can greatly simplify the task of interfacing Java code with relational data. In contrast with complete "frameworks," CocoBase improves productivity without sacrificing low-level control. You're free to modify the Java source as necessary to address your specific application needs. I'd encourage you to put CocoBase on your short list of products to consider when building a data-centric J2EE application..
Published May 1, 2001 Reads 13,191
Copyright © 2001 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Jim Milbery
Jim Milbery is a Vice President with William Blair Capital Partners, a venture capital firm based in Chicago. He has over 19 years of experience in application development and relational databases. He is the former applications editor for "Wireless Business and Technology", the past product reviews editor for Java Developer Journal and the author of "Making the Technical Sale". Jim can be reached at jmilbery@williamblair.com, or via the company web site at http://www.wbcapitalpartners.com
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?









































