Opps meant to add: that's my interpretation anyways. I could be wrong. I'm
wrong all the time. In fact I consider myself a professional mistake maker.

-erik

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Erik Bianchi
Sent: Tuesday, January 30, 2007 1:49 PM
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] Flair Pattern bad mixins good (?)

A decorator is meant to be dynamic. It adds responsibilities to an object at
run time.

You take ComponentA and add methods to it on mouseclick, that's a decorator.

ComponentB is made up of ComponentC and ClassA, that's a composite.

My implementation of a mixin which I borrowed from java is really just using
composites + interfaces to emulate multiple inheritance.

Decorators and composites are similar however in that they are both
structural patterns and define an interface for communicating between parent
and "child" components / classes.

Best,

-erik







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

How is this any different from a Decorator/Wrapper? Looks like a
double decorator.

On 1/30/07, Erik Bianchi <[EMAIL PROTECTED]> wrote:
> 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
> _______________________________________________
> [email protected]
> 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
>
>
> _______________________________________________
> [email protected]
> 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
>


-- 
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
[email protected]
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


_______________________________________________
[email protected]
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


_______________________________________________
[email protected]
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