I’m compiling a collection of links to good Flash Programming articles, I’ll add some more details soon.
Explaining OOP without Mentioning Classes
I’m currently documenting a Flash project and whilst I was looking for precise definitions of Programming terms came across a definition of the Law of Demeter. This is (t)he fundamental notion is that a given object should assume as little as possible about the structure or properties of anything else… This is something I’ve been attempting to do without having a name for it for some time, i.e.. a Class should know as little as possible.
To quote again from this article a point pertinent to ActionScript: In particular, an object should avoid invoking methods of a member object returned by another method. For many modern object oriented languages that use a dot as field identifier, the law can be stated simply as “use only one dot”. That is, the code “a.b.Method()” breaks the law where “a.Method()” does not.
There is a good example explaining the Law of Demeter using Ruby see: Misunderstanding the Law of Demeter.
Tags: as2, AS3, flash, Law of Demeter, Programming