Thoughts Framework Flex FlashLib August 20, 2009

An Army of Small Libraries

Ted Patrick, known on twitter as @adobeted, recently released two interesting as3 libraries: FDOT and Tubes. This is not unique to Ted. People constantly develop amazing solutions to common problems. The problem is that it is hard to find these solutions. Unless the developer already has a large following, his code usually dies in obscurity. Someone facing a common problem will either develop their own solution, or find a stale solution on google. Ted has been proposing that someone create a standard as3 library. I would like to recommend an alternative.

Update - I’ve begun work on this at flashlib.org

Update - I’ve listed the planned features and made a FAQ page

The Standard Library

As far as I understand, Ted means someone should create one swc file containing many classes to solve a wide variety of problems. The advantages of this approach are that people can download the library and use the best solutions available without having to hunt around.

There are several disadvantages, though.

  1. The library will grow stale because the maintainers don’t have an infinite amount of time to check out new stuff. It will have momentum at first, but will become less relevant over time.

  2. Many good ideas will not be included. The library can only include robust solutions, preventing one person from beginning something and another finishing it. Someone unknown may have a good solution that never gets in because it doesn’t quite meet standards.

A Better Approach

The monolithic library is a temptation that should be avoided. A better approach is to keep libraries focused and small. This makes it easier to mix and match solutions to exactly fit your project’s needs.

However, we still need a way to find these small solutions. I propose a community site dedicated to finding good libraries and classes. At first glance, I think it should have the following features.

  1. Links to projects rather than hosting them

  2. List of alternative projects

  3. Ratings and comments

  4. Community editable project pages

  5. Reputation System

This will solve the same problems without the disadvantages. With a democratic approach, the very best will naturally rise to the top, people can extend each other’s work, and the authors don’t even need to directly participate for it to be effective.

If this idea gains enough steam, I volunteer to create the site. What do you think? What other features should it have?


I agree, but I think sites like GitHub provide this as well as a remote for source management.

My Ruby cohorts rave about how community-focused the RoR community is in general and how GitHub has facilitated this in many ways. I've really appreciated this, and as a primarily AS3 dev, I'm using the site to find and publish open-source libraries. I hope to see more AS3 projects on there.

My public repos are here: http://github.com/lukesh/

I'm not opposed to a site like this... however what you propose sounds very familiar to RIAforge.org and OSFlash.org. Couldn't we just extend those sites with your proposed features which already have a large collection of libraries and projects?

Am I missing something?

@Francis - Ideally this would integrate with GitHub, not replace it. I LOVE GitHub, but it is missing some of the key features I outlined, so it isn't complete by itself.

@Nate - We could definitely extend an existing site. This would require a major overhaul of either of those, however, so I'm not sure the maintainers would be up to it. RIAForge, I believe, only hosts projects, meaning that it will miss many of them. OSFlash focuses on large-scale frameworks. I want to encourage small, focused solutions to problems. (Like finding the very best StringUtils class)

Good post! And I also agree with Francis, GitHub is a good place for this. They already host over 60 ActionScript projects. I've just started an AS3 library for the SoundCloud API there: http://github.com/dasflash/Soundcloud-AS3-API/

Github doesn't have a rating system but you can judge the quality of each project by the number of its followers.

What about something similar to Tour De Flex for libraries? With an AIR app like that you could also manage the libraries you're currently using and discover new ones without having to go to disparate places to download or dig through SVN.

@Dorian - What about people who aren't comfortable with git?

@Steve - That is an awesome idea. It could include full usage examples too. Nice!

Great post and I agree...to really make this work they have to be small similiar to what senocular did http://www.senocular.com/flash/actionscript.php

I think it would be very useful. Then you can include projects from GitHub, Google Code, and personal websites. It would be a community driven code search and rating site. (let me know if you need help, might be fun to do it on GAE)

Sean, I am really leaning towards dynamic assembly of a Standard Library from distributed repositories.

I posted a screen shot of FPG, you just type names and it downloads from many sources (gcode, github, osflash, sourcefrg ) via a managed index/directory of libs. Instead of one mainline, you can quickly assemble libs from all over.

There are issues with it:
1. Metadata format for index
2. Cross-site Scripting injection
3. name management
4. package collisions
5. dependencies to other libs

This solution is very similar to what I built in IFBIN years ago but is simpler.

Would love to get your thoughts on these issues. Great post.

Cheers,

Ted :)

What if there was a simple tool to download indexed swcs for you automatically? So, it wouldn't compile multiple sources down into one swc, but would use the site's data to pull down the compiled swcs from the authors' sites (or a cached copy on our site).

Package collisions are an issue, but some guidelines and downrating for poorly packaged frameworks could be enough to encourage people to use unique packages.

As for dependencies, Library Projects can reference other swcs. They get compiled into the final swc. If someone were to then include the dependency in their project again, it still works (although I'm not sure how). Obviously the derivative libraries are large if each one includes all of its dependencies, but I don't think the compiler puts multiple copies of the code into the final swf, does it?


I feel your pain as well, and have made steps to build a centralized, searchable package system that ensures that the latest libraries are delivered in a ready-to-use system.

http://toolbox.protohq.com/underware

Would love to get some feedback on how it might be of help in solving this issue.

I also think multiple, independent SWCs is the way to go. Jeffery's solution seems like it is almost ideal in its current state. One thing it needs, besides a comment and rating system wrapped around it, is the ability for someone (likely the project authors) to specify where the automatic build comes from. Since some projects work from the trunk and some work from branches, the stable code isn't always in the same place.

Very cool Jeffery. Right, so an automatic distribution system of some kind like that would be awesome. Maybe you could save your favorite sets and download them later too.

I'm not sure I agree with what I'm getting in the zip though. It's a fla and some actionscript. I was thinking people would download precompiled library projects. It's been way too long since I've used flash, it uses swcs too, right?

@Ben, The project's properties would be editable by whoever posted it (usually the author) or anyone who has a high enough reputation. I want to make sure project owners don't need to be involved.

Also, just to be clear. I'm heavily leaning towards a site that just links to projects, but doesn't lock them in to svn or git or any particular way of announcing or distributing the code.

That way, we can index every project in existence and the site could become a one-stop shop for solutions.

Yeah, trying to figure out the most holistic approach to handling the packaging. Packaging options in V2.

The .swc idea is awesome and analogous to the current .zip format.

Would need to figure out how to compile an .swf of a package to include it in the .swc. Will give it some thought.

Sounds like you need a code wiki.

start with one namespace, and have "stable versions" of classes and packages, under which various revisions get voted on to be merged with the "official" trunk.

It's coming ... http://flashlib.org

Your comment was added successfully
Your comment could not be added

Leave a comment