Skip to content

System Design

Guilherme Miranda edited this page Jul 12, 2025 · 2 revisions

🏗️ Architecture Overview

The project is structured in a layered architecture to separate user interface, chess logic, and board logic.

Layers

  • UI Layer: Handles input/output and game flow (application/Program.java)
  • Chess Layer: Implements chess rules, moves, and validation (chess package)
  • Board Layer: Manages board, pieces, positions, and exceptions (boardgame package)

🧩 Main OOP Concepts Used

  • Classes and Objects
  • Encapsulation
  • Inheritance
  • Polymorphism
  • Abstraction (abstract classes, methods)
  • Custom exception handling

📦 Package Structure

boardgame package

  • Position: Board coordinates (row, column)
  • Board: Board logic, pieces, and rules
  • Piece: Generic chess piece superclass
  • BoardException: For invalid board operations

chess package

  • ChessMatch: Controls game logic and flow
  • ChessPiece: Extends Piece for chess-specific logic
  • ChessPosition: Converts chess notation (e.g., e4) to matrix positions
  • ChessException: Handles chess-specific errors

Implemented Pieces

  • King (incl. castling)
  • Queen
  • Rook
  • Bishop
  • Knight
  • Pawn (incl. promotion, en passant)

Clone this wiki locally