Object-Oriented Design and Programming Tutorial
Consider the following simplified description of data storage arrays:
• A data storage array is made up of up to 12 storage devices, each of which has
a particular storage capacity (in GB), data transfer bandwidth (in MB/s) and
latency (in milliseconds). Storage devices within a data storage array are usually,
but not always, identical. When first created, a data storage array contains no
storage devices; however, storage devices can be added to it at any time.
• Storage devices are either Hard Disks (HDs) or Solid State Disks (SSDs). HDs
have an associated average rotation time (in milliseconds) and an average seek
time (in milliseconds). Latency for HDs is calculated as the sum of the average
rotation and seek times. SSDs have an associated average access time (in
milliseconds). Latency for SSDs is simply the average access time.
• Data storage arrays aggregate their component storage devices into one logical
storage unit according to one of two configurations: RAID 1 (which uses data
mirroring) and RAID 5 (which uses distributed parity).
• A data storage array has an effective capacity, bandwidth, and latency. Latency
for a data storage array is given by the maximum latency of any of its component
storage devices. The effective capacity (resp. bandwidth) of a RAID 1 array is
half the sum of the capacities (resp. bandwidths) of the component storage
devices. The effective capacity (resp. bandwidth) of an n-device RAID 5 array is
(n− 1)/n multiplied by the sum of the capacities (resp. bandwidths) of the
component storage devices.
a Draw a UML class diagram to describe the above.
b Write C++ class declarations (i.e. no function bodies) to support the above.
c Write a test function as follows:
– A RAID 1 disk array is created, and populated with 4 identical HDs. Each
HD is a 500GB drive with an average seek time of 8ms, an average rotation
time of 4ms and a bandwidth of 100MB/s.
– A RAID 5 disk array is created, and populated with 4 identical SSDs. Each
SSD is a 30GB drive with an average access time of 0.01ms and a
bandwidth of 300MB/s.
– The bandwidth and latency of the RAID 1 system is calculated.
– The effective capacity of the RAID 5 system is calculated.
d Write the bodies of the functions from part (b) that relate to your classes that
represent storage devices and storage arrays.