Class Diagram for the Jigsaw Puzzle
Explore how to design class diagrams for a jigsaw puzzle system by identifying key classes, relationships, and design patterns. Learn to implement a structured model using composition and association, and understand how to handle additional requirements like piece rotation.
In this lesson, we’ll identify and design the classes, abstract classes, and interfaces based on the requirements we previously gathered from the interviewer in our jigsaw puzzle.
Components of a jigsaw puzzle
As mentioned, 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:
Piece
The Piece ...