The
Ultimate
Business Machine

Technology, business
and innovation.

And, not least, about
the Mac.

Weblog Archive Cutedge

by: Bernard Teo






Latest Joy of Tech!

Joy of Tech ... from Geek Culture



Creative Commons License

Copyright © 2003-2012
Bernard Teo
Some Rights Reserved.

The Ultimate Business Machine - Archives

List of Categories : Commentary * Database * Singapore * Technology * Travel *

Tue 28 Dec 2004

Doing Cocoa Bindings in Java

Category : Technology

We've found a way to stop our Java-Cocoa demo of Cocoa Bindings from crashing - comment out the call to "super.windowControllerDidLoadNib". Of course, why this should be so remains a mystery, since "[super windowControllerDidLoadNib:aController]" works okay on the Objective-C side?

But, with this out of the way (for the moment), I've converted the project we use for our Java-Cocoa course to Cocoa Bindings :

What does this show?

One, there are places in the framework where you can step in and make a call to an existing database. The resulting data will get picked up by the Table View.

Then, Cocoa Bindings takes over to synchronise the display of the detail view with the table view. This is where we save a lot of writing of Controller-type code. All the notification-related code can disappear. In fact, some of the things handled automatically by Cocoa Bindings work better than the code we write.

Then, at the end of the cycle, we should be able to find a convenient place to push the changes back to the database.

The things left are to figure out how and when to do data validation, how to open the detail window by double-clicking on a selection in the table view, and how to have more than one detail window open (because it's possible that a user may want to compare two detail records side by side). Also, I still don't yet know how to do handle check-boxes (though I've just had an idea).

In summary, this is seriously useful technology, though quite a few kinks remain. I keep watching out for when I'm going to fall off the deep end.

Database access is so good on the Java side - we have an embarrassment of riches using JDBC to connect to a wide range of databases, remotely as well as locally. The down-side is that you get more problems using Java with Cocoa than with Objective-C. But then, there is none of the database capability we've come to expect on the Objective-C side (though Tiger promises to correct this - but is the database access there only going to be single-user/single-machine, and only via SQLite?).

This situation is so typically Apple. Simultaneously brilliant and clue-less - like a well-loved idiot savant.

Posted at 12:14AM SGT | permalink


Mac@Work
Put your Mac to Work

Sivasothi.com? Now how would you do something like that?

Weblogs. Download and start a weblog of your own.

A Mac Business Toolbox
A survey of the possibilities

A Business Scenario
How we could use Macs in businesses

VPN Enabler for Mavericks

MailServe for Mavericks

DNS Enabler for Mavericks

DNS Agent for Mavericks

WebMon for Mavericks

Luca for Mavericks

Liya for Mountain Lion & Mavericks

Postfix Enabler for Tiger and Panther

Sendmail Enabler for Jaguar

Services running on this server, a Mac Mini running Mac OS X 10.9.2 Mavericks:

  • Apache 2 Web Server
  • Postfix Mail Server
  • Dovecot IMAP Server
  • Fetchmail
  • SpamBayes Spam Filter
  • Procmail
  • BIND DNS Server
  • DNS Agent
  • WebDAV Server
  • VPN Server
  • PHP-based weblog
  • MySQL database
  • PostgreSQL database

all set up using MailServe, WebMon, DNS Enabler, DNS Agent, VPN Enabler, Liya and our SQL installers, all on Mavericks.