Public and Private meaningless in v2 components

When you start working with the v2 core classes, one of the first thing you’ll notice is that nothing is declared as public or private, everything is just defaulted to public. This alone degrades much of the value of OOP and encapsulation and the new static typed compiler in Flash MX 2004 as it relates to v2 components. Well, today I found another problem.

Most of the functions have comments attached to them. Many of these have a comment that says “@private” which seems to indicate the function is private. So, even if the compiler can’t know which functions are intended as public and private, we can find out and program responsibly.

However, some functions marked as private are actually used as public. For example, StylesManager.isColorStyle() is commented as private but is used within UIObject.getStyle().

So how do we know which are really supposed to be public and which are really supposed to be private? We need to read all of the v2 code and cross-reference every function and that will at least tell us how MM uses them. Of course, Flash MX 2006 might be out by the time you’re done figuring it all out…

This entry was posted in Uncategorized by Sam. Bookmark the permalink.

5 thoughts on “Public and Private meaningless in v2 components

  1. Don’t forget, (as I understand it) even if a set of developers were to go in and clean up the ‘mess’ left behind, they couldn’t technically do anything about it as the EULA kinda kills any developer based work on the sent class files.

  2. You’re absolutely right, if someone were to go ahead and add public/private to anything, they wouldn’t be able to distribute changes. I heard MM was working on the EULA issue so let’s all cross our fingers.

    Besides, it wouldn’t be wise for anyone other than MM to make any changes. Changing classes that aren’t in a namespace you own could break other things so even if your intentions are benign, it’s something to avoid.

    A reference list would serve the same purpose though and not break anything or violate the EULA…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>