I’ve been working on a lot of Actionscript 3 projects lately and I wanted to try to stay away from using Flash.app for development. I came across Project Sprouts, a rake file that builds AS3 files and gives you trace outputs. Its been great so far and made my Flash development process much more enjoyable because I can still use TextMate.
The next thing I wanted to try and focus on in this project is the use of unit testing. However I’m having a really hard time finding the reason to spend time building the tests. I end up taking much more time writing the tests then I did writing the real code. I think the main problem here is that I’m not experienced in how to write unit tests so I waste time trying to think of how to write the tests. So I wrote tests for the first section of code I did on the project then I decided to hold off for the rest till I have more practice. This winter I plan on heavily practicing test driven development.
For my current project I’ve had to make a lot of lists that let you click on an item and have a detailed view. After working with the problem for a while I came up with a fairly simple pattern that I have used for all similar problems in the project. I have a List class that holds all the Item objects. The Item objects are the visual representation of the list item and also hold a value object of all data for that Item. Then I have a Viewer class that takes in a value object and displays that item with the other interface items.
I’m not sure if this is the best way to handle this problem but it seems to be working so far. I also wonder if there is a “real” design pattern that I could be using that would solve this problem.
