Use Interfaces?

I try to develop a small web-based game.

I have a Player class:

public class Player{

private String name;

...

public getName(){

return this.name;

}

}

For my Presentation Layer I have a Buisiness Delegate -Interface:

public interface IFacade {

public Player getPlayer(String name);

}

Schould I better define a Player interface (IPlayer) and return a IPlayer-Object instead of Player-class Object?

Lena

[498 byte] By [Lena_] at [2007-9-30 13:31:49]
# 1

First of all, don't start interfaces with 'I'. That's annoying. Just call the interface Player.

Secondly, whether you should use an interface depends on whether there will possibly be more than one type of Player. If you just want to try using intefaces to learn about them, that would be fine too.

dubwai at 2007-7-4 21:59:13 > top of Java-index,Other Topics,Patterns & OO Design...