PatternCraft is a series of video tutorials that use StarCraft references to teach Design Patterns.
This video is the third in the series and covers the Command Pattern.
Other PatternCraft tutorials:
Mediator Pattern
Visitor Pattern
Memento Pattern
State Pattern
Strategy Pattern
Source is here: http://github.com/johnlindquist/johnlindquist.com/tree/master/CommandPatternDemo/src/
video player scrubbar doesn't seem to respond to touch events on Android
ReplyDeleteNice video as always John! Is there any performance benefit to using a callback function instead of an event listener or signal to notify CommandList of completed command?
ReplyDeleteI get why you'd need this in JAVA, but in AS3, why not just make a closure? It's basically the same thing anyway? e.g. commands.push(function(){scv.attack()})
ReplyDeletethanks thans thanks !... for a thousand years I´ve been looking for design pattern tutorials ... great idea make the analogy with starcraft 2 !
ReplyDeleteAs you said in the video, the ICommand interface is the most seen in the world. In Java, command framework is built-in. You have all you want (ICommand, ASynchronousCommand, Sequential, Concurrent, Queue, Undo, etc...), ready to go. In as3 you don't have nothing yet. I think Adobe must include basic pattern in the core of the langage. What do you think ?
ReplyDeleteGood question :)
ReplyDeleteIt's fairly common for Commands to have a few extra features like complete/cancel/undo/fault/etc. So you'll need a Class that wraps the closure and all the extra options you may need.
I haven't looked at the benchmarks recently, I think the answer to your questions depends on flash player version, OS, etc, etc. http://jacksondunstan.com/ is a great resource for those questions.
ReplyDeleteIf we start that discussion, I'd much rather have Adobe focus on introducing an IDisplayObject interface before we even start talking about pattern coverage :)
ReplyDeleteIt would be nice since you tagged this video with intelliJ , that you give us those shortcuts that you are using when developing.
ReplyDeleteAlso a video tutorial how to setup IntelliJ for Flex/AS3 development would be nice.
very nice!!!
ReplyDeleteJohn - this series is awesome. Probably the best demo of how to use design patterns I've ever seen. I can't wait for the next.
ReplyDeleteThanks, it's comments like yours that keep me motivated to crank these out :)
ReplyDeleteI've considered that, but decided it would be too distracting from the main goal of teaching patterns. It's way too easy to go off-topic.
ReplyDeleteI love this way to review the different patterns. I want to share with you this link. http://www.slashgear.com/university-of-florida-launches-starcraft-course-2799354/ You aren't the first guy using Starcraft 2 to teach. :) Thank you for this amazing videos/idea.
ReplyDeleteThanks for keeping these on-topic. I've cringed thinking you're about to launch into some fancy DI system or event/signal library, but you've kept it pure AS3 which has really helped with understanding the topic at hand rather than all the exotic features of various libraries and tools. Great videos; keep up the good work!
ReplyDeleteAwesome! Best Design Pattern series ever!
ReplyDeleteGreat tutorial, really easy to follow. Keep them coming!
ReplyDelete[...] PatternCraft – Command Pattern [...]
ReplyDeleteloves this video tutorial!
ReplyDelete[...] PatternCraft tutorials: Mediator Pattern Visitor Pattern Command Pattern State Pattern Strategy Pattern var flashvars = { width: "720", height: "586", autostart: "false", [...]
ReplyDelete[...] PatternCraft tutorials: Visitor Pattern Memento Pattern Command Pattern State Pattern Strategy Pattern var flashvars = { width: "720", height: "586", autostart: "false", [...]
ReplyDeleteVery nice! But it seems that you missed some ActionScript Class in the source code! Hope you will add them soon!
ReplyDelete[...] [...]
ReplyDelete