— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet48/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   44   45   46   47   48   49   50   51   ...   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

Aeron?”
Chair Wars
(or How Objects Can Change Your Life)
the chair
At Brad’s laptop at the cafe
Brad wrote a 
class
for each of the three shapes
In Larry’s cube
As he had done a gazillion times before, Larry 
set about writing his Important Procedures
He wrote rotate and playSound in no time.
 
rotate(shapeNum) {
// make the shape rotate 360º
}
playSound(shapeNum) {
// use shapeNum to lookup which
// AIF sound to play, and play it
}
}
}
}
O


you are here
4
classes 
and 
objects
29
There will
be an amoeba
shape
on the screen,
with the others.
When the
user clicks
on the
amoeba, it
will rotate
like the
others, and
play a .hif
sound file
But wait! There’s been a spec change.
“OK, technically you were fi rst, Larry,” said the Manager, “but we have to add just one 
tiny thing to the program. It’ll be no problem for crack programmers like you two.”
“If I had a dime for every time I’ve heard that one”, thought Larry, knowing that spec-
change-no-problem was a fantasy. “And yet Brad looks strangely serene. What’s up with 
that?” Still, Larry held tight to his core belief that the OO way, while cute, was just 
slow. And that if you wanted to change his mind, you’d have to pry it from his cold, 
dead, carpal-tunnelled hands.
Larry thought he’d nailed it. He could almost feel the rolled 
steel of the Aeron beneath his...
what got added to the spec
Back in Larry’s cube
The rotate procedure would still work; the code used 
a lookup table to match a shapeNum to an actual 
shape graphic. But playSound would have to change. 
And what the heck is a .hif fi le?

Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   44   45   46   47   48   49   50   51   ...   555




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