Sep 01 Beg WebObjects
Volume Number: 17 (2001)
Issue Number: 09
Column Tag: Beginning WebObjects 5
Part 1 - Presenting WebObjects 5
by Emmanuel Proulx
Introduction & Installation
Preface
This new column deals with WebObjects 5. It is meant to be easy and fun to read. This column talks about developing a Web application using WebObjects 5, in Java. Originally, this column was a book, with hundreds of pages. It has been cut down a lot to accommodate space restrictions.
Those interested in learning to build Web applications using WebObjects 5 should read this column. The only prerequisite is being Java programmers of at least intermediate level.
Other knowledge is not necessary, although understanding HTML basics can help tremendously because WebObjects borrows many characteristics from this language. If you don't know HTML at all but you still want to learn WebObjects, just skip the paragraphs that talk about HTML. For your convenience, these are usually marked with the symbol <HTML>. You won't get into any trouble, but you will not understand how WebObjects works behind the scene.
The same thing goes with databases. While knowing databases and SQL isn't necessary, you have to have basic knowledge if you're going to read the sections about databases. Database software is necessary if you're going to try out WebObjects' database features. I tried to keep all of the database interfacing and programming contents in separate sections for convenience.
Note that someone who masters Java programming, client/server design, HTML and Web Design as well as databases and SQL will be able to learn WebObjects radically faster.
What Is WebObjects?
I started this new job and the job description was "Java Developer". I was expecting to use one of these Java IDEs like Visual Café or Visual Age. My new boss said, "No, here we use WebObjects". I had heard about that tool, but I didn't know it was a Java IDE. It wasn't.
WebObjects is an environment for developing interactive Web Sites. The Java language is being used to implement Server-side behavior; the client side is mostly HTML, not necessarily Java Applets or even JavaScript for that matter.
WebObjects is much more than that. If also falls into the Application Server category. What is that? In the past, a "Server" would consist of just a Database. Nowadays a Server can also handle distributed transactions, multi-tier architecture, load-balancing, business logic, Enterprise JavaBeans, and other concepts and technologies involving more advanced server-side intelligence. An environment that helps with the development and deployment of such complex Servers is called an Application Server.
WO consists of multiple tools that are tightly integrated.
- Project Builder: lets you browse the source code and manage the project.
- WebObjects Builder: lets you assemble a Web Page.
- Enterprise Object Modeler: lets you connect your Web Application to a database.
- Interface Builder: lets you create Java applications and applets that connect to the WebObjects server for executing business logic and database access.
- Direct To Web: a wizard that creates a complete database-driven customizable Web application.
- Direct To Java Client: a wizard that creates a complete database-driven customizable Java program or applet.
- Monitor: a remote task monitoring and performance analysis utility.
Other smaller utilities like a ‘Diff' utility, debugging tools, etc.
Other modules are included, yet they are not visible:
- Web Server Adaptor: plugs into your Web Server to connect it to WebObjects.
- JDBC Database Adaptor: connects WebObjects to a database driver.
- The frameworks, which are powerful programming libraries. They support the whole WebObjects system. We refer to them as the Foundation, WebObjects and Enterprise Object Frameworks. The preceding tools make use of the Frameworks, and even generate some code that uses them.
How do these tools work with each other? The Figure 1 illustrates their interactions.

Figure 1. Interactions between the tools
In a typical WebObjects application, the focus is the project file, which points to the different components of the application. The Project Builder manages this file. Then, to create the Web Components (Web pages), you usually run the WebObjects Builder program. When a component makes use of a database, you have to use a model to link the tables of the database to your system's objects. This model is created using the EO Modeler. To let a user connect to your site, you need a Web Server containing the WebObjects Adaptor. There's more on each of these parts later on.
Lastly, WebObjects also is an IDE for developing Cocoa and Carbon applications, but this column deals only with Web applications.
Installation Information
First you must know that there are two distinct packages that can be installed with WebObjects 5. Each has its own specific use and list of installed components.
- Developer edition: Contains all the graphical tools and libraries. Used for the development environment. At the time this was written, only the Mac OS X would support the Developer Edition.
- Deployment edition: contains only the deployment tools and the run-time libraries. Used for the deployment environment. Can be installed on top of the Developer edition on Mac OS X. The Deployment Edition is available for a variety of platforms.
This column generally talks about the Developer edition. The Deployment edition will be covered in a separate article.
To develop with WebObjects Developer Edition, you need a Mac OS X environment with at least 128 megabytes of RAM and 600 megabytes of hard disk space. That said, remember this golden rule: you never have enough RAM and hard disk space!
Once you're done with your development, you can deploy your application on either Mac OS X, Windows 2000, or Solaris.
You will also need a supported Web server. On the Mac OS X, the default server is Apache, and works great.
If speed doesn't matter that much to you, you can get any Web Server with CGI capability. Else, you have to get a Web Server compatible with either the NSAPI or WAI standards (Netscape's Web Servers), ISAPI (Microsoft's Web Servers) or Apache. Of course, select a Web Server that works on your deployment platform.
If you need to access a database, you want to use one that has a JDBC 2.0 driver. WebObjects comes bundled with an evaluation version of OpenBase. But on deployment platforms you may want to go for an industrial-strength database, like Oracle, Informix, Sybase, DB/2, etc. You can also connect to any ODBC-compliant database on Windows using the ODBC/JDBC bridge, but that would make things slower.
NOTE: Not many database products are available on Mac OS X, so you may want to purchase a complete version of OpenBase (www.openbase.com).
Installation
Pre-Installation Steps
It is very important to install your Web Server before you install WebObjects.
NOTE: if you already installed WebObjects and you want to install a Web Server afterward, the only issue is with the "cgi-bin" folder. WebObjects has already copied its required executables in a temporary "cgi-bin" folder. After setting up your Web Server, you will have to copy these executables in the new Web Server's "cgi-bin" folder (you will have to make one if there is none).
Also, it doesn't hurt to install your database software at this point if you don't have one already.
On Mac OS X, both Apache and OpenBase are installed by default.
To install WebObjects on any platform, you need to log on as the Administrator (or root) user. If you don't have Administrator (or root) access rights, it won't work at all.
On Mac OS X, you have to first enable the root user (which is blocked by default) and then to log on as the root user. To enable the root user, open folder /Applications/Utilities, and double-click on NetInfo Manager. Once NetInfo Manager is running, open menu Domain | Security | Enable Root User. You will be asked to enter a password for the root user. Now log off and log on again using ‘root' as the user name, and the password you set previously. You are now logged as the root user and ready to install. After the installation is finished, you may disable the root user by running NetInfo Manager again.
Installation Steps
Insert your WebObjects CD in your CD-ROM drive. Double-click on the new icon that shows up in the desktop. Now double-click on the icon marked WebObjects_X_Developer.mpkg. This will call the installation program. Then, follow the instructions in the wizard-like window.
The following notes are meant to help you along the way. Read them before starting the install:
- The serial number is usually located on a sticker on the CD envelope.
- Be sure to read carefully the License Agreement for the next two hours. ;-)
- Most people should choose a Typical Install. The Typical Install includes everything except the following (generally unimportant) items:
- The Japanese language support
- The source code
- At one point, the WebObjects installation program could ask you for your Web Server's "cgi-bin" folder and its "docs" folder. Check them out and write them down before you start the install.
- This process takes a very long time - be patient.
- You will need to restart your computer at the end of the install, so it's a good idea to save your data and close all programs before even starting it.
Patches
I recommend that you install the latest patches for all of these (if you use them):
- WebObjects itself
- The operating system
- The Web server
- Your database software
For the Mac OS X, updating to the latest patch is very easy. You can get all the patches by going to the System Preferences panel, in the category Software Update. You will find there a button "Update Now". Clicking on it will check all software versions against an online database of patches. It will propose updates when they are available. I suggest you apply all of them. At the time this article was written, there was one patch available, which fixes many bugs. Install it.
On other platforms, updating to the latest patch may require that you visit each vendor's Web site and check for patches there. That's it — you are now ready to enjoy your development environment.
I didn't cover the deployment installation here because it is a complex topic that deserves its own article.
The Find-A-Luv example
I designed this column to have a good balance of theory and examples. I took good care of the theory, but I didn't want to make tiny useless examples and toy-code I had seen too often. Also, I didn't want to just show how to use the wizards of WebObjects and leave you alone with the customization. I needed a real Web Application and I wanted to develop it from scratch, not using just the wizards...
So throughout this column, I will be developing, as the main example, always the same Web Application. It features a Web Site for an imaginary dating services company. This company's promise is to help find nothing less than the client's soul mate. But be forewarned: if you're looking for your soul mate, this column will not help you.
We will start small and we'll expand this example as we go along.
Web Development Alternatives
WebObjects is not alone. There's a lot of competition out there. Many tools offer interactive Web Site/Server-side processing and Application Server solutions. Let's digest a few of the most popular ones.
Competing Interactive Web Site Solutions
The first ever solution for that is the CGI (common gateway interface). This is the most primitive solution. CGI is not a product; it's a feature of your Web Server that lets you insert your own program in you Web Site. That program can receive the user's input, and outputs a new Web Page based on it. The main disadvantage of the CGI is that the HTML code and database access are encapsulated into the source code; this is not pretty nor is it easy to develop. The main advantage is that you don't have to buy software to use CGI programs since it's already in your Web Server. Just use any computer language and you're on your way.
Sun Microsystems' Java Servlets are based on the same idea as CGIs, except they are written in Java and use their own module (called Servlet Runner program) that adds on to the Web Server. They have similar advantages and disadvantages as CGIs except for the fact that certain Web Servers don't support Servlets natively. Or if they do, their quality leaves a lot to be desired. This is the reason why commercial third party Servlet Runner programs (like Allaire's JRun) are available.
Allaire's ColdFusion is a commercial product that lets you write HTML "templates". That is, you write your HTML like you would normally do for your Web Page, and then you add in the same file the logic that makes the page interactive. You can even link your page to the database in only a few steps. The advantage is that you can use an HTML graphical editor for most of the work, and then add the logic afterward. ColdFusion is easy to use and produces results fast (just like HTML does). The main problem with ColdFusion is that it's not a real computer language; you can quickly arrive at the limit of what it can do.
Microsoft's ASP (Active Server Pages) also relies on "templates". But the logic is coded with Visual Basic. The main advantage is, like ColdFusion, fast development and tools that let you create pages easily. The disadvantage is that ASP is not portable: you can only use it on Microsoft's Web Servers.
Sun Microsystems' JSP (Java Server Pages) is an important player. JSP is based on the same idea as ASP, but the logic is coded in Java.
Here's a grid that summarizes the different characteristics of these solutions:Ê
| Alternatives | CGI | Servlets | ColdFusion |
| Characteristics | | | |
| | | |
| Comes with your | Yes | Some | No |
| Web Server | | | |
| | | |
| Uses templates | No | No | Yes |
| | | |
| Logic and HTML in | No, HTML | No, HTML | No, code |
| separate files | in code | in ccde | in HTML |
| | | |
| Flexibility of a | Yes | Yes | No |
| real language | | | |
| | | |
| Supports most | YES | Yes, with | Yes |
| Web Servers | | Servlet | |
| | Runner | |
| | program | |
| | | |
| Uses Java | No | Yes | No |
| Alternatives | ASP/JSP | WebObjects |
| Characteristics | | |
| | | |
Comes with your Web Server | Some | No |
| | | |
| Uses Templates | Yes | Yes |
| | | |
Logic and HTML in separate files | No, code in HTML | Yes |
| | | |
Flexibility of a real language | Yes | Yes |
| | | |
Supports most Web Servers | NO | Yes |
| | | |
| Uses Java | JSP only | Yes |
Competing Application Servers
When Sybase wanted to issue an application server, they decided not to reinvent the wheel. They put together a set of existing tools then integrated them. Their Enterprise Application Server (or EAServer) is composed of Sybase's Jaguar CTS (application server) and PowerDynamo (Web server). EAServer is integrated with development tools like PowerBuilder and PowerJ, but these come separately.
IBM's application server is called simply WebSphere Application Server (Standard Edition). It features Servlets and JSP, a Web Server, and integration with Visual Age for Java and WebSphere Studio — sold separately. The Advanced and Enterprise editions offer more features, like EJB, better performance, security and other advanced features.
The Oracle Application Server provides a basic set of features; Web Server (with Servlet and JSP support), EJB, a stable and scaleable environment for deploying Web applications. It is also integrated with Oracle's IDEs, Oracle Developer and JDeveloper.
BEA's WebLogic Server is an application servers that follows the J2EE standard to the letter. It features also Servlets and JSP for the dynamic HTML part, integrated with the most popular third-party IDEs. EJB, Java 2 Enterprise Edition and the latest standards are supported.
Here's a grid that summarizes the different characteristics of these solutions:Ê
Alternatives Characteristics | | | | | |
| | Sybase | IBM | BEA |
| | EAServer | WebSphere | WebLogicServer |
| | | | |
| | | | | |
| Uses J2EE/EJB | Yes | Yes | Yes |
| | | | | |
| Works on Mac | | No | No | No |
| | | |
Comes with an IDE and tools | | No (separate) | No (separate) | No |
| | | | | |
| Does distributed | Yes | Advanced | Yes |
| transactions, | | | Edition only | |
| monitoring and | | | |
| load balancing. | | | |
| Alternatives | | | | | |
| Characteristics | Oracle | WebObjects |
| | Application | |
| | Server | |
| | | |
| Uses J2EE/EJB | Yes | No |
| | | |
| Works on Mac | | No | Yes |
| | | |
Comes with an IDE and Tools | | No (separate) | Yes |
| | | |
Does distributed transactions, monitoring and load balancing | | Yes | Yes |
As I am writing this book, there are countless different application server packages on the market. I will not cover them all, but I am convinced that only WebObjects covers such a wide variety of tools and features. But in general, I have noticed that most of the other application servers are just a bunch of distinct tools put together. Many of these products are tied to a single Web server or database. On the other hand, WebObjects has fully integrated tools that work together as a whole and leverages whatever tools (Web Server, database) you already have. Its programming libraries and database tools are jewels and no other vendor offers similar tools. While WebObjects does not follow the J2EE specification, its proprietary nature enables Apple to provide easy-to-use RAD tools and many "value-added" features. Furthermore, WebObjects is the only application server available on the Mac OS X.
Emmanuel Proulx is a Course Writer, Author and Web Developer, working in the domain of Java Application Servers. He can be reached at emmanuelp@theglobe.com.

Software Updates via MacUpdate
Apple Java 2013-004 - For OS X 10.7 and...
Apple Java for OS X 2013-004 supersedes all previous versions of Java for OS X. This release updates the Apple-provided system Java SE 6 to version 1.6.0_51 and is for OS X versions 10.7 or later....
Read more
Google Chrome 27.0.1453.116 - Modern and...
Google Chrome is a Web browser by Google, created to be a modern platform for Web pages and applications. It utilizes very fast loading of Web pages and has a V8 engine, which is a custom built...
Read more
EarthDesk 6.2 - Striking animated image...
EarthDesk replaces your static desktop picture with a rendered image of Earth showing correct sun, moon and city illumination.
With an Internet connection, EarthDesk displays near real-time global...
Read more
Apple Configurator 1.3 - Configure and d...
Apple Configurator makes it easy for anyone to mass configure and deploy iPhone, iPad, and iPod touch in a school, business, or institution. Three simple workflows let you prepare new iOS devices...
Read more
Apple Java for Mac OS X 10.6 Update 16 -...
Apple Java for Mac OS X 10.6 Update 16 delivers improved security, reliability, and compatibility by updating Java SE 6 to 1.6.0_51.Version Update 16:
See http://support.apple.com/kb/HT5744 for more...
Read more
Neat 4.0.3 - Digital filing system for r...
Neat (formerly NeatWorks) is a powerful scanning and digital filing system that enables you to scan and organize receipts, business cards, and documents. Unlike other scanning software, NeatWorks...
Read more
Adobe Muse CC 5.0 - Design and publish H...
Adobe Muse enables designers to create websites as easily as creating a layout for print. Design and publish original HTML pages using the latest Web standards, and without writing code. Now in beta...
Read more
Adobe Creative Cloud 1.0 - Everything ne...
Adobe Creative Cloud costs $49.99/month (or less if you're a previous Creative Suite customer). Creative Suite 6 is still available for purchase (without a monthly plan) if you prefer.
Introducing...
Read more
Adobe Flash Professional CC 13.0.0.759 -...
Flash Professional CC is available as part of Adobe Creative Cloud for as little as $19.99/month (or $9.99/month if you're a previous Flash Professional customer). Flash Professional CS6 is still...
Read more
Adobe InCopy CC 9.0 - Create streamlined...
InCopy CC is available as part of Adobe Creative Cloud for as little as $19.99/month (or $9.99/month if you're a previous InCopy customer). InCopy CS6 is still available for purchase (without a...
Read more

Calendars+ by Readdle Goes Free For A Ve...
Calendars+ by Readdle Goes Free For A Very Limited Time
Posted by Andrew Stevens on June 19th, 2013 [ permalink ]
Universal App - Designed for iPhone and iPad
| Read more »
Modern Combat 4: Zero Hour Has A Meltdow...
Modern Combat 4: Zero Hour Has A Meltdown, Gets New Maps, Multiplayer Modes, and More
Posted by Andrew Stevens on June 19th, 2013 [ permalink ]
| Read more »
XCOM: Enemy Unknown – Commander’s Log: H...
Part of the series 148Apps Goes Deep on XCOM: Enemy Unknown
I’m still haunted by visions of a parallel world (classified as Xbox 360) as it wasn’t long ago that I was in charge of the XCOM project and led a squadron of soldiers against an alien... | Read more »
Rovio Stars: The Angry Birds’ New Publis...
Rovio Entertainment, creators of Angry Birds, has a new publishing initiative called Rovio Stars that will see its first titles Icebreaker and Tiny Thief released soon. Kalle Kaivola, Senior Vice President of Product & Publishing at Rovio... | Read more »
Favorite Four: Soccer Games
As a soccer fan, I’m getting twitchy. The Confederations Cup might be helping a little, but I miss the English Premier League week in, week out. This is where I sink time into FIFA 13 on my console in order to counteract the problem. What about... | Read more »
Knights of Pen & Paper Adds More Dun...
Knights of Pen & Paper Adds More Dungeons and Loot In Free Update
Posted by Andrew Stevens on June 19th, 2013 [ permalink ]
| Read more »
Froot ‘n’ Nutz Review
Froot ‘n’ Nutz Review
By Blake Grundman on June 19th, 2013
Our Rating: :: VISUALLY DICEYUniversal App - Designed for iPhone and iPad
While Froot ‘n’ Nutz may not look very modern, it is very likable.
Â
| Read more »
148Apps Goes Deep on XCOM: Enemy Unknown
XCOM: Enemy Unknown will be released tonight for iPad and iPhone. And we’re very excited. While XCOM isn’t the first console game to be ported over to iOS, it is one of the most ambitious. XCOM: Enemy Unknown while first released for XBox 360 and... | Read more »
A Cautionary Tail – An Interactive Book...
A Cautionary Tail – An Interactive Book That Teaches Self-Acceptance
Posted by Andrew Stevens on June 19th, 2013 [ permalink ]
| Read more »
XCOM: Enemy Unknown – Cheats, Tips, and...
The X-Com series, particularly the earlier games, are notoriously unforgiving. Although while XCOM: Enemy Unknown has been modernized, and is therefore more player friendly, it’s no slouch either. In fact, even on the Normal difficulty there’s a... | Read more »
Price Scanner via MacPrices.net
Smaller Tablets Forecast To Get Even More Popular...
The DisplaySearch Blog’s Richard Shim notes that tablet PCs with screen sizes smaller than 9 inches are currently forecast to account for 66% of tablet PC shipments for the year but that share is...
Read more
Updated iPad Price Trackers
We’ve updated our iPad Price Tracker and our iPad mini Price Tracker with the latest information on prices and availability from Apple and other resellers.
Read more
Apple refurbished iPod nanos available for $99
The Apple Store has Apple Certified Refurbished 16GB iPod nanos available for $99 including free shipping and Apple’s standard one-year warranty. That’s $50 off the cost of new nanos. All colors are...
Read more
iFixIt Tears Down mid-2013 11.6-inch MacBook Air
iFixIt Chief Information Architect Miroslav Djuric says:
The epic week of disassembly continues: Today, the MacBook Air 11″ found its way onto our teardown table and was soon just another Apple in...
Read more
Mature Consumers Know When They Need a PC
Tech.Pinions’ Ben Bajarin sensibly observes that one of the fundamental characteristics of a mature market is mature consumers – mature in the sense that they know what they want and more importantly...
Read more
Windows 8 Continues Ascension in User Popularity R...
Softpedia’s Bogdan Popa notes that Windows 8 is now the fourth most popular operating system in the world, and according to some new statistics, it continues to gain new users every day.
Popa cites...
Read more
Apple iOS and OS X Updates Put Bluetooth Smart Rea...
From its Worldwide Developers Conference last week, Apple announced unprecedented integration of Bluetooth technology into its operating systems – a move that sets the bar for Bluetooth integration...
Read more
Buy a 13″ MacBook Pro, get AppleCare for as little...
Adorama has 13″ MacBook Pros bundled with 3-year AppleCare Protection Plans for as little as $40 extra (AppleCare has an MSRP of $249 for 13-inch MacBook Pros). Shipping is free, and Adorama charges...
Read more
Updated MacBook Price Trackers
We’ve updated our MacBook Price Trackers with the latest information on prices, bundles, and availability on MacBook Airs, MacBook Pros, and the MacBook Pros with Retina Displays from Apple’s...
Read more
Save $140 on the 15″ 2.3GHz MacBook Pro
B&H Photo has the 15″ 2.3GHz MacBook Pro on sale for $1659 including free shipping. Their price is $140 off MSRP. B&H will include free copies of Parallels Desktop, Bento Database, and LoJack...
Read more
Jobs Board
*Apple* At-Home Team Manager - Apple (U...
Changing the world is all in a day's work at Apple . If you love innovation, here's your chance to make a career of it. You'll work hard. But the job comes with more than
Read more
*Apple* Retail - Manager - Apple (Unite...
Job SummaryKeeping an Apple Store thriving requires a diverse set of leadership skills, and as a Manager, youre a master of them all. In the stores fast-paced, dynamic
Read more
*Apple* - Solution Architect - CompuCom...
Job Location: US-TX-Dallas Posted Date: 4/18/2013 Overview: The Apple Solution Architect (SA) will be responsible for supporting pre-sales and post-sales solutions in
Read more
*Apple* Support Technician; Mid-level -...
A Kforce client in Washington, DC area is seeking an Apple Support Technician. This contractor will have the following types of responsibilities including, but not
Read more
Systems Engineer - *Apple* TV - Apple...
Job Summary The Apple TV team is looking for an experienced engineer with a passion for delivering first in class home entertainment solutions. The individual must be
Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by
Icreon.