...

/

Class Diagram for the Jigsaw Puzzle

Class Diagram for the Jigsaw Puzzle

Learn to create a class diagram for the jigsaw puzzle using the bottom-up approach.

In this lesson, we’ll identify and design the classes, abstract classes, and interfaces based on the requirements that we have previously gathered from the interviewer in our jigsaw puzzle.

Components of a jigsaw puzzle

As mentioned earlier, we should design the jigsaw puzzle using a bottom-up approach.

Side

The Side class represents the shape of our jigsaw piece and whether it contains an indentation, extrusion, or flat edge. The UML representation of the class is shown below:

Press + to interact
The class diagram of the Side class
The class diagram of the Side class

Piece

The Piece class contains an array of sides of size four. It will also be used to identify middle pieces, corner pieces, and edge pieces. The class representation of the Piece class is ...