Hassara - 2010-10-07

To start, I haven't used SourceForge in many years, so it may take me some time to get used to everything again.

This project was started as a method of allowing Mac developers to very easily create database-aware applications.

Normally, developers writing applications that use MySQL (or other databases, for that matter), must work with all kinds of strange function calls and methods to get their data.  No, it's not exceedingly complicated, but it could be much easier on the Mac.

Think about it for a minute.  To get a graphical interface up on the Mac and attach it to MySQL requires many lines of code to get the database connected and going, and each time you need to query, there's another set.  To get data on a graphical element requires data validation and Cocoa calls for the display.  To ensure the data aren't lost, you have to update the tables yourself.

For this project, a developer would drop a Database and DataSet connection onto the Document window in Interface Builder, set the links and values for the database (host, user, pass, and table), then drop the visual elements on the form.  Each visual element would link its DataSet back to the DataSet that's on the form.  That's it.

Need to tell the DataSet to write all the fields' data?  Just tell it.  It'll get the info from the UI elements and write it to the database for you.

Need to change to the next record in the data set?  Ok.  Just tell it to fetch the next line.

Need to jump to a specific record in a database?  Ok, just update the query.  It's just a matter of changing the SQL and telling the DataSet that it needs to open it.

The project is definitely in its infancy, but Here's what has been tested as working:

o The CocoaDbDatabase object will connect to any MySQL database, as long as you have the privileges and login info.
o The CocoaDbDataSet properly ties to the database, stores and opens the query, and informs all attached UI elements to refresh their views.
o I have 3 UI elements so far.  A single-line text box (NSTextField-derived), a multi-line text box, and a single-line static label.

So far, I have not uploaded any code to the project.  I will probably do that later, but right now, I'm changing too much.

How hard is it to get this all working?  It's very simple, actually.  You'd download the CocoaDbToolkit and extract it into your ~/Library/Frameworks folder.  Inside your project, set the "User Header Search Paths" to look for MySQL (mine is at /usr/local/mysql/include).  Add this framework to your project.  Done.

When you open Interface Builder, you'll see a "Cocoa Db Toolkit" entry in the library.  Inside that are the objects from this kit.

I'll update all this as we go and will put out a demo app to get things started (later).

-Hassara