Re: [Flashcoders] What design pattern would this be?

2008-12-08 Thread John McCormack
I would also like to use patterns more than I do. It looks as thought 
the observer pattern might be the one in this case...


As your objects appear and disappear from your program they can register 
themselves.
They pass a function to call when an update happens and this is added to 
the list.
The list of observers' function are called to update them of the mouse 
position.


John

Joel Stransky wrote:

I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] What design pattern would this be?

2008-12-08 Thread Eamonn Faherty
It might be a little light but check out the reactor pattern.  It is
very useful when desiring polymorphic behaviors.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joel
Stransky
Sent: 06 December 2008 21:00
To: Flash Coders List
Subject: [Flashcoders] What design pattern would this be?

I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a
quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on
mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?

-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-08 Thread Jiri Heitlager
I also still find it sometimes hard when to decide what pattern to use 
and mostly _if_ I should use a pattern. It helps me a lot to really 
think about what the responsibility is of a class and then when I notice 
it has more then one, then that is an inidicator I need to refine more. 
Sometimes refining means that I _can_ use a pattern, it doesnt always 
mean that I should use one.

I think these are those things that take a long time of experience.

Good luck.

Jiri

Joel Stransky wrote:

Thanks Jiri,
I had not seen that site. I had assumed the book covered all of the patterns
I was going to need but in hindsight that was silly. The visitor pattern
seems very similar to adapter however. I guess I've got a lot of learning to
do. I appreciate the notion of not over engineering but until I understand
them fluently I intend to implement patterns where possible no matter how
trite.

On Sun, Dec 7, 2008 at 5:26 AM, Jiri Heitlager <[EMAIL PROTECTED]

wrote:



Maybe this one:

http://www.as3dp.com/2008/12/06/actionscript-30-visitor-design-pattern-a-tale-of-traverser-and-the-double-dispatch-kid/

or check out the articles there I am sure there is a pattern described that
will suit your needs.

I also think the previous comment on overenginering should be taking into
consideration..

Good luck,

Jiri


Joel Stransky wrote:


Thanks for your perfectly useless answer. I know if I could recognize the
need for certain patterns easily I'd be more than happy to help out rather
than chastise.It looks like it's possibly a Template pattern but I was
hoping for the same kind of insight I've been giving at flashkit for eight
years no matter how simple the question.

On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED]> wrote:

 Are you gonna  take a map  if you have clear line of sight to your

destination ?
Shall we advise you on traffic light implementation  if you are the only
driver in the world ?
Dont' overengineer. If you want to integrate / learn a design pattern
take
a more challenging and/or interactive interface.

Latcho


Joel Stransky wrote:

 I'm trying to make design patterns a regular part of my process but

understanding them and knowing which one to use are proving to be a
quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on
mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?



 ___

Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




 ___

Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-07 Thread John McCormack

And these ones:

http://www.dofactory.com/Patterns/Patterns.aspx

John


Jiri Heitlager wrote:

Maybe this one:
http://www.as3dp.com/2008/12/06/actionscript-30-visitor-design-pattern-a-tale-of-traverser-and-the-double-dispatch-kid/ 



or check out the articles there I am sure there is a pattern described 
that will suit your needs.


I also think the previous comment on overenginering should be taking 
into consideration..


Good luck,

Jiri

Joel Stransky wrote:
Thanks for your perfectly useless answer. I know if I could recognize 
the
need for certain patterns easily I'd be more than happy to help out 
rather

than chastise.It looks like it's possibly a Template pattern but I was
hoping for the same kind of insight I've been giving at flashkit for 
eight

years no matter how simple the question.

On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED]> wrote:


Are you gonna  take a map  if you have clear line of sight to your
destination ?
Shall we advise you on traffic light implementation  if you are the 
only

driver in the world ?
Dont' overengineer. If you want to integrate / learn a design 
pattern take

a more challenging and/or interactive interface.

Latcho


Joel Stransky wrote:


I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a 
quite

different.
I'm working on a couple of classes. One class's job is to iterate 
over a
list of display objects and modify their scale and location based 
on mouse

position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and 
if so

which one?




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Fwd: Re: [Flashcoders] What design pattern would this be?]

2008-12-07 Thread Latcho


As you wish, then go for a minimalist composite pattern my friend.

Joel Stransky wrote:
Thanks for your perfectly useless answer. I know if I could recognize 
the need for certain patterns easily I'd be more than happy to help 
out rather than chastise.
It looks like it's possibly a Template pattern but I was hoping for 
the same kind of insight I've been giving at flashkit for eight years 
no matter how simple the question.


On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED] 
> wrote:


Are you gonna  take a map  if you have clear line of sight to your
destination ?
Shall we advise you on traffic light implementation  if you are
the only driver in the world ?
Dont' overengineer. If you want to integrate / learn a design
pattern take a more challenging and/or interactive interface.

Latcho


Joel Stransky wrote:

I'm trying to make design patterns a regular part of my
process but
understanding them and knowing which one to use are proving to
be a quite
different.
I'm working on a couple of classes. One class's job is to
iterate over a
list of display objects and modify their scale and location
based on mouse
position.
I want this class to be able to work with a runtime generated
OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern
and if so
which one?

 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com

http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--
--Joel Stransky
stranskydesign.com 



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-07 Thread Joel Stransky
Thanks Latcho,
That is actually very helpful. Now that I look at it I can see definitely
would be over engineering in this case but it will be good practice for me.

On Sun, Dec 7, 2008 at 11:32 AM, Joel Stransky <[EMAIL PROTECTED]>wrote:

> Thanks Jiri,
> I had not seen that site. I had assumed the book covered all of the
> patterns I was going to need but in hindsight that was silly. The visitor
> pattern seems very similar to adapter however. I guess I've got a lot of
> learning to do. I appreciate the notion of not over engineering but until I
> understand them fluently I intend to implement patterns where possible no
> matter how trite.
>
>
> On Sun, Dec 7, 2008 at 5:26 AM, Jiri Heitlager <
> [EMAIL PROTECTED]> wrote:
>
>> Maybe this one:
>>
>> http://www.as3dp.com/2008/12/06/actionscript-30-visitor-design-pattern-a-tale-of-traverser-and-the-double-dispatch-kid/
>>
>> or check out the articles there I am sure there is a pattern described
>> that will suit your needs.
>>
>> I also think the previous comment on overenginering should be taking into
>> consideration..
>>
>> Good luck,
>>
>> Jiri
>>
>>
>> Joel Stransky wrote:
>>
>>> Thanks for your perfectly useless answer. I know if I could recognize the
>>> need for certain patterns easily I'd be more than happy to help out
>>> rather
>>> than chastise.It looks like it's possibly a Template pattern but I was
>>> hoping for the same kind of insight I've been giving at flashkit for
>>> eight
>>> years no matter how simple the question.
>>>
>>> On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED]> wrote:
>>>
>>>  Are you gonna  take a map  if you have clear line of sight to your
 destination ?
 Shall we advise you on traffic light implementation  if you are the only
 driver in the world ?
 Dont' overengineer. If you want to integrate / learn a design pattern
 take
 a more challenging and/or interactive interface.

 Latcho


 Joel Stransky wrote:

  I'm trying to make design patterns a regular part of my process but
> understanding them and knowing which one to use are proving to be a
> quite
> different.
> I'm working on a couple of classes. One class's job is to iterate over
> a
> list of display objects and modify their scale and location based on
> mouse
> position.
> I want this class to be able to work with a runtime generated OR an
> authortime generated display list.
> I figure it's as easy as instantiating either a RuntimeChildren or
> AuthortimeChildren class and passing it to the constructor of my
> DisplayListUtility class.
> Since it's so simple, does it even qualify as a design pattern and if
> so
> which one?
>
>
>
>  ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


>>>
>>>
>>>  ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
>
> --
> --Joel Stransky
> stranskydesign.com
>



-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-07 Thread Joel Stransky
Thanks Jiri,
I had not seen that site. I had assumed the book covered all of the patterns
I was going to need but in hindsight that was silly. The visitor pattern
seems very similar to adapter however. I guess I've got a lot of learning to
do. I appreciate the notion of not over engineering but until I understand
them fluently I intend to implement patterns where possible no matter how
trite.

On Sun, Dec 7, 2008 at 5:26 AM, Jiri Heitlager <[EMAIL PROTECTED]
> wrote:

> Maybe this one:
>
> http://www.as3dp.com/2008/12/06/actionscript-30-visitor-design-pattern-a-tale-of-traverser-and-the-double-dispatch-kid/
>
> or check out the articles there I am sure there is a pattern described that
> will suit your needs.
>
> I also think the previous comment on overenginering should be taking into
> consideration..
>
> Good luck,
>
> Jiri
>
>
> Joel Stransky wrote:
>
>> Thanks for your perfectly useless answer. I know if I could recognize the
>> need for certain patterns easily I'd be more than happy to help out rather
>> than chastise.It looks like it's possibly a Template pattern but I was
>> hoping for the same kind of insight I've been giving at flashkit for eight
>> years no matter how simple the question.
>>
>> On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED]> wrote:
>>
>>  Are you gonna  take a map  if you have clear line of sight to your
>>> destination ?
>>> Shall we advise you on traffic light implementation  if you are the only
>>> driver in the world ?
>>> Dont' overengineer. If you want to integrate / learn a design pattern
>>> take
>>> a more challenging and/or interactive interface.
>>>
>>> Latcho
>>>
>>>
>>> Joel Stransky wrote:
>>>
>>>  I'm trying to make design patterns a regular part of my process but
 understanding them and knowing which one to use are proving to be a
 quite
 different.
 I'm working on a couple of classes. One class's job is to iterate over a
 list of display objects and modify their scale and location based on
 mouse
 position.
 I want this class to be able to work with a runtime generated OR an
 authortime generated display list.
 I figure it's as easy as instantiating either a RuntimeChildren or
 AuthortimeChildren class and passing it to the constructor of my
 DisplayListUtility class.
 Since it's so simple, does it even qualify as a design pattern and if so
 which one?



  ___
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>>
>>
>>
>>  ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-07 Thread Jiri Heitlager

Maybe this one:
http://www.as3dp.com/2008/12/06/actionscript-30-visitor-design-pattern-a-tale-of-traverser-and-the-double-dispatch-kid/

or check out the articles there I am sure there is a pattern described 
that will suit your needs.


I also think the previous comment on overenginering should be taking 
into consideration..


Good luck,

Jiri

Joel Stransky wrote:

Thanks for your perfectly useless answer. I know if I could recognize the
need for certain patterns easily I'd be more than happy to help out rather
than chastise.It looks like it's possibly a Template pattern but I was
hoping for the same kind of insight I've been giving at flashkit for eight
years no matter how simple the question.

On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED]> wrote:


Are you gonna  take a map  if you have clear line of sight to your
destination ?
Shall we advise you on traffic light implementation  if you are the only
driver in the world ?
Dont' overengineer. If you want to integrate / learn a design pattern take
a more challenging and/or interactive interface.

Latcho


Joel Stransky wrote:


I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-06 Thread Joel Stransky
Thanks for your perfectly useless answer. I know if I could recognize the
need for certain patterns easily I'd be more than happy to help out rather
than chastise.It looks like it's possibly a Template pattern but I was
hoping for the same kind of insight I've been giving at flashkit for eight
years no matter how simple the question.

On Sat, Dec 6, 2008 at 10:29 PM, Latcho <[EMAIL PROTECTED]> wrote:

> Are you gonna  take a map  if you have clear line of sight to your
> destination ?
> Shall we advise you on traffic light implementation  if you are the only
> driver in the world ?
> Dont' overengineer. If you want to integrate / learn a design pattern take
> a more challenging and/or interactive interface.
>
> Latcho
>
>
> Joel Stransky wrote:
>
>> I'm trying to make design patterns a regular part of my process but
>> understanding them and knowing which one to use are proving to be a quite
>> different.
>> I'm working on a couple of classes. One class's job is to iterate over a
>> list of display objects and modify their scale and location based on mouse
>> position.
>> I want this class to be able to work with a runtime generated OR an
>> authortime generated display list.
>> I figure it's as easy as instantiating either a RuntimeChildren or
>> AuthortimeChildren class and passing it to the constructor of my
>> DisplayListUtility class.
>> Since it's so simple, does it even qualify as a design pattern and if so
>> which one?
>>
>>
>>
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] What design pattern would this be?

2008-12-06 Thread Latcho
Are you gonna  take a map  if you have clear line of sight to your 
destination ?
Shall we advise you on traffic light implementation  if you are the only 
driver in the world ?
Dont' overengineer. If you want to integrate / learn a design pattern 
take a more challenging and/or interactive interface.


Latcho

Joel Stransky wrote:

I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?

  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] What design pattern would this be?

2008-12-06 Thread Joel Stransky
I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?

-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders