explorers’ club


Source Code for jwo_lib components have been added.
Friday, April 27, 2007, 3:34 am
Filed under: actionScript, components, development, flash, flex

Finally got around to getting my source code on my components uploaded. Below is a list of components:

You can find the project home page here. I will be updating the wiki later on.



Tips (and reckless behaviour) for Component Developers
Wednesday, April 25, 2007, 9:27 pm
Filed under: actionScript, components, development, flash, flex

Component Development (ComDev because I am lazy) is no walk in the park. Plenty of hard work goes into making a good, quality, and intuitive component. Though I have my occasional gripes about the Flex component set, I recognize that for the most part that the Flex framework and the component architecture is solid.

Since getting into ComDev, I have endured my fair share of trials and tribulations. As a result, below are some of my findings. Most of it is just common sense but there are a few things that work particularly well that you might not find except through trial and error. But before I start I’d like to highlight what I consider are the three most important things in ComDev.

Words of ComDev Wisdom:

  • Don’t try to reinvent the wheel - Though there may be plenty of ways to skin a cat, there are only a few that really work. Before even taking on this endeavor, you might consider asking yourself:
    • Is this really useful?
    • Is what I am adding/creating providing that much more value over a standard approach?
    • What are the costs/benefits?
    • Has it been done before?
    • and if so, how successful were those other attempts?
  • Go with the flow - Rather than forcing particular architectures/APIs/var names/method names inside your component, try to embrace those standards established by the Flex framework. I.e. if you are making a new type of ListBase component, consider using the name dataProvider on what most Flex developers would consider… well the damn dataProvider, rather than making up some new name for it.
  • Sometimes it takes frequent breaks and a second pair of eyes – If you find that a piece won’t fit, taking a break might help you realize that square peg won’t fit in the circle slot. Also having someone critique your logic and approach with a particular component will help you fine tune an intuitive API.

Tips:

  • AS3 Metatags – If you plan do any custom skinning, binding, event dispatching, etc. then you should familiarize yourself with the metatags and their functions. I’d highly recommend using the Flex framework’s metatag mechanisms as a model for your own implementations.For instance, if you were to want to make only certain string values available for a property in an MXML instance, you’d make use of enumeration property in the Style metatag. Also, anyone who has read my post on Flex’s built in Binding mechanism might want to implement their own custom event/binding trigger using the [Bindable] & [Event] metatags.
  • Learn the who, what, when, why & how - I am referring to the following functions:
    • updateDisplayList()
    • layoutChrome()
    • createChildren()
    • invalidateDisplayList()
    • invalidateProperties()
    • invalidateSize()
    • getExplicitOrMeasuredWidth()
    • getExplicitOrMeasuredHeight()
    • styleChanged()

    These are the primary players when it comes to all things be it skinning, child layout, instantiation, etc. To understand these is to understand the component as fully as possible.

  • Favor Inheritance over Composition – I am sure there is copious volumes on why to favor one over the other. I am not here to debate that. What I am here to say: In order to facilitate the ‘wiring’ necessary to plug in a child of a composition-based component, you’d most likely have to manually rewire the all the event and styling mechanisms. You also limit yourself to the public APIs of the children which means you can’t get at some of the key aforementioned methods.By using inhertiance, you now have access to both public and protected APIs, and you need only to override event and styling behavior that needs it. Of course for a more complex custom component this may not be possible. Not a decree, just a rule of thumb.
  • Favor ActionScript over MXML – Though this is personal preference, it should be noted that all of the mx classes are in ActionScript. And they are pretty damn stable. Though this limits some conveniences such as binding, you will probably have a much more stable component. In addition, you are less likely to run into erroneous ‘child out of bounds’ RTEs. Again, for complex layout type components, this might not be possible.
  • Be generous with comments – and add ASDoc comments as well.
  • Think long and hard about names for variables and functions - Have you ever asked yourself, “Why in the hell did they name that (enter name here)?!?”. Be kind to those who will be using your components. Don’t make them go on a rabbit chase to figure out what they need. That just gives them an excuse to use someone else’s component.
  • Be Grainular – This is one gripe I have about the mx class source files. Some of the methods span hundreds of lines. Anything over say 10-20 lines most likely needs to be broken down into separate functions.

Use with Reckless abandon (no really just use sparingly). I have used these a time or two to get the job done. They are not recommended but sometimes you gotta do what you gotta do:

  • Tap into the mx_internal namespace.
  • Make use of your own namespace.
  • For super.super needs, copy a parent’s source file and modify then extend (oh god… I think I might hurl….grrggg).
  • more to come…


new component: TileCanvas
Wednesday, April 18, 2007, 8:36 pm
Filed under: actionScript, components, development, flex

If you have ever seen the Flex Phone Store, then you may have been wowed by the nifty tile animation effects used to move, sort, and drag n’ drop its items.

I started recreating a more solid and reusable component-ized version of their ‘TileCanvas’. I don’t have any screenshots yet but you can play with it here.

There are plenty of bugs regarding some of the sorting and DnD stuff from other components. But in itself it works pretty good. I will be releasing the code and swc here shortly via Google Code.

Again, any feedback is appreciated.

[UPDATES]

  • 2007.04.19 – added TileCanvas to jwo_lib.swc. Download here.


Silverlight: Shock & Awe or Shake & Yawn
Wednesday, April 18, 2007, 7:04 pm
Filed under: Uncategorized

If you haven’t heard, Microsoft unveiled their new Silverlight product thingamajig at NAB in Las Vegas. Check it out these links:

I don’t know about you but I wasn’t all that impressed. What really irks me is that the videos will definitely lure in the Biz folks (you know, the folks we developers generally get our development requirements from). Then we will see yet another explosion of I-don’t-know-what-it-is-or-what-it-does-but-I-want-it requirements like we often see with Flex.
What I think is noteworthy is that Microsoft brings Silverlight to the table like its a major contender to the Flash platform. It might have a limited number of advantages over Adobe (one being that it will tap into the GPU instead of the CPU for certain visual operations, and I hope Adobe picks up on this) but can it really overcome Flash Player’s penetration stats and general appeal to designers and developers? Only time will tell.

It will be interesting to see how this takes off as I dislike monopolies and encourage healthy competition in a world of mergers, conglomerates and mega-corporations. I am certainly neither pro-Microsoft nor anti-Microsoft. Like everyone, I have my issues with their products. I also enjoy many of their products. But I really think this is one of many-to-come death throes from Microsoft as it finds itself struggling to reinvent itself in an emerging Web2.0-ish world. Many people are speculating on what is the next step for Microsoft in its current incarnation.

Maybe later if real genuine interest develops for Silverlight AND it presents itself as a major contender to the Flash platform, I might go get the SKD. But for now Flex and Flash are my babies.



Accessible HyperlinkText Component
Tuesday, April 17, 2007, 3:39 pm
Filed under: actionScript, components, flex

So as Flex rapidly corners the market in RIA development, we will start to see an increasing need to make accessible applications. Currently Flex has a formidable component set, much of which is accessible right out-of-the-box. But one thing they forgot to add was a multiline hyperlink-type component. Here are some screenshot links:

off.pngover.png

Here are some of its features:

  • text is completely styleable
  • button skins are styleable/skinnable (in the screenshots I am suppressing the default LinkButton skins)
  • accessible
  • lightweight

I uploaded the swc here: jwo_lib.swc.

Please provide some feedback as I made this in about 3 hrs and I am sure it has some deficiencies.



Flex vs. Ajax? Like Comparing Apples to Oranges.
Monday, April 9, 2007, 4:22 pm
Filed under: Uncategorized

You might remember this nay-sayer from my earlier post.  To sum it up, this guy was claiming that Flex was a failure due to its lack of built in controls such as an expandable button layout for mx:Panel among others.  Well a colleague pointed me to another posting by our nay-sayer and found some other related links.

What I don’t understand is the continual debate about Flex vs. Ajax.  Common complaints are that Flex doesn’t sync well with HTML type content.   What truly baffles me is that these folks don’t seem to truly understand the purposes of the technologies.  To complain that Flex doesn’t render HTML-ish content well is to complain that a wrench doesn’t work well when hammering nails.  Flex as a technology is not intended to do HTML as is HTML is not intended to do big RIA-type content.  Ajax can do some pretty nifty tricks, but to develop a huge RIA in Ajax seems very masochistic.   Again, with another analogy: A wrench doesn’t work well as a hammer, nor does a hammer work well in tightening bolts.  So not to be cliche but we are really comparing apples to oranges.

To end this debate, clients and developers alike need to embrace Flex for what it is: A RIA development tool.  If a requirement calls for heavy HTML based content and you are stuck scratching your head thinking, “why is this so hard”, maybe you should question the technology you are using or question the design.  Because it seems that one or the other is not the right fit for the end game.



…some more chaw to chew.
Friday, April 6, 2007, 6:09 pm
Filed under: contracting, development, flex

Well based on some initial feedback from some pals and a very encouraging comment by JesterXL, I thought I might go ahead and continue on with the whole contractor/consultant posting thing. Adding a few things that I had held back on or came up with in the shower this morning (where I do my best thinking). So this will be broken up into some categories with no order of importance. Check back because I will keep adding to it. Also if you have some I may have missed, please let me know.

Rebuttals
The best defense is a good offense and a good play book. ERs are salesfolk by nature and have a whole play book to go on when it comes to making offers and compromises. If you have ever bought a car, signed up for a gym membership, or sat through an Avon sales pitch, then you have seen em in action. Take the car salesman: “Justin, what is it gonna take to get you to purchase a car from us today?”. Even the straight-shooters use this tactic. The ill-prepared consumer will probably start off with “well…um..you..know…I…just don’t know….Honey? ..what do you think?….”. In the same way the car salesman can corner a consumer with this question, an ER can do it too. But in all honesty, its a fair question. No bs, straight for the jugular. Anyhow, to help ease the pain, I have compiled a list of some ER statements and then what I thought was the appropriate response if applicable.

  • “If you play the numbers game too long, you will lose in the long run.” - I just heard this yesterday. There is some truth to it. Just like gambling or the stock market, the house wins in the long run. This is generally brought up in a conversation when you say something to the effect of “if I can’t get the rates I am looking for, then I will look else where”. It could also be a response to your lack of interest in going perm with a client/employer. Again they have a req to fill and will try to get you in there. There is no great response to this as it is truthful but you are probably smart enough to know when to cash in your chips and look for the permanent gig.
  • “I have been doing this a long time and…..” – Another cliche statement. Generally followed by any combination of any of the other statements presented here. The fault in their logic is that with the ever growing capabilities of the internet savvy public, the evolving nature of the national AND global economies, and the nature of technology as a whole, things are changing and so with it goes the means to make money based on what you know. There really isn’t anything to say to this by itself. The only thing I could think of, and this is generally something I would say to somebody when they are rattling on about some shit I care nothing for…”Well that’s cool man” kinda in that Tommy Chong way.
  • “People recognize when contractors are jumping around chasing the money.” – No shit! I did not know this. Has it ever dawned on the ER that sometimes the contract was only for the time allotted? What about prototypes projects, do they extend indefinitely? Who is to say I am not chasing some of those missed opportunity costs? The other fault in their logic is that people are no longer ‘lifers’ at a company. Even the full-time types have something like 3-5 career changes in a lifetime. So I’d expect even more mobility in a contractor or consultant. Best response – “This is generally the nature of contracting especially in the web/IT biz”.
  • “Would you consider going perm after the contract ended (or after a certain time frame)?” – This is the equivalent of the car salesman asking you, “So you like the EX270?, wanna buy it?” before you have test driven the car. Generally the whole temp-perm is thing is like a probationary period. Even most full-time jobs in most industries have some sort of clause in there papers. Its called at-will-employment which I think all states have. But we have strayed from the main point. This question is a fair question, but it is asked at the wrong time. This question should be asked of you after you have worked some time on the contract. Best response – “I would consider it, but I cannot answer with any percentage of certainty or guarantee”. You could also add “…but in making a decision I would be sure to give you sufficient notice” just to be a nice guy.
  • “We’d like to push for more (most likely $) but we don’t want to bother if you are shopping around.” – This comes up generally when you are looking at extending a contract but aren’t sure if you will stick around. Another valid point. Why bother sticking their neck out for you to get, say a pay increase, if you are looking around. I will tell you why. Because it is the nature of the business and it goes back to being a mutually-profitable-relationship. Basically they want to be able to save face. Images are important and having client-agency talks about the kind of dough to shell out for you is a touchy subject. But again, that is why they are in this business. Best resposne – “If I were to get a suitable increase in (whatever) then I would stay around for the length of the extension”. But then you gotta make sure to honor your obligations too.
  • “What kind of salary equivalent would you consider?” - This is really only asked if you are one to consider temp-perm opps or a perm opp. The hard thing to swallow on both ends is that generally salaried positions pay quite a bit less. Why, well because the company is generally paying for govt. crap for taxes and social(ist)-security. Also they might be offering health care, 401K, options, etc. Those are all well and good but do some math real quick. Generally you will have a rep agency right? Ok so then most likely you are working as W2 where they are handling your taxes and SS or as a 1099 you will be. So that doesn’t count. As a contractor you might be able to get your own health care or possibly sign onto your spouse’s. But let’s say you pay out of pocket for it. Let’s give an outrageous figure like COBRA stuff – $500 out-of-pocket for some decent health care. You can invest only up to certain caps on 401K’s (correct me if I am wrong) and that will be applicable to your employer’s matching. Besides a rep agency might have that for too. But let’s say you get some wild number like $10K/yr w/ employer matching on the 401K. So let’s see 500 * 12 = 6000 + 10000 = $16000/yr you have to pay out-of-pocket to match up with some of their offerings. Let’s do some more math now. Say you have been offered $80K/yr for a full-time gig. And let’s say you can get at least $70/hr to do the same shit for 2 consecutive contract terms. The contracting is gonna be about $140K/yr. So now start subtracting what you pay out of pocket. You are still making $124K/yr doing the contract. So how do they explain the $40K gap? Stability? Oh please… They’d be the first to tell you there are no guarantees in life if you were to ask about the likelihood of stability as an employee there. Best response – “I’d be looking for something comparable to my hourly rates.” or better yet for the term-perm folks, “I wouldn’t be able to answer that until I decided that I would be interested in a permanent opportunity.”


Some tips for Consultants & Contractors
Thursday, April 5, 2007, 10:33 pm
Filed under: contracting, development

If you are like me, a Flex/RIA contractor or consultant, and have recently updated your resume and posted to the job sites, then you have probably been inundated with calls and emails from flex-hungry recruiters and employers. There is a huge demand and a very small supply of Flex developers out there. Thus, the Flex-Mania…

That’s good right? Right. But when our skill sets are in high demand, sometimes we become so elated and wrapped up in the fact that we are getting all this attention that we forget some basic questions and concerns when considering a potential opportunity. So here are some tips to use and remember during your job-screening process. Oh, one more thing. Hereinafter all references to Employers/Recruiters will be ER:

  • Keep a journal/log of all conversations with ERs. It is very easy to forget things right after you talk about them. Everyone has heard this, “..nice to meet you. My name is Justin” and then 30 seconds later, you have forgotten the person’s name. So as good as you think your Ginko-Biloba filled memory is, it isn’t that good. Better yet, try taping your conversation. Just make sure to tell the ER that you are doing so.
  • Screen you calls. Recently I just started putting the same disclaimer and link on all the job boards that have my resume: “For information about my employment status/goals and links to my resume please visit….”. This will help you weed out those who are just blanket mailing anybody who matches, “flex, flash, developer” on Moster.com.
  • Don’t waste your time but also take your time (huh?). Time is your most precious commodity. You can waste money and make more, spill milk and buy more, but you can’t make up for lost time. In that same line of thinking, definitely take your time when making decisions. Never rush into something without knowing as much as you can about it. Also don’t waste their time
  • Discuss your expectations up front. I don’t know how many calls I have fielded where because I failed to establish what defines my accepted criteria for consideration up front, I ended up getting guilted into hearing/seeing about something that doesn’t meet those expectations. Not doing so just wastes their time and yours. Tell em what you are looking for.
  • Keep sniffing. What I am about to say might get me on some ER blacklist but oh well. When you are talking to a recruiter, you are talking to a salesman. Their job is to sell you to the client and to sell the requirement to you. You might get the straight-talkin’ no bullshit type or you may get a real slick ass clown who will try to sell you some waterfront property in Arizona. The only way to weed through this is to either possess or acquire a highly attuned sensitivity to bullshit. Of course this is common sense really. If someone tells you what everyone wants to hear, like its the coolest place and the people are great and you will love it, then you should be catching a whiff of something.
  • Don’t deal with the pushy types. There are plenty of the straight-shooters out there to not have to deal with the pushers. I got a whole list of cool ERs that I have dealt with. Being pushy means A) they are desparate B) they are not listening to your needs C) they are only interested in how to fill the req to make their commission or D) all of the above. In this line of thinking make sure you…
  • Assert yourself. Now this is starting to sound like an Anthony Robbins self help tape. Be honest and forward. Don’t be a Milton from Office Space. People respect folks with gumption and a backbone. They don’t respect Miltons. What a schmoe!
  • Burn a bridge or two. Yes I just said it. There is more than one way to cross a river. This is an overrated cliche. I hate it. I don’t advocate going and pissing off your current or previous employers or telling a recruiter to go to hell. That is not what I am saying at all. What I am saying is do what is right for you first. This is a business, not a relationship (yet). If you end up trying to appease some ER because you have gone on a few interviews and expressed a great deal of interest, backed out at the last moment, and then had a heart-to-heart with the ER to get you back in, you will most likely be unhappy with the decision. Then you were guilted into choosing it because someone said some touchy-feely cliche shit to get you to agree to sign on. Anyone who has done the job hunting game (ERs are employees too) will respect and understand that you gotta do what is right for you first. Also any sane ER will not take it personally and see that you are highly marketable and want to try harder to find the right fit for you. Plus the good ones will still be around the next time you are polishing up your resume and the bad ones…. just do some research for recruiting agency turnover rates.
  • Keep you ego in check. Just because it is Flex-Mania doesn’t mean that the tides can’t change. Plus today’s bad ass technology can easily be tomorrow’s Atari. Having an ego is not bad, but having a know-it-all attitude and an ego is. You can always learn something from someone or something.. There is always somebody bigger, badder, smarter, faster, fitter, etc. etc. etc. than you. Be humble but don’t low-ball yourself either. Know when to hold em and know when to fold em and know when to walk away.
  • Learn the art of negotiation. No need for further explanation. Plenty of books out there on this topic.

And now for what I consider some very specific things you need to know when talking about a possible job opp. These are topics that should be address before you ever agree to sign onto the job. They are also very reasonable request that if met with any resistance, should be a red flag.

  • Opportunity Costs. I think this is the most important thing to consider. No one seems to really think about this anymore. Today’s mindset of instant gratification has led our thought processes away from considering the costs involved with making one choice over another. These are not merely monetary costs, but the time, the experience, the possibility to learn, the future choices presented from making one choice over another. I recently turned down a well paying contract because the opportunity costs were just too high. I didn’t want to work in ActionScript 2.0 and Flash 8 because then I was stepping away from being able to forge new ground in the world of Flex development. I may have been making a butt-load of money but I wouldn’t be learning new things on a daily basis about a current technology. Instead I would be working on older technology not learning a whole lot about it. That is not to say I wouldn’t have learned new things, but I felt the risk was too high. Taking 3 months to step away from the battlefield makes it harder to return ready to fight.
  • Assess the non-monetary benefits. This is probably the second most important point in my decision making process. I am not talking about health, dental, 401, etc. Besides those are mainly full-time employment perks. I am saying to look at what you could learn from the opportunity. I always wanted to learn technology A and now I have chance to work in it. Also think about who you are working with. Always strive to work with people smarter than you are. Because then you are learning from them. Of course this means engaging them in conversation. This is why I chose the current contract I am on (sorta). During my in-person interview, these guys actually gave me some development tests and then presented better solutions to my answers. This was not a formal test but more like, “I want to do A, how would you approach this”. If someone gives you a MENSA-like brain teaser in the interview, then you know you are probably dealing with some pretty sharp tacks. Another thing to consider is how the opportunity will progress over time. Do you have a chance to check out other projects or are you going to be doing the same thing every day on the same project for the next 6 months. Some folks like change, some do not.
  • Meet the folks you will be working with in person and visit the location. Work environment is a major factor for me. Am I working with complete idiots, am I looking at a wall in a basement like Milton, am I working in a sweat shop? What about logistics? What is the commute time, the neighborhoods near the job, life style effectors after you go home from work. None of these things can be truly be put into context of your expectations until you have seen and met the place and people. This is even more important if you are considering a job that requires relocation.
  • Ask to see and interact with the project in question. You should be able to see some screenshots or designs at the very least, if not be able to interact with some workable model. Also ask about getting some coding samples, certainly they would ask freely of you. If you might be working with Mr. No-Comments-Spaghetti-Code for the next 6 months, you may think twice about the job opp. Keep in mind you may need to offer to sign a NDA. If someone puts up a stink about this, then you are catching a whiff of… *sniff *sniff… poo.
  • Discuss your rates. No kidding. You wouldn’t agree to buy a car before knowing a final price so why do so for a contract. And if the ER you are talking to says things like, “these people are willing to pay what you are worth.”, “is money the most important thing?”, “it is a little premature to be discussing this at this stage in the game”, well then yes folks, you are smelling the cow pasture real good. The answer to their questioning goes back to time being a commodity. Why waste time interviewing (possibly taking time off from your current engagement) if you can determine if it fits your rate criteria? If you are contracting then most likely money makes the top 3 list for why you are a contractor.You: “I am looking for rates between $x and $y.”
    ER: “They are looking for at most $<x.”
    You: “I’d need to think this through since I have other opps I am considering that are more within my range, I will get back to you.”Or you could say, no thanks. Then you have spent little time in determining that an opportunity meets/doesn’t meet your criteria. There is no shame in saying it. Don’t let anyone make you feel guilty about it either.
  • ONE LAST THOUGHT…. My buddy Colm (who happens to be one straight-talkin’ recruiter and a helluva guitar player) was giving me some advice one day. He gave me this nugget of wisdom and told me to chew on it for a bit: Mutually Profitable Relationship. That is exactly what being employed is. It is a mutually profitable relationship. This is especially true when you are dealing with recruiters. You get paid and generally, they get a cut. You make money, they make money, you make more money, then they make more money. So it behooves (grammar check anybody?) them to go to bat for you. At some point, the interview process turns from being a business engagement to being a relationship. This is where you have to decide what kind of relationship it is and if you wish to continue it.

Anyway, I hope you can learn from some of the things I have experienced. I have dealt with many ERs Even those ERs I have turned offers down from I have a good relationship with because they are the straight-shooters and so am I. If you like, submit a request and I can give some recommendations. Keep in mind I am in Boston, so I most likely won’t know about ABC recruiters in Columbus, Ohio. And of course, post your thoughts, hate mail and death threats here.

[EDIT 2007.04.06]
Added Part 2



LinkTitlePod
Tuesday, April 3, 2007, 5:41 pm
Filed under: actionScript, components, development, flex

So I wanted to upload some pics of my new LinkTitlePod which is just an extension of my Pod class (which is a Panel subclass). The cool thing about the Pod classes is that you can add anything you want to the titleBar area. Of course there is some work to be done right now in terms of sizing but I will tackle that a little later on.

So LinkTitlePod is basically a pod but the title area is interactive. Also you can style it however you want. The one pictured here is just using the basic MX skins.

Also you can find the source for these guys here.
pod
linkTitlePod

LinkTitlePod w/ cursor over TitleLinkTitlePod w/ cursor over added buttonLinkTitlePod w/ cursor over added ComboBox



For those w/ OCD…
Monday, April 2, 2007, 5:16 pm
Filed under: development, flex

One of the many cool things about Flex is the ability to rapidly develop and deploy complex prototypes. One of my many hindrances is that I obsess over minute details, which in rapid prototype development can make or break the success of the project and/or deadlines.

If you have ever heard the term:

Perfect is the Enemy of Good.

then you OCD types might try using this one when you catch yourself obsessing over less-priority details during your development:

Perfect is the Enemy of Progress.

Kudos to my buddy Jason for sharing this little nugget of wisdom.