Class Diagram Design for a Cricket score Board


  • 0
    C

    It was an Interview Question , interviewer wanted both HLD and LLD. I came up with something like:

    Events API ---> Queuing Mechanism ----> Scorecard system --> display and database

    what i'm looking for here is the view on how the class diagram would look for the score card?

    Every Ball is considered to be an event.

    i Have classes for Ball, Wicket, Team, Player, Over, Run, and Match \n

    Match <-- consists of Teams[2]\n
    Team <-- consists of players[11] each, and RunsScored, Wickets taken etc
    Over <-- consists of balls
    Ball <-- can be of Enum {Extra,Normal, Wicket} and has a ballnumber {1-6} and has Runs Scored
    Run <-- consists of Player, int runs
    Wicket <-- Player whoGotOut, Player whoTookWicket, Player assistIfAny, and is of WicketType{BOLD,CAUGHT,LBW,STUMPED,RUNOUT,etc}


  • 0
    R

    If only class diagram from the point of object oriented programming :

    class balls
    run_scored
    type_of_ball(normal, dot, wide, bounce)
    wicket_taken(true, false)

    class over:
    player_id
    balls[6]

    class score:
    runs
    wicket
    catch
    balls_played
    balls bowled

    Class player extends score
    id
    name

    class team
    total_run
    wicket_fall
    players[11]
    over[50]

    class match
    team[2];


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.