Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Interfaces  (Read 6559 times)
dgtlmonk
Courseware Beta
Newbie
***
Posts: 8


View Profile Email
« on: June 25, 2008, 07:33:43 »

Hi,
 
 I notice in some examples, some implements interface and some don't (i.e. in FlickerGallery demo it only declares "public class ApplicationFacade extends Facade", while in HelloWorld demo is declares "public class ApplicationFacade extends Facade implements IFacade" ... I know the best practice is to program to Interface .. or is not declaring "implement InterfaceName" just a lazy way to do it even though it will work?

Thanks
« Last Edit: June 25, 2008, 09:04:24 by dgtlmonk » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: June 26, 2008, 05:03:51 »

The implements params are there primarily as hints to the reader of the code. The interface is usually inherited. Tacking on the implements will not, however let you use a class that doesn't actually implement or inherit the interface.

Also, back in the early mists of time, there was a problem in Flash's AS2 engine that meant you had to put the 'implements' on a class that you were going to manipulate via interface. Although the methods were inherited the 'implements' had to be explicitly placed on each implementor. This is how I remember it anyway.

-=Cliff>
Logged
Pages: [1]
Print