Actually my definition of a mixin is very strict compared to a decorator; it
uses design by contract, composition and declares type:

Class ClassA implements IClassB, IClassC
{

private var classB:ClassB;
private var classC:ClassC;

private function classBMethod():Boolean{...};

private function classCMethod():Number{...};

}


-erik


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of T. Michael
Keesey
Sent: Tuesday, January 30, 2007 12:09 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Flair Pattern bad mixins good (?)

On 1/29/07, David Ham <[EMAIL PROTECTED]> wrote:
>
> startObjectDrag triggered by     obj_mc.onPress
> checkForSnap    triggered by    setInterval or onEnterFrame type of event,
> in this case onObjectDrag
> stopObjectDrag  triggered by    obj_mc.onRelease

This looks more like the Broadcaster pattern or the Event Dispatcher
(a.k.a. Observer) pattern than Decorator.

(Also, it might be better to tie checkForSnap to mouseMove.)

Personally, I'm not a big fan of mix-ins because, well, they're kind
of sloppy. They involve tinkering with stuff that should be off-limits
(and is in AS3, I think). Using mix-ins, you could accidentally use a
non-function as a function. That can't happen if you stick to
strictly-typed programming.
-- 
T. Michael Keesey
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to