PureMVC Architects Lounge

Announcements and General Discussion => Getting Started => Topic started by: jimrobson on January 16, 2008, 05:07:18



Title: Redundant Implements directive
Post by: jimrobson on January 16, 2008, 05:07:18
In the framework code and sample applications, there seem to be some redundant "implements" directives.

For example, in the Architecture sample, the RolePanelMediator class is declared like so:

:
public class RolePanelMediator extends Mediator implements IMediator
However, Mediator implements IMediator; therefore, as I understand it, any subclass of Mediator implicitly implements IMediator. That being the case, the explicit "implements" in the subclass appears redundant. What is the rationale for including it?


Title: Re: Redundant Implements directive
Post by: Rhysyngsun on January 16, 2008, 07:53:25
I think mostly for the benefit of code generation in Flex Builder, because when you have the Generate functions inherited from interface checked in the New ActionScript Class dialog it generates function that you would typically override in that class. Take, for instance, ICommand, it generates the execute method. Other than that, as you mentioned, there's no absolute need to implement the relevant interface.


Title: Re: Redundant Implements directive
Post by: puremvc on January 16, 2008, 08:41:22
Just so.

-Cliff>