incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Heidegger>
Subject Re: AS3 Enhancements: method overloading. Why do people want this?
Date Mon, 16 Jan 2012 15:22:10 GMT
On 17/01/2012 00:07, David Arno wrote:
>> From: Martin Heidegger []
>> Sent: 16 January 2012 14:54
>> Overloading is the a way to implement two interface with
>> conflicting arguments for the same method:
> Would this feature not be better solved through meaningful method names
> though? What does "test" do? It is a very vague method name.
> David.
To fix it by renaming one would need a complex naming convention in 
interfaces like:
   function <namespace>_<functionality>()

Because if we create a interface we don't know in advance what other 
interface from other
frameworks it might be used with it: that means you better write 
something like this:

interface IContext {
   function get robotlegs_core_destroyed(): Boolean;

because some other interface might have another getter for "destroyed" 
of which the robotlegs team
doesn't know in advance.

So: To answer your question: No it is not always fixable because people 
do not always have access to the
interfaces in question that conflict (swcs), it is preventable by using 
non-user-friendly method and property names.

Right now this sort of problem has to be dealt with using Adapters which 
requires a lot of writing (classes)
and a lot of bothering. People avoid going through such stretches by 
just not-using conflicting interfaces resulting
in whole libraries without interfaces as they would become just pain in 
the ass as major method names are already
taken by standard flex interfaces (for example).


(btw.: Complaining about non-descriptive function name in a example 
without implementation is tedious)

View raw message