-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nicolas
Cannasse
Sent: Wednesday, July 12, 2006 1:16 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Abstract classes in AS3?
>
> Mike Keesey wrote:
> > I don't really care whether they allow private constructors or not,
as
> > long as they provide some way of accomplishing the same thing.
> > Specifically, I want to be able to:
> > 1) Limit the number of instances of certain classes (singletons,
> > enumerations).
>
> Did you have a look at haXe enums ?
> http://haxe.org/ref#the_power_of_enum

Sure, something like that would be nice. But it's not in AS3.0.

> > 2) Have methods which are not attached to specific class instances.
> 
> That's a bit like static methods no ?

I was incomplete. I should have said, "Have *bundled* methods which are
not attached to specific class instances." That is, I want to be able to
have groups of static methods. Static classes are how this is currently
accomplished, but if we can't have private constructors, there's no way
to prevent someone from (pointlessly) instantiating a static class.

Can methods be attached to packages in AS3.0? If so, that might help.

> > 3) Be able to create classes that cannot be instantiated themselves
but
> > can be superclasses of concrete classes.
>
> Yes, I agree there. Removing the ability to create private
constructors
> seems completely pointless. The rational behind it seems a bit like
"you
> don't need that", which is not a very strong point IMHO.

Exactly!

Replace the removed functionality with some other strategy, but don't
just get rid of it and pretend nothing's wrong.
--
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