Com.actionscription.blahbityblah
So, setting up a proper directory for all your AS3 code is an important first step in your project. If you do it wrong, you’ll be faced with the daunting task of updating each class to reflect any changes you make in your directory structure. So, through trial and error, I finally discovered the basics and universals in this type of organization. Here we go.
Proper directory structure allows easy code sharing and code reusability. Thus, you need to place your personally authored code in a directory that only you will ever use. This prevents naming conflicts later on if, for example, you import someone else’s code and they happen to have named a class the same as a class that is already in your project. Unique directory names ensures that the package is unique for each author’s classes, and therefore classes w/ the same name are easily distinguishable by their location in unique directories.
But what do I name it?
Because they are unique with only one owner each, domain names are the standard by which most developers name their directories. Generally, a developer reverses the domain name. If I owned actionscription.com, i would start my directory structure with a com folder, in which I would have an actionscription folder in which I would further organize my code with maybe data, utils, events, controllers, etc folders (whatever folders you want).
ex: com > actionscription > list of more folders
Now I know and knowing is half the battle. Check out GoToAndLearn’s video tutorial on setting up a custom class folder as your location for reusable code.
[...] treading further, consider my latest entry on this subject: Directory Structure 101. [...]
By: Project Organization « Actionscription on April 2, 2009
at 8:38 am