Skip to content

Add visitor pattern with course content inspection#19

Merged
darbyluv2code merged 1 commit intomainfrom
feature/add-visitor-pattern
Mar 8, 2026
Merged

Add visitor pattern with course content inspection#19
darbyluv2code merged 1 commit intomainfrom
feature/add-visitor-pattern

Conversation

@darbyluv2code
Copy link
Copy Markdown
Owner

@darbyluv2code darbyluv2code commented Mar 8, 2026

Summary

  • Implements Visitor pattern with course content inspection use case
  • Demonstrates ContentCountVisitor and TotalStudyTimeVisitor on shared Course structure
  • Location: section-04-behavioral-design-patterns/15-visitor/

Pattern Roles

  • ContentVisitor: visitor interface declaring visit methods
  • CourseContent: element interface
  • VideoLesson, Quiz, Assignment: concrete elements
  • Course: object structure containing elements
  • ContentCountVisitor: concrete visitor counting content by type
  • TotalStudyTimeVisitor: concrete visitor summing estimated study time

Test plan

  • Run mvn compile in section-04-behavioral-design-patterns/15-visitor/
  • Run mvn exec:java or MainApp directly to verify output
  • Confirm both visitors produce expected counts and study times

@darbyluv2code darbyluv2code merged commit 43cdea0 into main Mar 8, 2026
@darbyluv2code darbyluv2code deleted the feature/add-visitor-pattern branch March 8, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant