Search code examples
javauml

UML Class Diagram (Java Related) Difference Between Dotted and Dashed Lines


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


Solution

    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