Home > ActionScript > ActionScript 3.0 Design Patterns: Service or Product?

ActionScript 3.0 Design Patterns: Service or Product?

Gentle Reader: This is one of those posts that begs for comments. It is partially tongue-in-cheek, so don’t get overly excited. However, since we do both produce products and provide services using OOP and design patterns, I thought it worth a cursory glance.

I’ve been refactoring a movie player/message board originally developed following the Where’s Waldo School of programming. It tucks ActionScript 2.0 in the Timeline in multiple frames, buttons, movie clips and God knows where else. The reason it’s an interesting project is because of excellent graphic design that I’m trying to maintain. Anyway, it’s almost done, and I was wondering whether refactoring using ActionScript 3.0 design patterns is a service or product.

When Services Became Products

Reading about the current economic meltdown in The Economist and watching the economic experts on TV, a couple of things became clear: (1) The major financial institutions have no idea what assets they have, and (2) a lot of the problems were caused because the assets were “re-packaged” into other “products.” Things became so convoluted that people like Bernard Madoff were able to buy and sell nothing to the tune of $40 billion and the SEC didn’t have a clue even when presented with evidence of a Ponzi scheme.

In order to avoid a similar meltdown in OOP programming, I thought it would be a good idea to ignite a discussion about the work we do and differentiate services from products. To begin, I thought I’d start with a list of products and services that seem to be pretty clear:

Product | Service
External drive | Uninstalling Vista
Car | Washing car
Plum tree | Planting plum tree
Money | Doing tax returns
Computer game | Explaining how to win game


When it comes to design patterns, things are not quite as clear. If you build a house, you can easily point to building materials (wood, nails, cement, shingles) and services, getting all the permits required to build a house (meeting building codes, inspections). The guy hammering in nails is building a product and the gal doing the inspection is providing a service. Using design patterns, you don’t see anything in the product.

If I’m programming a video player, I’m creating a product. I may use a button or slider component (other products), but at the end of the day, I’ve got a product in the form of a video player that plays videos. In terms of whether the product is high or low quality is moot insofar as whether it’s a product or not. In the same way that a tree house build by kids or a house built by professionals is a product, a good or bad program is a product.

Refactoring: Creating a New Product or Servicing an Old One

At some level I’m convinced that if the financial institutions had used clearer language we wouldn’t have the problems we do now. Someone in marketing decided that customers would rather purchase a “product” than a “service” and started calling financial services, products. We shouldn’t make the same mistake.

In refactoring my current project, I’m doing everything I can so that the player has the same look. However, not even a single statement of the original player’s code is left. (All of the original code was consigned to the Eighth Circle of Hell along with the pimps, corrupt politicians, thieves, sowers of discord and Vista.) So, essentially I have a product that looks the same and has the same functionality but is wholly different inside. It glimmers with OOP and design pattern principles. However, when someone plays it, they cannot see a difference.

Where the real difference comes in will be when someone decides to update the player. It will be as easy as pie. They can change the videos, the content of the text that accompanies the different videos without having to touch the original code except in the Client whose requests have to be adjusted to reflect the new content. (Change in the old player would require demolition reminiscent of imploding a Las Vegas casino.) So in one sense the refactoring into design patterns and good OOP is a service to fix up an existing product. However, it can also be seen as a wholly new product because it behaves differently when it is updated.

I suppose it doesn’t matter whether you call refactoring a service or a product, but some thought the same thing of financial services—and none of us wants what happened to them happen to us. So, help save the world of ActionScript 3.0 OOP/Design Pattern computing and let’s hear your comments.

Share

No related posts.

Categories: ActionScript
  1. March 5, 2009 at 4:25 pm | #1

    This article made me think for a while. I came to a conclusion that OOP/DP is a service, not a product. It is true that the OOP/DP would eventually produce a product but thinking of it as a product can cause some misunderstanding as to why OOP/DP exists in the first place. I saw many people on rich media development field who think as3 = OOP without thinking much about what the real purpose of OOP/DP is, which, in my opinion, is to enable reusability and extensibility of the product.

  2. March 5, 2009 at 7:11 pm | #2

    Hi Christy,

    Good point, and I think you’re right on your observation about RIA developers thinking that AS3 equates to OOP. Another point came to mind, though– maybe OOP/DP is an art. We’re artists–just not graphic artists.

    Kindest regards,
    Bill

  3. Mark A.
    March 7, 2009 at 3:18 pm | #3

    Even if few (me included) find code architecture sometimes beautiful its everything but art – in my opinion. We do system architecture (even in smaller websites) and have to think analytically and abstractly when coding maintainable software. So its more scientific than artistic.

    What your overall topic is concerned I do see my work entirely as a service – and especially doing refactoring work of existing code.
    When I build a site, or just components – all this stuff is a service like doing corporate design or something. Fair enough – if you build a component to sell it solely on your website then I might call it a product – but for me as a person doing stuff like that I call it service.

  4. March 8, 2009 at 6:02 pm | #4

    Hi Mark,

    I was just marveling at the way that the Context class in the Strategy pattern works to bring out a set of algorithms from concrete strategies by being fully abstract. The art in design patterns is like the art in graphic art. I can probably work PhotoShop pretty well, but having no graphic artistic abilities, I cannot do art with it. It’s a technical tool to be sure (as is fresco, oil, water colors and other technical aspects of graphic art); so like programming, the art is in the creative application; not the technical aspects.

    We’ve all done it and have seen others do it with programming. It’s almost impossible to quantify; but we recognize it when we do or see it. Maybe it’s a Zen thing as well.

    Kindest regards,
    Bill

  1. March 6, 2009 at 9:54 am | #1

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>