On 8/22/07, Alan MacDougall <[EMAIL PROTECTED]> wrote:
>
> Well, the idea is that you'd never mix the two syntaxes. Either every
> single field uses explicit getters, or every single one uses
> property-style access.

Fine if you're working by yourself, just using your own code.

> An abstract class is just one that provides some of the implementation,
> but not all of it (as distinct from an interface, which provides none of
> the implementation). You can do abstract classes in AS, just name them
> "AbstractButton implements Button" and then "SpecificButton extends
> AbstractButton". This does require that all your coders know not to try
> to use an abstract-named class directly. It's not enforced by the
> language, but that's not a huge loss.

Not a huge loss, but a loss nonetheless. And while it can be worked
around in the manner you indicate, there's no equivalent for abstract
methods. Best you can do is throw an IllegalOperationError in the
pseudo-abstract method, which of course means you can only catch
inappropriate usage at runtime rather than compile-time. Yuck.

Funny thing is, Adobe clearly thinks it's useful to have classes that
cannot be instantiated, e.g. DisplayObject. Why this isn't a feature
of the language is something I just don't understand.

> The only reason to put an exception in a method signature is to ensure
> that it is checked, and I actually don't like checked exceptions. I
> would like to know about exceptions, but not be forced to handle them at
> compile-time -- that just leads to a lot of lazy "swallowed" exceptions,
> and in a really big app you could even be forced to handle exceptions
> that just aren't relevant to begin with, or for which you have no
> resolution context.

I haven't had any such problems so far, but I haven't been using Java
very long. I have a hard time imagining where it would be a problem.
At some higher level you could just say "throws Exception" and have
some way to relay that to the user.

> And for simply informing the coder about exceptions,
> just include it in your documentation. AS2API allows a "@throws
> ExceptionClass when blah blah blah" comment, I'm sure ASDoc and other
> solutions do too.

ASDoc does offer it, but it's up to you to make sure everything is
covered. I like that Java checks for you. With ASDoc, every time I add
a new exception to some base function, I have to bubble it up to the
ASDoc block comment of every function that uses that function, and
every function that uses those functions, etc. Maybe if there were an
automated way to handle this it'd be okay.

> The things *I* miss most from Java are generics, and the ability to
> define constants in interfaces.

Two very good points. Actually, generics are probably more important
than anything I mentioned.

-- 
Mike Keesey
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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