Blog

  • Cairngorm Responder Interface Change

    Doing some re-factoring today in a Flex 1.5 project, and realized a lot of our Commands & Delegates we’re implementing the Cairngorm’s Responder interface, but using vanilla (plain) Objects for the onResult and onFault functions. While that is the correct implementation of the interface, if you are using Remoting in Flex (RemoteObject, or even WebService / HTTPService), then that is technically correct, but not entirely accurate. Result events actually get mx.rpc.ResultEvent instances, and fault events get mx.rpc.FaultEvent.

    While doing:

    function onResult ( event : Object )
    
    function onFault ( event : Object )

    …is ok, the correct way is to do:

    function onResult ( event : mx.rpc.ResultEvent )
    
    function onFault ( fault : mx.rpc.FaultEvent )

    Doing this, however, will break the interface’s contract. What I did is fix the interface. Good news is, if your existing code base already uses event : Object, that’s ok; ResultEvent & FaultEvent extend Object, so compiler wise, you are technically fulfilling the interface’s contract.

    This is corrected in Cairngorm 2, although, the example casting in the comments is incorrect. While casting actually works in ActionScript 3, because of some frikin’ geniuses at Netscape (sarcastic) decided to keep backwards compatibility in a language spec (ECMA Script), you should really cast via “something as Class” vs. “Class ( something )” since the most commonly used client / server datatype, Array, cannot be used this way.

    Benefits of doing this in Flex 1.5 is using strict datatyping for ResultEvent and FaultEvent properties, and easier to port to Flex 2. If you don’t cast in Flex 2, it’ll cost you speed as the interpreter will have to downcast the result to ensure it’s truly an Object and do dynamic lookups of properties.

  • Need Creative Flash Animation

    A Chicago based interactive agency is in need of creative flash animators. Remote work only, non US residents welcomed. We have a variety of urban and rural landscapes, all 1000 x 523 that require ambient animations. We are looking for creative people that have an eye for adding creative polish to make them complete. We will provide a .FLA file with necessary artwork. We want you to bring the artwork to life in your own style. i.e adding birds flying across screen, street lamp flickering, etc.

    You will provide that same .FLA(source file) with finished animations before final payment is delivered. Code based animation is STRONGLY preferred.

    Compensation will not exceed $250 per animated asset, an initial payment will be made on good faith and full payment if animation work is accepted. Please submit samples of previous animation work for consideration. We have more than 60 assets to animate, so there is potential for you to grab a lot of work if you do a bang up job on your first couple of submissions.

    www.bepinc.com

    rafael@bepinc.com
    312.906.9361 x205

  • Invoices Suck

    Writing technical blog entries has the requirement of something relevant, can be digested in one or two readings, and is well thought out & proofread. I currently have tons of relevant stuff that can easily be digested by the community, but no time to collect my data & write them. I’ve been so overwhelmed with work, that taking the time, even with a gallivant into the South Caroline mountains to stave off burnout, has been hard to find. Thus, I figured I’d report on my current and past situations in an effort to provide corroboration for others in similar situations for the mere sake of relating, or going, “Damn, I’ve got it good.”

    I’ve been contracting with a new company for 3 weeks now, and have officially entered my first Enterprise project. I was under the impression I had in the past, but a few key ingredients were missing, namely more than 1 client developer, and a code-base older than 6 months. I’ve also met my first, successful purist developer, my boss. More on him later, but suffice it to say, he’s apparently successful and follows best coding practices at the same time which is the first time I’ve seen it actually in a real person. He enforces them with a heavy, but well tact hand upon my fellow developers, me included. This is a big deal because I always figured OOP, MVC, design patterns, coding & commenting standards, etc. were just ivory tower concepts that you attempted to implement to help stave off the insanity that software usually is.

    Yet, I’ve spent everyday for the past 3 weeks “cleaning” my code in some way, even if it’s no more than 30 seconds worth. I’ve done more re-factoring & encapsulation in the last 3 weeks than I’ve done in 4 months on most projects. My inference on the logic of such aggressive following of best practices, aside from what I’ve been told & discussed is that of confirming my own experiences. For example, it took me about 5 years to really feel like I knew wtf I was doing in regards to programming. Yeah, you always learn, but there comes a point when all of the stuff you’ve researched and learned finally reaches a point where you don’t hate your code at the end of the day… only after a year. That’s still a great improvement and wonderful pinnacle (plateau?) to reach. In that time, I’ve learned how valuable OOP, MVC, and Frameworks are to fighting off scope creep, reducing the amount of code you have to write, and making things easier to maintain over time. This has NOT been the case with code-formatting & naming standards, nor with commenting rules.

    Since the scope of Enterprise projects is soo much larger, my guess is… bigger Godzilla, bigger artillery.

    However, I’m still in like… month 3 of 5 years when it comes to managing business stuff. Take invoices for example. I still have 1 outstanding, and it’s taken me a month just to get 4 out of the door. And, #4 of 5 yesterday accidentally had a factor of 8 hour days instead of hourly on it… but I put hours on it. This was like almost 5k extra I was charging the client. Thirty minutes go by, and when doing something time related (I’ve been doing a crap-load of time tracking lately as well), I suddenly realized the invoice I did was based on a different time scale and immediately called the client, explained the error, and re-sent them a new one. Oops… what an f’n crackhead.

    In reading the Pragmmatic Programmer, and realizing every Flash Game programmer that is good uses emacs. As such, I’ve been trying my damndest to get lower level, to use command line and other automation tools that have been around forever. The goal is to further expedite my development and work to make me more efficient.

    …therefore, I’m wondering wtf people do for my invoices. I had a weeklong drama talking to my dad about secretaries, and what they entail, etc. He uses Quicken to do most of his paper work, but it didn’t do his service work sheets, so he’s actually buying a custom product to help run that + expenses + keep track of his service work.

    For me, it’s merely I did X in Y time, please pay this amount, thank you, your project was fun, hope it makes you bling, have a nice day all in Excel. Writing these things and keeping track of them as well as who I sent them too, and who sent a check is… well, it sucks. I’d rather be coding vs. running the mundane business details via Excel & Outlook. What do people usually use? The same method? Do they have a Administrative Assistant do it? Or, should I shut the $)%* up and bite the bullet?

  • FABridge: Flex AJAX Bridge

    Adobe has just released “FABridge”, the Flex AJAX Bridge on Adobe Labs which exposes Flex apps to the browser.

    This should also interest web developers if you want to utilize Flex 2 components / mini-apps in your AJAX & DHTML applications, have limited Flex/Flash resources on staff, and/or don’t feel like coding all of the bridge code… Adobe just coded it for you.

    Check it out.