Applying "Digital Hub" Concepts to Enterprise Software Design, Part 2
Pages: 1, 2, 3
Create and Use an Administration Tool (Direct to Web)
If you have completed all of the steps above, you've created a simple, but flexible database for holding weather measurements. Of course, it is not very exciting in its current state. Our database does not even have any data yet! Fortunately there is a cool technology in WebObjects that can automatically build a web application, based on our EOModel, that we can use to populate the database. We will build much better data entry tools in future articles, but this will give us some data to play with as we design the rest of the system.
Create the Administration Tool
- Launch Xcode (you can find it in /Developer/Applications/).
- Choose New Project from the File menu.
- You will be presented with many types of projects that you can build. Select Direct to Web Application from the WebObjects group. Then, click Next.
- Name the project
WeatherHuband click Next. - Leave the J2EE options set to their defaults and click Next.
- Leave the Web Service Support options set to their defaults and click Next.
- On the EOAdaptor screen, make sure that the JDBC framework is selected, and then click Next.
- Leave the Choose Frameworks options set to their defaults, click Next.
- This is the important step, so pay attention! Click the Add button and select the EOModel that you created earlier (called
Weather.eomodeld). Then click Next. - Choose the WebObjects Look so that your project will look like my screenshots. Click Next.
- The last page lets us choose to build and run the project right away. Make sure the box is checked and click Finish! After a minute or two of compiling, your application will automatically launch and open in your web browser. Congratulations on creating an Administration tool!
Add Sample Data to the Database
Add Data Types:
- Make sure that you followed the previous steps and that the web application is visible in your browser. You should see a login screen.
- Leave the text fields blank and click the Login button.
- On the left side of the window, make sure that the DataType entity is selected, and then click the New button.
- Type
numberin the text box and press Save.
- Repeat steps 3 and 4 and create a data type with the name
string. - Click the search button on the left side of the screen, followed by the SearchDB button in the middle of the screen. A list of your newly created data types should appear.
Add Measurement Types:
- Select the entity
MeasurementTypein the pop-up menu on the left side of the browser window. Click the New button. - Assign the name
Temperatureto the new measurement type. - Click the hand icon next to Data Type, and then click SearchDB at the bottom of the window.
- Click the Add button that is next to the data type "number." Click Return to finish editing the new measurement type.
- Click the Save button.
- Repeat steps 1 to 5 to add a measurement type of
Wind Speed(just like Temperature, its data type is also "number").
Add Measured Data:
- Adding some measurement data should be almost the same as adding the type data, so I'm going to leave the steps up to you. Remember to select
MeasuredDataas an entity before trying to add new data. - Add a temperature of
70forMay 1, 2004. - Add a wind speed of
5forMay 1, 2004. - When you are done adding data, view the data by performing a search in the Administration Tool. You may also want to view the data using the Browse database feature in OpenBase.
Final Thoughts
Congratulations on designing and building a flexible database. We also built an administration tool using WebObjects and entered some data into our new database. Not bad for our first tutorial together! Give yourself a pat on the back if you made it all of the way through. For each article in this series, I will assign some extra credit for those who want to go beyond the tutorial. For this article, it would be nice to have a location associated with each measurement. For extra credit, add another table that stores location data (such as latitude, longitude, and altitude) and create a relationship so that it is connected to the measured data table.
In the next article we'll design an XML format that can be used to transfer all of the data in database. After we do that, we will have our hub and spokes well-defined and we can get into the really fun stuff. Until then, happy programming.
Resources
Adam Behringer works as the CEO of Bee Documents, which strives to help legal and medical firms efficiently manage their documents.
Return to the Mac DevCenter
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 7 of 7.
-
generated SQL
2004-05-25 05:56:03 djennings3 [Reply | View]
-
generated SQL
2004-05-25 07:02:59 ABehringer [Reply | View]
For those who are not using WebObjects I posted the SQL code that EO Modeler generates.
I am running WebObjects on Panther and Panther Server. It should work fine (the license is a demo version, but it is the same software download as the commercial version). -
generated SQL
2004-05-27 15:46:22 rga218 [Reply | View]
One thing worth noting for those of us who are using XCode for development, but have not upgraded to XCode from the old version of the developer tools. WebObjects (more specifically, EOModeler) appears to require certain frameworks that come with Project Builder. Because Project Builder has been replaced by XCode, Project Builder is not installed when you install XCode, so a "vanilla" installation of XCode on, say, a new machine that never had Project Builder installed will not work with EOModeler. You need to go back and grab the December 2002 version of Apple's developer tools from the ADC site and install that, since that includes Project Builder. In my case, in order to get WebObjects to work I first uninstalled XCode, downloaded and installed the December 2002 developer tools, then reinstalled XCode. -
generated SQL
2004-05-27 18:16:41 rga218 [Reply | View]
Oh, and do note that to run WebObjects with Panther you need to upgrade WebObjects to at least at version 5.2.2 (and, according to Apple's Web Site, 5.2.3 is preferred). The evaluation version available at the ADC site is below 5.2.2, so once you install WebObjects you should probably run Software Update and immediately upgrade.
In fact, I suspect that immediately upgrading WebObjects may also install the required Project Builder frameworks too, sidestepping the whole rigamarole described above of having to download an old version of the developer tools.
The Apple web page for WebObjects 5.2.3 (who's URL is: <http://docs.info.apple.com/article.html?artnum=107873>) contains the following information:
"If you are creating a new Mac OS X WebObjects 5.2.3 development system, you should install the software in the following order:
Install Mac OS X 10.3
Update to Mac OS X 10.3.3
Xcode Developer tools CD
Xcode 1.1 Software Update
WebObjects 5.2 Developer
WebObjects 5.2.2 Developer
WebObjects 5.2.3 Developer"
Hope this is somewhat useful!
(By the way, congratulations to Adam Behringer. This article was incredibly interesting and well-written.)
-
Excellent Article!
2004-05-24 08:51:27 smountcastle [Reply | View]
Please keep them coming! These articles on WebObjects (and OpenBase) have been great and I've enjoyed playing around with them.
I only wish that there were longer term personal/non-commercial licenses for these tools (I know OpenBase has the Personal edition, but WebObjects only seems to have a 30 evaluation version).
Thanks again for the great content, I look forward to the next article in your series. -
Excellent Article!
2004-05-24 17:33:17 ABehringer [Reply | View]
Thank you for your comments. It is great to know that people are benefitting from these articles.
As far as the WebObjects license... It is it true that it expires after a short while, but you can get a fresh code from Apple each time it expires (in the download section of the ADC site). You really only need to fork over your money when you deploy or when you get tired of entering the evaluation code.
Remember that the full deployment license comes with OS X Server too! Therefor, you can develop without spending too much money and buy an xServe when you are ready to deploy. You will have to license the database too, but when you compare to the other solutions that are out there, its not a bad deal at all.






Thanks, again.