Thanks EKA!

That'll work for me. Smells funny but I like it =)

Thx Ian, the only thing I can think of as an argument is Marker Interfaces.
Then again, I think I might just be using using interfaces the wrong way as
I am trying to establish some form of polymorphism in trying to access both
foo() and bar() methods.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ian
Thomas
Sent: Thursday, June 15, 2006 10:24 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Accessing non-interface methods from an
object ofaninterface type


It's really all about the design. It very much depends on what you're
trying to use the interfaces to achieve.

If you're finding that you constantly need to downcast the interfaces
to concrete objects then either your design isn't one that's suited to
interfaces, or you're using them in the wrong way.

Why is it that you're ending up having to call functions that aren't
defined in the interface? Don't get me wrong - there can be extremely
good reasons for this. But if it's happening throughout your code,
then you've got a design problem and should maybe think about
refactoring something.

The same would be true of using ordinary superclasses rather than
interfaces, incidentally - it's the constant downcasting that shows
there's something up...

Cheers,
  Ian

On 6/15/06, Mark Lapasa <[EMAIL PROTECTED]> wrote:
> Thanks EKA and JC for your answers.
>
> I -kinda- knew that was the answer but I wanted to know if there was
another
> way.
>
> Casting/trantyping an abstract object down into one of a concrete type
seems
> like to me very self-defeating to use abstractions as a data type.
>
> I might as well say
>
> var tmp:ConcreteClass = new ConcreteClass();
> tmp.bar();
>
> as JC has mentioned and forget about the low-coupling flexibility of using
> interfaces. I imagined the inital route I wanted to go ought to work at
> run-time but the compiler is not forgiving.
_______________________________________________
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

Reply via email to