-1

Are there a difference between these two associations? I want to create Java Program with this.

enter image description here

If there is a difference between those two, What are they? Any example codes are highly appreciated.

Thanks for your time, Cheers

nethsrk
  • 78
  • 8
  • Those are no associaitons. The top one looks like a dependency. The bottom one is not a valid UML connector. The author probably meant to show a Realization, but that has a non filled, closed arrow head. – Geert Bellekens Sep 20 '22 at 08:20
  • 1
    The left two filled arrows are also wrong. – qwerty_so Sep 20 '22 at 10:27

1 Answers1

1
  1. Is just a dependency. This Board Interface does not have Piece enum as a part of the class but works with it.

For example: enum Piece{GREEN, BLUE}, and

class BoardFactory {

  Board create(Piece piece) {
    if(piece == Piece.GREEN) {
      return new GreenBoard();
    }
  }

}
  1. This one is even more simple. It is a realization of the interface. BoardController implements BoardUI
Alexey
  • 104
  • 6