In your experience, are patterns useful in small projects? You know, I've
been learning patterns through
"C#.NET Design Patterns" and so far, to me, patterns only useful in big
projects (in small ones, it might make
things overcomplicated). Correct me if I'm wrong, please.
Some patterns are only useful in big projects. But remember, patterns exist to solve problems -- some problems only occur in big applications, but some occur all the time.

Let's take a simple example that could occur in any size of project, especially a Flash one: you want a particular object to react to user input. But you want it to react differently depending on the program state. For instance, maybe the user clicks an Erase tool, then clicks a drawing area -- that's different from if he clicks a Brush tool.

One solution would be to write "if (tool == erase) { doSomething } else if (tool == brush) { doSomething Else }"... but you can see how that would turn your program into a horrible mess if each tool has complicated behavior.

Instead, look up the State pattern in your GOF book. See? A design pattern that can have many uses, both large and small.

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to