Understand how to create a class diagram for ESPNcricinfo using the bottom-up approach.
In this lesson, we’ll identify and design the classes, abstract classes, and interfaces based on the requirements we have previously gathered from the interviewer in our ESPNcricinfo system.
Components of ESPNcricinfo
As mentioned, we will design the ESPNcricinfo system using a bottom-up approach.
Admin
The Admin
class manages the system and adds and modifies updates. The representation of the class is shown below:
Run, ball, and wicket
The Run
class records the number and type of runs scored on a ball. The Ball
class records every detail of a ball, such as the number of runs scored, if it was a wicket-taking ball, etc. The Wicket
class records the details of the wicket, including its type, the player that bowled, and the player that was declared out.
The mentioned classes are shown below:
Over and innings
The Over
class represents all the details of an over of the innings. The Innings
class represents the details of a match innings. The two classes are shown below:
Match
The Match
class is an abstract class that has three child classes that represent the types of matches that can take place.
The
Test
classThe
ODI
classThe
T20
class
The class diagram is shown below:
Stadium
The Stadium
class represents the information about a stadium, including its name, address, and capacity. The UML representation of this class is given below:
Player, coach, and umpire
The Player
class includes the information of a player and their statistics. The Coach
class contains the information of a coach. The Umpire
class contains the information of an umpire. The three classes are shown below: