• Post Reply Bookmark Topic Watch Topic
  • New Topic

Interface doubts  RSS feed

 
Ciro Vilchez
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I need to implement the attached interface ("Locality"). In the attached UML diagram it has a 1 on 1 relationship with the class "Team". I don't know if this can be somehow implemented in Java. Can I create the attribute "team" in the Locality interface and let it be used by the "Town" and "City" classes? Could it be better to implement it as an abstract class instead?



uml.jpg
[Thumbnail for uml.jpg]
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fact that the interface has getTeam() and setTeam(Team) methods is enough to represent that. It doesn't have to contain the implementation for them as well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!