Author Dusty Phillips Reviewers


Contributor and an extra attribute identifying  the type of contribution the person has made to the given  LibraryItem



Download 2,95 Mb.
Pdf ko'rish
bet36/183
Sana20.07.2022
Hajmi2,95 Mb.
#831085
1   ...   32   33   34   35   36   37   38   39   ...   183
Bog'liq
python3-oop

Contributor
and an extra attribute identifying 
the type of contribution the person has made to the given 
LibraryItem
. There can 
be many such contributions to a particular 
LibraryItem
, and one contributor can 
contribute in the same way to different items. The diagram communicates this
design very well:
+Title
+UPC
+Subject
+Contributors
+ISBN
+Title
+Subject
+DDS number
Catalog
Book
CD
DVD
Magazine
Contributor
ContributorWithType
LibraryItem
+Locate()
+Search()
+Contributor
+Type
+Name
+Volume
+Issue
+Genre
1
*
*
*
www.it-ebooks.info


Chapter 1
[
 25 
]
At first, this composition relationship looks less natural than the inheritance-based 
relationships. However, it has the advantage of allowing us to add new types of 
contributions without adding a new class to the design. Inheritance is most useful 
when the subclasses have some kind of specialization. Specialization is creating 
or changing attributes or behaviors on the subclass to make it somehow different 
from the parent class. It seems silly to create a bunch of empty classes solely for 
identifying different types of objects (this attitude is less prevalent among Java and 
other "everything is an object" programmers, but it is common among more practical 
Python designers). If we look at the inheritance version of the diagram, we can see a 
bunch of subclasses that don't actually do anything:

Download 2,95 Mb.

Do'stlaringiz bilan baham:
1   ...   32   33   34   35   36   37   38   39   ...   183




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish