| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Obfuscated Coder
Join Date: Apr 2008
Posts: 681
|
http://en.wikipedia.org/wiki/Polterg...mputer_science)
Correct me if I'm mistaken, but isn't this anti-pattern article describing the very practice of Event Dispatching that is inherent in AS3? I thought this article looked fishy even before I got into AS3 (and before the warning markers at the top happened to appear), but didn't really know why.
__________________
man.mask = mask_mc; Sigh. The AS3 version just doesn't look at nice as 'man.setMask(mask_mc);' |
|
|
|
|
|
#2 | |
|
as[org].addListener(this)
Join Date: Dec 2005
Location: LA, California
Posts: 838
|
Quote:
Event dispatching isn't an antipattern, it's pretty closely tied to the observer pattern, which is a very commonly used pattern in OOP architecture. |
|
|
|
|
|
|
|
|
|
#3 |
|
Obfuscated Coder
Join Date: Apr 2008
Posts: 681
|
Oh, I'm aware that the event model in AS3 is related to the Observer pattern, and is not an anti-pattern. That's why I wondered what this article was talking about. My CS experience only ranges as far as Actionscript and the books on software development that I have read, so perhaps the finer points of distinction between Event objects and Poltergeist is lost on me. What is an example of a short-lived, stateless object that does these things?
Thinking about it, the EventDispatcher is not short lived, and it is what invokes the functions, passing the event object (which is short-lived) to the invoked function.
__________________
man.mask = mask_mc; Sigh. The AS3 version just doesn't look at nice as 'man.setMask(mask_mc);' |
|
|
|
|
|
#4 |
|
as[org].addListener(this)
Join Date: Dec 2005
Location: LA, California
Posts: 838
|
Hmm....I guess I'd need an example of it. It's kinda vague.
|
|
|
|
|
|
#5 | |
|
rather be programming
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
|
i see what you are saying but here is the difference:
Quote:
hope that helps. cheers ![]()
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman |
|
|
|
|
|
|
#6 |
|
Site Contributor
Join Date: Jun 2008
Location: Brooklyn
Posts: 311
|
Almost sounds like a decorator/proxy/adapter pattern too. Not sure I really agree with that article either.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|