Case Study - 1
Case Study - 1
● The diagram above only shows "there is an association between each class", it doesn't show
how many oranges can go into 1 basket; or how many baskets can go into 1 orange.
● However, we can specify this by quickly add additional information such as 1:n or 1:1
● go in: "A" can in to "B"; and many "A" (represents by *) can
○ In regrex * - means "0 or more instances of the preceding regex token"
This is additional attributes or properties … etc, (obviously), however, to represent the "1:n"
relationship above, Basket and Barrel need one more attribute of which the functionality is to keep
track of how many and what oranges it stored and vice versa,
Case study:
Catalogs contain lists of books. People search them to find books on certain subjects, with specific
titles, or by a particular author.
● That hold the information we need, such as Author on Book, Artist on CD (optional);
● Make the relationship to those properties all point to the Contributor class.
Your exercises will be using inheritance, access specifiers (private , protected and public) in python
to design these class with the following attributes and method
Requirements: have docstring in every class and every methods of that class
Catalog:
search → public
LibraryItem:
Locate → public
ContributorWithType:
Contributor → public
Type → protected
Book:
CD:
Artists → public
DVD: