How people handle these situations in other languages?
Early days of Flash, people modified the base intrinsic classes all the
time, and a large collection of code snippets popped up all over the web.
MovieClip.prototype.drawBox for instance, was a popular one, allowing all
MovieClips created thereafter to suddenly have the ability to drawBoxes:
createEmptyMovieClip("mc", 0);
mc.drawBox();
Number, Date, etc. A lot of these are still used in JavaScript from what
I've seen, but I haven't seen a lot of JavaScript to know how prevalent it
is there.
Flash MX 2004 introduced a problem becuase even if you modified the source
AS files for the v2 component framework, your build was suddenly not the
same as say, the developer next to you, or another client. Yes, you could
distribute a modified file with your source, and Flash would know to compile
yours first, but differing code-bases around the v2 components didn't work.
Your code wasn't portable. You could do it to get the job done, but most of
you, you could document where you were explicity doing naughty things like
accessing undocumented properties and extending components for the sake of
changing something.
Apparently, the implied path is extending the base components if you don't
like them. That seems... more restrictive. Again, what do other languges &
frameworks do?
----- Original Message -----
From: "Eric Raymond" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, December 29, 2005 4:02 PM
Subject: [flexcoders] re: (AS3 type safety)
It's always nice to have an inconvient but useful mechanism to get
around these edge cases ... even at an order magnitude's extra cost to
the invoker of the backdoor. That's a reasonable tradeoff as long as
supporting this it doen't incur any significat overhead to the normal,
non-subverted invokations.
In java it's reflection (and taken to the nth degree byte code
manipulation). It's not for the meek, but that hopefully limits the
subversion of the type system to edge use cases where people truly
understand they are operating in the "deprecated" zone and the risks
therein.
After a quick read, I'm not 100% sure AS3's Proxy would completely
solve the issue of accessing the Flex 1.5 drag proxy.
I tend to agree with the general philosophy of AS3....
--- In [email protected], "Matt Chotin" <[EMAIL PROTECTED]> wrote:
>
> The describeType utility will give you information about variables
> accessible to you, I think it will not give you information about
> privates if you are not an instance of that class.
>
> Agreed that manipulation of privates is sometimes useful, I know lots of
> people like to do the prototype hacking that Jesse mentioned, but the
> benefits in locking some of this stuff down from an API cleanliness
> perspective, developer predictability, and finally performance, seem to
> outweigh what we lost.
>
> Matt
>
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/