"-" <> wrote in message news:...
> which is the recommended way?
>
> 1)
> private Action createExitAction() {
> return new ExitAction();
> }
>
> 2)
> private AbstractAction createExitAction() {
> return new ExitAction();
> }
>
> 3)
> private ExitAction createAction() {
> return new ExitAction();
> }
>
>
> if no. 1 is recommended, why then do most people do a
>
> private JPanel createSomePanel() {
> ...
> }
>
> rather than a
>
> private JComponent createSomePanel() {
> ...
> }
>
>
> thank you.
Use the most abstract type.
Where some twit has failed to use interfaces appropriately, you'll have to
concede and use a class reference type, or write the dependant framework
yourself.
--
Tony Morris
http://xdweb.net/~dibblego/