Re: Re: [Flashcoders] Abstract classes in AS3?

2006-07-11 Thread Chris Allen

For compile time checks, just use a private constructor. As
ActionScript allows one to access a private (not really private) super
constructor in a subclass this works perfectly. At least this is what
I do when I need an Abstract class in ActionScript.

E.G.

class com.tomsnyder.fasttmath2.studentclient.activities.tasks.AbstractTask
{
  //private constructor to discourage instantiation
private function AbstractTask() {
//initialization code here
}
}

Now there's no way to instantiate it, and the compiler will bitch
about it if you try.

I hope that helps.

-Chris

On 7/9/06, Weyert de Boer [EMAIL PROTECTED] wrote:

I still think compile-time checks are the best to have... but this will
serve very well. Thanks.
___
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


___
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


RE: Re: [Flashcoders] Abstract classes in AS3?

2006-07-11 Thread Geoffrey Williams
AS3 doesn't support private constructors.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Allen
Sent: Tuesday, July 11, 2006 2:06 PM
To: Flashcoders mailing list
Subject: Re: Re: [Flashcoders] Abstract classes in AS3?

For compile time checks, just use a private constructor. As
ActionScript allows one to access a private (not really private) super
constructor in a subclass this works perfectly. At least this is what
I do when I need an Abstract class in ActionScript.

E.G.

class com.tomsnyder.fasttmath2.studentclient.activities.tasks.AbstractTask
{
   //private constructor to discourage instantiation
private function AbstractTask() {
//initialization code here
}
}

Now there's no way to instantiate it, and the compiler will bitch
about it if you try.

I hope that helps.

-Chris

On 7/9/06, Weyert de Boer [EMAIL PROTECTED] wrote:
 I still think compile-time checks are the best to have... but this will
 serve very well. Thanks.




___
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


Re: Re: [Flashcoders] Abstract classes in AS3?

2006-07-11 Thread eka

Hello ;)

In AS3 the private keyword it's removed !! ;) You can't use this keyword for
your constructor :)

EKA+ :)

2006/7/11, Chris Allen [EMAIL PROTECTED]:


For compile time checks, just use a private constructor. As
ActionScript allows one to access a private (not really private) super
constructor in a subclass this works perfectly. At least this is what
I do when I need an Abstract class in ActionScript.

E.G.

class com.tomsnyder.fasttmath2.studentclient.activities.tasks.AbstractTask
{
   //private constructor to discourage instantiation
private function AbstractTask() {
//initialization code here
}
}

Now there's no way to instantiate it, and the compiler will bitch
about it if you try.

I hope that helps.

-Chris

On 7/9/06, Weyert de Boer [EMAIL PROTECTED] wrote:
 I still think compile-time checks are the best to have... but this will
 serve very well. Thanks.
 ___
 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

___
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


___
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


Re: Re: Re: [Flashcoders] Abstract classes in AS3?

2006-07-11 Thread Chris Allen

Yep,

Just realized you guys were talking AS3. My bad.

-Chris

On 7/11/06, eka [EMAIL PROTECTED] wrote:

Hello ;)

In AS3 the private keyword it's removed !! ;) You can't use this keyword for
your constructor :)

EKA+ :)

2006/7/11, Chris Allen [EMAIL PROTECTED]:

 For compile time checks, just use a private constructor. As
 ActionScript allows one to access a private (not really private) super
 constructor in a subclass this works perfectly. At least this is what
 I do when I need an Abstract class in ActionScript.

 E.G.

 class com.tomsnyder.fasttmath2.studentclient.activities.tasks.AbstractTask
 {
//private constructor to discourage instantiation
 private function AbstractTask() {
 //initialization code here
 }
 }

 Now there's no way to instantiate it, and the compiler will bitch
 about it if you try.

 I hope that helps.

 -Chris

 On 7/9/06, Weyert de Boer [EMAIL PROTECTED] wrote:
  I still think compile-time checks are the best to have... but this will
  serve very well. Thanks.
  ___
  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
 
 ___
 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

___
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


___
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