I've been interested to start using the Null Object / Option Type approach for replacing my old habits of null-checking multiple parts of my code. But, from the many examples I saw out there, it seems it's a pattern used in conjunction with generics.Great for C#, Java, Haxe and a bunch of others I'm sure.NOT so great for ActionScript 3.0 (which is what I was intending to use it for).So, am I under the wrong impression that this won't be possible / worthwhile in a language that doesn't support Generics? Or is there a way to pull it off without them?NOTE: It seems the Null Object pattern shown in this PatternCraft tutorial doesn't quite resemble the way Option Type was described in some of the other discussions in this stackexchange site. His way looks more like a factory class that spits out a Null??? derivative of some base-class. I was hoping there could be a way to create Null-Objects without needing to write a dedicated class for every single case scenarios where a null-check would typically be used.EDIT: My apologies, I didn't realize Null Object and Option Type were two completely different beasts. For the sake of keeping the answers and feedback relevant to the question though, I only changed the title (was originally How to use Null Object / Option Type Pattern in a language that doesn't support generics?).
How to use Option Type Pattern in a language that doesn't support generics?
design patterns;generics;null;actionscript