Please explain why Roger Gonzalez (last 4 lines) construct is a hack (other than different from the Java way)?

It is interesting to note that private constructors are discouraged in C# 2.0 and replaced by statics. (much like in AS3)

cheers

 -michael


On 2/12/06, Xavi Beumala < [EMAIL PROTECTED]> wrote:
Hi there,
I also completely agree with you. If it's a fact of architecture why not let us (programmers) decide what to use (internal vs private) ??

All new features on AS3 and FES are really amazing, but I think two main things are being forgotten as has been said: abstract classes and private methods.

It's really tricky and weird to use runtime exceptions to control what can be controlled at compile time.

And despite patterns are language agnostic and can have different implementations on different languages they must be easy to identify on the code. Using hacks like the ones explained isn't easy to identify them. Implementing a template method using exceptions IMHO also looks really bad...

Just my opinion
X.



On 2/12/06, Carlos Rovira <[EMAIL PROTECTED] > wrote:
Thanks to god! I thought was completly alone in this topic! : )

2006/2/12, Jens Halm < [EMAIL PROTECTED]>:

> again from other people's coming to the Flash platform  they look at
> all this stuff as the typical flash hacks from old days.

> I don't know why are you so reactive to introduce private
> constructors that are very clear and precise to resolve this kind of
> things and don't need any trick.

> Another question is what's about Abstract classes that are again very

 

needed.

> Please rethink this two things so we could get a very flexible
> languaje and bring more people form other backgrounds to our beloved
> platform without think that we have a platform full of hacks.

I have to second all those points.

Ok, now we know Adobe had long discussions internally about this
issue, but I still can't see any disadvantages in permitting
non-public constructors which might have led to this decision.
As it seems evident from this and other similar threads the
proposed workarounds for singletons are ugly and confusing for
most developers.

As for abstract classes: Maybe they are not part of ECMA 4 yet?
I tried to google it up, but somehow I am not able to find an
up-to-date specification draft. (The newest one I was able to find is
from 2003). In AS 3 abstract is a reserved keyword but it's not used
yet. But again: If we don't get abstract classes we need non-public
constructors to fake them. In AS 2 I combine private constructors with
empty (pseudo-abstract) template methods to accomplish this.

AS 3 is a huge step forward, but I still miss some pieces in the core
language:

- Private constructors

- Abstract classes and methods

- Enumerations!

- Class.instantiate(args:Array) method


Jens
www.oregano-server.org




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
::| Carlos Rovira
::| http://www.carlosrovira.com

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
Xavi Beumala
http://www.code4net.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to