May 22, 2010
May 20, 2010

More on Cocoa Programming

I’ve spent a few days toying around with my HiveMinder application and learning a lot about Object Oriented (and Cocoa) design.

After a couple re-writes, I came up with three main objects for the application:

  • HMManager
  • Tasks
  • Task

HMManager is the interface between the application and the HiveMinder website. It handles authentication, sending requests, and receiving results.

Task is a basic task that holds all of the details about a task (title, description, due date, tags ,etc). Tasks is a collection of Task objects.

While putting all of this together, I started thinking about how much more simple the application would be if I didn’t have to work with data over the Internet. If it was a standalone application, I would only need the Task and Tasks objects. When a user edited a Task, the modifications and data persistence would be handled by Task. But since this application’s data model is on the Internet, it becomes a bit more complicated:

No Internet:

[task setDescription:@"This is a task"];
[task save];

(depending on if I used Core Data, I doubt I would even need the save method)

Internet:

[task setDescription:@"This is a task"];
[hmmanager saveTask:task];

Looks similar? It is, until I factor in that when a task is saved to HiveMinder, it replies back with the saved task. It would only be proper to replace the task object with the newly retrieved information (which could include updated dates, formatted text, etc) since HiveMinder is my authoritative source for data.

So what to do now? Should saveTask: return the new task object? Should it edit the task object in place so Tasks collection that holds the tasks memory location automatically sees the changes?

This got me thinking about the bigger picture of data stored on the Internet for centralized access. Should more work be done to make a better web front-end or better browsers to access this data? For example, I like using HiveMinder, but I would prefer to have it in its own small application window instead of in my main browser. Fluid is a good attempt at this. Or should people continue to create thick-applications that work with data over the Internet such as every iPhone app that connects to the Internet?

Coincidentally, this topic was recently discussed elsewhere:

On the specific question of native apps compared to web browsers, several investors said that’s looking at things too narrowly. If a company’s success depends on one over the other, it’s probably not a great investment.

“Five years from now this question wouldn’t be a relevant question because it’s going to shift again,” said the Foundry Group’s Brad Feld.

Brilliant.

May 19, 2010
May 10, 2010

Cocoa Programming

I’ve been teaching myself to program with Cocoa and Objective-C. I had tried to do this way back in 2002 soon after OS X Jaguar was released, but the concepts were completely over my head.

Eight years later, I have done enough programming in various languages that Cocoa and Objective-C don’t seem as obscure as they originally did — although I still feel that the learning curve is severely steep.

I started out with Stephen Kochan’s Programming in Objective-C 2.0. This is an absolutely awesome book and the LiveLessions videos are even better. There are other videos on the author’s site as well. I haven’t checked them out, but have no doubt that the quality is worth purchasing.

The next step was the standard in Cocoa learning, Cocoa Programming in Mac OS X. I was very, very hesitant on reading this book as the First Edition is what I tried using back in 2002. In the end, I decided to try the Third Edition and am glad I did. I’m not sure whether it was just my lack of programming skills or no knowledge of Objective-C during my first attempt, but on my second attempt at this book, I found it very easy and very informative. I was able to go through approximately five chapters a night (including Challenge exercises).

Once I finished that book, I was very eager to start my first project, so I jumped into writing a ToDo Application that interfaces with HiveMinder. While working on the project, I’m also reading Cocoa Design Patterns which seems like a decent book — definitely not as much of a learning tool as the other two books, but it’s a great supplement.

I’m very much enjoying my first project even though I’m just blindly working away with no real planning. I find myself removing whole blocks of code, moving blocks to new classes, and scouring the Cocoa Programming book for help. It’s all part of the learning process.

I have ideas for several other programs that I hope I get around to creating. It’s a nice change of pace from the standard System Administration that I normally do. While hacking away and debugging code all day long is not the most exciting thing in the world, the end result of an actual creation is very rewarding and something that I don’t find with Administration anymore (side note: up until I was about 17 years old I was heavily into programming with C and OpenGL but gave it up because I didn’t want to spend all day long looking into a text editor).

  • End note: While I did link three books to Amazon, I highly recommend subscribing to Safari. Google “Safari Coupon” until you find one for 20% off a monthly subscription — the price then comes out to be approximately the same price as one book from Amazon. So you can either order the three books above from Amazon, or pay for three months of Safari with access to thousands of books.
May 10, 2010
May 10, 2010

Night shifts do have their benefits: just watched the Canadian Apple Store come back online with iPad pre-orders and ordered one. Now I just have to wait 18 days for it.

Apr 30, 2010

orbus015 - July 25, 2001 - Tinley Park

The Orb - July 25, 2001 - Tinley Park, Area One Festival

Apr 30, 2010
Apr 23, 2010

Zaven - Imperial Dub Mix

My first proper mix in five or six years.

Apr 22, 2010
Navigate
« To the past Page 1 of 6