Episode 10: Anthony Franco – President of EffectiveUI

Posted in Drunk On Software on March 18th, 2009 by admin

admin originally posted this on Drunk on Software.

In this edition we chat with Anthony Franco, of EffectiveUI, about building high quality software.  Anthony shares about life at EffectiveUI and his thoughts on rich Internet applications.

Resources:

  • http://www.effectiveui.com/
  • Anthony’s Blog
  • And now for something completely different

    Posted in Jerry Andrews on March 13th, 2009 by admin

    My wife’s bluetooth headset uses a non-rechargable AAAA battery.  Right.  Where do you get AAAA batteries?

    Answer: ask the web; it knows everything.  And it says “inside a 9-volt battery”.
    I slipped a letter opener under the bottom edge of a new 9-volt battery where the metal meets the cardboard and lifted up a corner.  Then, with a pair of pliars, I peeled off the cover.  Here’s what I found:
    The batteries are held together with a bit of blue shrink-wrap, which I sliced off:
    Now they come apart like an accordian.  They’re held together with spot-welded straps.
    By gently pulling them apart, each battery came off with one or two bits of joining strip; gently pulling THAT off with a pair of pliers gave me 6 batteries and some scrap.
    After lightly filing off the sharp corner left by pulling off the welded strap, I had 6 AAAA batteries for about $2.
    :)

    Is Monkey Patching in Flex Evil?

    Posted in Jon Rose on March 13th, 2009 by jonr

    jonr originally posted this on Jon Rose's Blog.

    When googling for solutions to any number of Flex challenges, I commonly find posts that include monkey patching as part of the solution.  Monkey patching is basically replacing a Flex class with your own.  For example, if you want to change something in UIComponent you can create a mx.core.UIComponent in your project, and the Flex compiler will use your class instead of the frameworks class.  So, basically you take the source code from the framework and modify it to meet your needs.

    While it is interesting to have this option, its seems like a horrific idea to actually do this on a real enterprise project.  With this sort of solution upgrading the Flex SDK will be painful at best, and impossible at worst.  I think the only time I would ever do this is to get a bug fix into my code before it is available in a release, with the intent to throw away my class once the next release of the SDK is available.

    From all the posts out there, it does appear this is a common thing to do in the Flex community.  So, am I missing something here, or is this as evil of an approach as it seems?

    Flight Framework for Flex & What is so great about MVC?

    Posted in Jon Rose on March 8th, 2009 by jonr

    jonr originally posted this on Jon Rose's Blog.

    I just finished a write up for InfoQ on the Flight Framework. Flight compares themselves to Cairngorm, without all the “boiler-plate” code.  The association with Cairngorm is a turn off for me to seriously consider using Flight, as I still don’t understand what value Cairngorm provides (old post 1 & 2).  That doesn’t mean I don’t believe that Flight may have value, but in learning about the framework there seem to be the typical assumption that everyone is out there looking for the perfect MVC solution (old post 3).

    I lived through the countless MVC frameworks in Java.  So, I don’t believe it is naive when I ask, what is so great about MVC anyway?  We all love to work in code where the separation of concerns (SoC) have been adhered to, but do I need MVC to accomplish this in Flex?  I don’t believe I do…

    Anyway, back to Flight, they did allude to some additional features in the framework, like history management.   Although that specific feature is available in Flex 3, there maybe other features that make it useful.  The documentation is pretty slim right now - we will see what else is there when the docs evolve.  For me, I guess I want to see frameworks that do more than attempt to enforce a pattern.

    Flex Security Component Updates

    Posted in Jon Rose on March 5th, 2009 by jonr

    jonr originally posted this on Jon Rose's Blog.

    I have updated my Flex security component called Chimp.  I was working on implementing a suggestion to use the includeInLayout property instead of removing children, and found a number of issues in the process.  I have expanded the sample application to help test the component.  Also, it should give a pretty good picture of how the component works.

    Here is what has changed since the last post:

    • Replaced the “remove” action with “removeFromLayout” & “removeChild” actions
      • removeFromLayout: This property use the includeInLayout property to remove components from view.  This is preferred over the ‘removeChild’ action, but will not work in all cases (like TabNavigator tabs).
      • removeChild: This removes the child from the parent.
    • Update the component so it updates the view on any permission changes.  So, it no longer require that permissions are loaded and set before the Chimp is loaded.  The Chimp still needs to be added before the protected components are added because they are tracked with an event listener on the add to stage system event.

    Please let me know if anyone else has suggestions on how to improve the component…

    Styling Flexlib’s WindowShade

    Posted in Justin Shacklette on March 4th, 2009 by admin

    admin originally posted this on Saturnboy.

    A while back I started digging into the WindowShade component in Flexlib. I really needed a set of cool collapsable buckets for a project at work, and WindowShade was perfect for the task. Alas, I couldn’t find too much info on styling a WindowShade other than Doug McCune’s awesome example of WindowShade and Degrafa. So, here is how I went about achieving the look and feel I needed with WindowShade.

    Plain Vanilla

    I started with an unstyled, super vanilla WindowShade wrapping a List. And of course, I get this super-vanilla output:

    shade 1 (view source enabled)

    The only styling magic was to add padding="0" to the WindowShade to get the child List component to suck up to the bottom of the WindowShade button.

    My First Attempt

    In the next pass, I ditched the lame WindowShade button, and went with Flexlib’s CanvasButton, which contains a simple Label plus a CheckBox skinned with a plus or minus graphic. The code:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
            xmlns:mx="http://www.adobe.com/2006/mxml"
            xmlns:flexlibContainer="flexlib.containers.*"
            xmlns:flexlibControl="flexlib.controls.*"
            viewSourceURL="srcview/index.html">
     
        <mx:Script>
        <![CDATA[
            [Bindable]
            private var goodies:Array = [
                { header:'Ice Cream', items:['Vanilla', 'Chocolate', 'Strawberry', 'Cookies & Cream'] },
                { header:'Candy', items:['Twix', 'Snickers', 'Fire Balls', 'Hot Tamales', 'Mike & Ikes', 'Pez'] },
                { header:'Cookies', items:['Chewy Chips Ahoy', 'Mint Milano', 'Oreo', 'Nutter Butter', 'Fig Newtons'] }];
        ]]>
        </mx:Script>
     
        <mx:Style source="style.css" />
     
        <mx:VBox width="140" styleName="container">
            <mx:Repeater id="r" dataProvider="{goodies}">
                <flexlibContainer:WindowShade width="100%" styleName="shade"
                        data="{r.currentItem.header}"
                        opened="{r.currentIndex == 0}">
                    <flexlibContainer:headerRenderer>
                        <mx:Component>
                            <flexlibControl:CanvasButton width="100%" height="30" styleName="shadeBtn">
                                <mx:Script>
                                <![CDATA[
                                    import flexlib.containers.WindowShade;
                                ]]>
                                </mx:Script>
     
                                <mx:Label id="header" top="3" left="4" text="{WindowShade(parent).data}" styleName="shadeHead"/>
                                <mx:CheckBox id="chk" top="9" right="6" selected="{WindowShade(parent).opened}" styleName="shadeChk"/>
                            </flexlibControl:CanvasButton>
                        </mx:Component>
                    </flexlibContainer:headerRenderer>
     
                    <mx:List width="100%" dataProvider="{r.currentItem.items}" rowCount="{r.currentItem.items.length}" styleName="shadeList"/>
                </flexlibContainer:WindowShade>
            </mx:Repeater>
        </mx:VBox>
    </mx:Application>

    After throwing in some colors from a sweet Kuler theme and embedding Helvetica, we get this:

    shade 2 (view source enabled)

    At this point, I was really happy with look and feel, but there we still a few minor issues with the CanvasButton header that needed to be fixed before declaring victory.

    Fixups

    First, I needed the rollover event to flow down to the checkbox, so it would correctly show the overSkin on mouse over. Second, I wanted a color change on the Label on rollover to provide better visual feedback to the user. And lastly, I wanted the entire CanvasButton header to be clickable, not just the label text or the checkbox graphic.

    Focusing just on the modified CanvasButton code, used in the headerRendered:

    <flexlibControl:CanvasButton width="100%" height="30" styleName="shadeBtn"
            rollOver="header.setStyle('color', 0xffffff); chk.dispatchEvent(event);"
            rollOut="header.setStyle('color', 0xcccccc); chk.dispatchEvent(event);">
        <mx:Script>
        <![CDATA[
            import flexlib.containers.WindowShade;
        ]]>
        </mx:Script>
     
        <mx:Label id="header" top="3" left="4" text="{WindowShade(parent).data}" styleName="shadeHead"/>
        <mx:CheckBox id="chk" top="9" right="6" selected="{WindowShade(parent).opened}" styleName="shadeChk"/>
        <mx:Canvas width="100%" height="100%" backgroundColor="#000000" backgroundAlpha="0" />
    </flexlibControl:CanvasButton>

    The final result, a nice styled WindowShade:

    shade 3 (view source enabled)

    I used the parent CanvasButton’s rollover event to set the child Label color and forward the event to the child CheckBox. To make the entire button clickable, I used one of my favorite Flex UI hacks: I added a space-filling transparent Canvas.

    Comparison Shopping

    And finally, a side-by-side comparison of all three WindowShade skins:

    Flash is required. Get it here!

    George Bush Saved Social Security!

    Posted in Jon Rose on March 4th, 2009 by jonr

    jonr originally posted this on Jon Rose's Blog.

    It’s true!  At least to the same extent Mr. Bush is to blame for the current financial mess, and speaking as someone who is terrified by both of the extremes in American politics, he does deserve some of the blame.

    For those of us in our early 30’s, there is little cause to be concern for ourselves (even at this advanced stage of economic sickness in the country).  We must continue to work hard (or start for some), and hope for the best over the long-term.  Honestly, the only thing that troubles me about the current mess is that it has a high probability of affecting my parent’s ability to retire at a reasonable age.  This is the case for anyone over 50.  As much as this is troubling on a personal level, it likely means a stay of execution for social security.

    All the dooms day predictions of social security’s demise were based on all the boomers being able to leave the workforce in the very near term.  Now, that those timelines will be extended for many unfortunate folks it probably means that another poorly constructed government program will have a much longer lifespan than anticipated only a few short months ago…

    I do not believe anyone can predict what will happen in our economy in the next 6-12 months.  I think the only certainty at this point is that all of our old assumptions will have to be re-evaluated once we get our collective heads above water.

    Ruminations on Large-Scale Software Development 2009-03-03 11:15:00

    Posted in Jeff Johnson on March 3rd, 2009 by admin

    admin originally posted this on Ruminations on Large-Scale Software Development.

    Welcome to the first edition of Ruminations. Like my boss and close friend Stu Stern, I too am a creature from an earlier age (the 80’s). It was a simpler time, a happy time, where we young programmers (no one called us software engineers back then) cheerfully nestled in our darkened subterranean terminal rooms, feasting on Twinkies and Jolt Cola and clack-clack-clacking away on the 3.5” high keyboards of our workhorse VT100 terminals, blissfully without fear of the yet-to-be-discovered carpal tunnel syndrome.

    Bathed in the comforting glow of the 24x80 character monochrome display, we thanked God every day that unlike our forefathers, we no longer had to tediously keypunch each line of our program onto a separate card and submit the completed deck to the mainframe trolls for overnight processing before seeing the fruits of our labor – a thick stack of fanfold dot-matrix printouts.

    The sleek DEC VT100 terminal, c. 1978

    As with the developers of today, we lived in a period of rapidly accelerating technological change. However, through the years our collective commission hasn't changed. We’re still responsible for the Promethean task of combining a complex, usually ill-defined and ever-growing set of functional requirements with a truckload of inert iron & silicon into a living, breathing, working system capable of delivering value to the business.

    In this series, I’ll be sharing with you some of the core insights I’ve learned as an enterprise software developer, architect, manager and consultant. My intent is not to be preachy or pedantic, but rather to encourage (or at least amuse) those of you who may be new to the field. It is my firm belief, borne out of both my own experience and that of many of my current and former colleagues, that software development – even of enterprise software - can be one of the most creative, challenging, and downright fun professions on the planet. I hope you’ll allow me to share a little of that joy with you through these articles.

    Passing Parameters via JSF

    Posted in Bob Hedlund on March 2nd, 2009 by admin

    admin originally posted this on Eldorado Software.

    JSF allows us to cause updates to via various listeners: actionListseners, disclosureListeners, valueChangeListeners, and phaseListeners to name a few. Sometimes however, you may want to pass a parameter in to a generic method - perhaps to grab the value of an enumeration or access a users ability to view components based on Role.

    One little known feature of JSF is that you may access elements of a java.util.Map. This allows us to pass in a key to a map object in one of our contexts, and the map passes back the value pair via the get(Object) method.

    The notation in your jsf page would be:

    value="${yourContextHandle.mapObject['mapKey']}"

    where

    yourContextHandle is an object in one of the contexts you use to access backing code
    mapObject is a java.util.map that is available on the above object via getMapObject()
    mapKey is the parameter passed in to find the object from the map.



    In you backing code, generate an object that extends java.util.Map. You will need to implement quite a few methods, so I typically create a base object stub that handles the overriding of the methods beyond get(Object). In the below example, I call this MyBaseJSFMap. Then I extend this object and simply override get(Object);

    But how do you get the answer you need?

    Consider the following Map :


    public Class MyJSFMap extends MyBaseJSFMap{

    public Object get(Object o) {
    return doSomething((String)o);
    }

    public String doSomething(String str) {
    // your businessLogic here - perhaps a lookup to a database or a pull from a map.
    }
    }




    Component for Role Based Permissions in Flex

    Posted in Jon Rose on March 2nd, 2009 by jonr

    jonr originally posted this on Jon Rose's Blog.

    I’ve posted a simple component, called Chimp, for doing role based permissions in Flex through metadata.  You can check it out at: http://code.google.com/p/flexible-chimp/. The quick overview is that you provide Chimp the user’s roles on start-up and then add meta data to the components for filtering what the user can see.

    Here are the setup instructions:

    1) Download and add the chimp.swc to your project library
    2) Add compiler argument to keep necessary metadata:

    -locale en_US -keep-as3-metadata+=Protected

    3) Load the Chimp in your application. The Chimp must be loaded after role data is available, but before children are added:

    Chimp.load(perms);

    4) Add metadata to your Flex components:

    [Protected(permissions="ROLE_ADMIN",notInPermissionAction="remove",componentId="this")]
    [Protected(permissions="ROLE_UPDATE",inPermissionAction="enable",componentId="updateButton")]