Thursday, January 27, 2011

Observer Design Pattern in Flex

Nice post here. A little ivory tower-ish, but interesting all the same.

Basically says, for the intents and purposes of those of us who actually do the coding, the Events system in Flex is the built-in Observer pattern.

We need to use more Observer-based custom components in Flex. Especially since Flex expects us to do so. I'm halfway through a pretty nice project right now, and I regret not taking the time to make my custom components. Instead, everything is now in 1 application MXML with custom components that are "1 level deep" if you get my meaning. I used to have the notion that, if code isn't sharable, then I can refactor that into a custom component later; let me just get it working first. 

I think now that even if code isn't sharable, I still need to create a new custom component. I need to dare to go deeper than "1 deep". For my sanity's sake.

Thursday, January 20, 2011

Note to self: Actionscript Strings are not Java Strings!

var s1: String = "gerard";
var s2: String = "gerard"; (s1 == s2).toString() );

In Actionscript the above displays true. Apparently there is a built in string comparison operator in Flash that compares the content, instead of the object references themselves.

This is actually intuitive. If I give anyone on the street 2 identical Bibles, and ask them "are they the same?", they would say "yes". Java devs will tell you their content is the same, but they are in fact 2 different instances of the books. 

I wonder what else is Java programming doing to my brain...

Wednesday, January 5, 2011

Installing iOS SDK

Here are the steps I took to install the iOS SDK.

  1. Checked my OS X version: I had 10.5 (Leopard)
  2. Found my Snow Leopard DVD
  3. Upgraded Leopard to Snow Leopard. I should have done this a long time ago.
  4. From the same Snow Leopard DVD, I installed Xcode 3.2
  5. Run Xcode
  6. Realized that the Xcode in the DVD did not include the iOS SDK
  7. Made angry noises
  8. Downloaded the iOS SDK. The version 4.2 is about 3GB. It includes Xcode 3.2.5, and the OS X SDK as well.
  9. Installed Xcode, iOS SDK, OS X SDK et al
  10. Realized the iOS SDK will take up more than 8GB on my Macbook
  11. Made incredulous noises
  12. After installation, I ran Xcode, and created a new project. And yes, I was able to create an iOS application.