|
From: David H. <wa...@us...> - 2004-11-16 16:16:25
|
I was knocking up a script to generate javadoc-like documentation over
the weekend, and I noticed that unlike other examples of AS2 classes that
I have to hand, the asunit.framework classes don't include the package-name
within the class-name. i.e.,
class Assert {
...
rather than,
class com.asunit.framework.Assert {
...
Macromedia docs strongly suggest that the latter form is required (but of
course, the classes work as they are). Is there a reason why the
classes are declared as they are?
ta,
dave
--
http://david.holroyd.me.uk/
|
|
From: Luke B. <lb...@gm...> - 2004-11-17 01:05:28
|
Basically,
First and foremost, I have an *extremely* difficult time reading any
"recomendations" from Macromedia about "best Practices" related to
coding Flash Applications.
Most of the information that I've found coming out of Macromedia is
targeted at non-programmer types that would like to build
somewhat-complex applications. But these recomendations tend to be in
direct conflict with things that the Gang of Four (Patterns folks) and
XP leaders tell us.
Some examples of extremely poor Macromedia recomendations are:
- Always "suffix" a variable name with it's generic data type.
("_mc", "_txt", "_dg", "_cb", etc.)
- They have put 3 different unacceptable component packages into the
root global scope.
- Rather than using relevant packages, they simply prefix the same
class names with a random first character. Like "M" or "F" or "C"
depending on it's version or target platform?
I can probably go on and on here but it will quickly just turn into venting...
To your question - My feeling (and Ali's too) is that we would like to
have a "package" keyword as seen in Java (and I think C#). As a
convention, our first import statement is actually the package that
our class is found in. I assume that the compiler checks all wildcard
imports to look for a file and uses the one that matches. Ultimately,
we don't use the full-qualified class name because:
On Tue, 16 Nov 2004 16:16:16 +0000, David Holroyd
<wa...@us...> wrote:
> I was knocking up a script to generate javadoc-like documentation over
> the weekend, and I noticed that unlike other examples of AS2 classes that
> I have to hand, the asunit.framework classes don't include the package-name
> within the class-name. i.e.,
>
> class Assert {
> ...
>
> rather than,
>
> class com.asunit.framework.Assert {
> ...
>
> Macromedia docs strongly suggest that the latter form is required (but of
> course, the classes work as they are). Is there a reason why the
> classes are declared as they are?
>
> ta,
> dave
>
> --
> http://david.holroyd.me.uk/
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: InterSystems CACHE
> FREE OODBMS DOWNLOAD - A multidimensional database that combines
> robust object and relational technologies, making it a perfect match
> for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
> _______________________________________________
> Asunit-users mailing list
> Asu...@li...
> https://lists.sourceforge.net/lists/listinfo/asunit-users
>
|
|
From: Luke B. <lb...@gm...> - 2004-11-17 01:15:16
|
[SORRY I was cut off by an inadvertent key command in gmail!] Ultimately we don't use fully-qualified class names because: a) Most classes expect to interact with other classes in their package which requires one to enter and maintain the full package name in yet another place. b) Because of reason a - the classname starts to feel redundant. c) It makes it more difficult to quickly see which class you're currently editing when the class name can fall of the right of the text editor. I hope that helps - and I'm interested to hear what you may think. Thanks, Luke Bayes www.asunit.com |
|
From: David H. <wa...@us...> - 2004-11-17 10:40:37
|
On Tue, Nov 16, 2004 at 05:04:46PM -0800, Luke Bayes wrote:
> On Tue, 16 Nov 2004 16:16:16 +0000, David Holroyd wrote:
> > I was knocking up a script to generate javadoc-like documentation over
> > the weekend, and I noticed that unlike other examples of AS2 classes that
> > I have to hand, the asunit.framework classes don't include the package-name
> > within the class-name. [...]
>
> First and foremost, I have an *extremely* difficult time reading any
> "recomendations" from Macromedia about "best Practices" related to
> coding Flash Applications.
[...]
Yep, ActionScript is on crack. This is a given :)
It doesn't really matter. I can arrange for type resolution to work by
ignoring any package-prefix contained in the file, and using the files
$CLASSPATH-relative package-path.
> To your question - My feeling (and Ali's too) is that we would like to
> have a "package" keyword as seen in Java (and I think C#). As a
> convention, our first import statement is actually the package that
> our class is found in. I assume that the compiler checks all wildcard
> imports to look for a file and uses the one that matches. Ultimately,
> we don't use the full-qualified class name because:
Well, ActionScript 2.0 is based on the proposed ECMAScript4 (for
small enough values of 'based'). In this instance, I think ECMAScript4
is suggesting syntax like,
package <name> {
...class declarations etc...
}
Maybe MM didn't get that memo? Interestingly the current draft
explicitly excludes syntax that AS2 uses ('get' and 'set' keywords).
> I hope that helps - and I"m interested to hear what you may think
I'm just an ActionScript2 newbie, and wanted to check I understood the
AsUnit packaging policy, as that should drive the documentation
structure. Here's what AsUnit API docs look like currently:
http://www.badgers-in-foil.co.uk/projects/as2api/examples/asunit/index.html
(There are bugs, like interfaces not being there; and I've not
implemented any type-resolution yet, so no inter-class links.)
thanks,
dave
--
http://david.holroyd.me.uk/
|
|
From: Luke B. <lb...@gm...> - 2004-11-17 18:41:25
|
Hey David, You're a ROCKSTAR! Keep us posted on the progress of that documentation engine, as we'd love to take advantage of it for this project and many others! Thanks, Luke Bayes www.asunit.com |
|
From: David H. <wa...@us...> - 2004-11-21 16:08:52
|
On Wed, Nov 17, 2004 at 10:41:16AM -0800, Luke Bayes wrote: > Keep us posted on the progress of that documentation engine, as we'd > love to take advantage of it for this project and many others! I spent a bit more time on it during last week, and the results are starting to look almost presentable. I also found some software for bundling up Ruby applications into a single Windows .exe file, and I'd love to know if the result works for other people (it does for me). Updated AsUnit API docs: http://www.badgers-in-foil.co.uk/projects/as2api/examples/asunit/overview-summary.html Download page for alpha-version of as2api: http://www.badgers-in-foil.co.uk/projects/as2api/ dave -- http://david.holroyd.me.uk/ |
|
From: Luke B. <lb...@gm...> - 2004-11-21 20:05:40
|
Yo David, You're a ROCKSTAR - the documentation looks great! I'll check out the download and let you know how it works. I think it's hilarious that your two examples are from asunit and xfactorstudio! That's my old business partner Neeld Tanksley. Neeld actually built a .NET as-doc util when as2 first came out. You should fire an email out to him as I'm sure he'd be interested in helping out. Good work, lb. www.asunit.com |