OReilly.Head.First.Object.Oriented.Analysis.and.Design.2006.pdf
(
80252 KB
)
Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Chapter 1. well-designed apps rock: Great Software Begins Here
Table of Contents
Chapter 1. well-designed apps rock: Great Software Begins Here
................ 1
Section 1.1. Rock and roll is forever!
............................................................................................................................................... 2
Section 1.2. Rick's shiny new application...
.................................................................................................................................... 3
Section 1.3. Here what the code for Guitar.java looks like.
............................................................................................................ 4
Section 1.4. And Inventory.java...
................................................................................................................................................... 5
Section 1.5. But then Rick started losing customers....
.................................................................................................................. 6
Section 1.6. What's the FIRST thing you'd change?.
...................................................................................................................... 8
Section 1.7. Great software is... more than just one thing
............................................................................................................ 12
Section 1.8. Great software in 3 easy steps
................................................................................................................................... 13
Section 1.9. Remember Rick? Remember his lost customers?
..................................................................................................... 14
Section 1.10. So let's apply our 3 steps:
......................................................................................................................................... 14
Section 1.11. Ditching String comparisons
.................................................................................................................................... 16
Section 1.12. Rick's customers want choices!
................................................................................................................................ 21
Section 1.13. Test drive
.................................................................................................................................................................. 23
Section 1.14. Back to our steps
...................................................................................................................................................... 24
Section 1.15. Looking for problems
............................................................................................................................................... 25
Section 1.16. Analyze the search() method
................................................................................................................................... 26
Section 1.17. Now update your own code
..................................................................................................................................... 30
Section 1.18. Update the Inventory class
...................................................................................................................................... 32
Section 1.19. Getting ready for another test drive
........................................................................................................................ 33
Section 1.20. Getting back to Rick's app...
.................................................................................................................................... 35
Section 1.21. Design once, design twice
........................................................................................................................................ 36
Section 1.22. Let's make sure Inventory.java is (really) well-designed
........................................................................................ 37
Section 1.23. Design Puzzle
........................................................................................................................................................... 42
Section 1.24. Design Puzzle Solution
............................................................................................................................................ 44
Section 1.25. One last test drive (and an app ready for reuse)
..................................................................................................... 46
Section 1.26. What we did
............................................................................................................................................................. 47
Section 1.27. Remember this poor guy?
....................................................................................................................................... 48
Section 1.28. OOA&D is about writing great software, not doing a bunch of paperwork!
.......................................................... 49
Section 1.29. OOA&D Cross
........................................................................................................................................................... 51
Chapter 1. well-designed apps rock: Great Software Begins Here
Head First Object-Oriented Analysis and Design By Brett McLaughlin, Gary Pollice, David
West ISBN: 0596008678 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2006/11/01 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Chapter 1. well-designed apps rock: Great Software Begins Here
Page 1
Return to Table of Contents
well-designed apps rock
1
Great Software
Begins Here
,FDQKDUGO\JHWRYHULW
6XHEXWVLQFH,VWDUWHGXVLQJ
22$',·PMXVWDQHZPDQD
QHZPDQ,·OOWHOO\RX
So how do you really write great software?
It’s never easy
WU\LQJWR¿JXUHRXW
where to start
. Does the application actually
do what
it’s supposed to
? And what about things like duplicate code—that can’t be
good, can it? It’s usually pretty hard to know
ZKDW\RXVKRXOGZRUNRQ¿UVW
,
and still make sure you don’t screw everything else up in the process. No
worries here, though. By the time you’re done with this chapter, you’ll
know
how to write great software
, and be well on your way to improving the way
you develop applications forever. Finally, you’ll understand why
OOA&D
is a
four-letter word that your mother actually
wants
you to know about.
1
this is a new chapter
Chapter 1. well-designed apps rock: Great Software Begins Here
Head First Object-Oriented Analysis and Design By Brett McLaughlin, Gary Pollice, David
West ISBN: 0596008678 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2006/11/01 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Chapter 1. well-designed apps rock: Great Software Begins Here
Page 2
Return to Table of Contents
the sounds of
wood and steel
Rock and roll is forever!
There’s nothing better than the sound of a killer guitar in the hands
of a great player, and Rick’s Guitars specializes in finding the perfect
instrument for his discerning customers.
<RXZRXOGQ·WEHOLHYH
WKHVHOHFWLRQZHKDYHKHUH
&RPHRQLQWHOOXVDERXWZKDWNLQG
RIJXLWDU\RXOLNHDQGZH·OOÀQG
\RXWKHSHUIHFWLQVWUXPHQW
JXDUDQWHHG
Copyright Safari Books Online #1673621
Meet
Rick
, guita
r
afi
cionad
o, an
d own
er of
a
h
igh-e
nd gu
itar s
hop.
Just a few months ago, Rick decided to throw out his paper-based
system for keeping track of guitars, and start using a computer-based
system to store his inventory. He hired a popular programming firm,
Down and Dirty Coding, and they’ve already built him an inventory
management app. He’s even had the firm build him a new search
tool to help him match up a customer to their dream instrument.
2
&KDSWHU
Chapter 1. well-designed apps rock: Great Software Begins Here
Head First Object-Oriented Analysis and Design By Brett McLaughlin, Gary Pollice, David
West ISBN: 0596008678 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2006/11/01 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Chapter 1. well-designed apps rock: Great Software Begins Here
Page 3
Return to Table of Contents
ZHOOGHVLJQHG
DSSVURFN
5LFN¶VVKLQ\QHZDSSOLFDWLRQ
Here’s the application that the programming firm built for Rick... they’ve
put together a system to completely replace all of Rick’s handwritten
notes, and help him match his customers with the perfect guitar. Here’s
the UML class diagram they gave Rick to show him what they did:
Th
e inv
entor
y sto
res a
list
o
f all
the
guita
rs th
at R
ick
cur
rentl
y has
avail
able.
Guitar
serialNumber: String
price: double
builder: String
model: String
type: String
backWood: String
topWood: String
getSerialNumber(): String
getPrice(): double
VHW3ULFHÀRDW
getBuilder(): String
getModel(): String
getType(): String
getBackWood(): String
getTopWood(): String
Inventory
guitars: List
addGuitar(String, double, String, String, String,
String, String)
getGuitar(String): Guitar
search(Guitar): Guitar
New to Objectville?
If you’re new to object oriented programming, haven’t heard of UML before,
or aren’t sure about the diagram above, it’s OK! We’ve prepared a special
“Welcome to Objectville” care package for you to get you started. Flip to the
back of the book, and read Appendix II—we promise you’ll be glad you did.
Then come back here, and this will all make a lot more sense.
3
you are here
Chapter 1. well-designed apps rock: Great Software Begins Here
Head First Object-Oriented Analysis and Design By Brett McLaughlin, Gary Pollice, David
West ISBN: 0596008678 Publisher: O'Reilly
Prepared for Ann Cherkis, Safari ID: maottw@gmail.com
Print Publication Date: 2006/11/01 User number: 1673621 Copyright 2008, Safari Books Online, LLC.
This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior
written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that
otherwise violates the Safari Terms of Service is strictly prohibited.
Plik z chomika:
rafalod
Inne pliki z tego folderu:
OReilly.Head.First.SQL.2007.pdf
(47873 KB)
OReilly.Head.First.Javascript.2007.pdf
(51807 KB)
Head First Java 2nd Ed.pdf
(111092 KB)
OReilly.Head.First.Object.Oriented.Analysis.and.Design.2006.pdf
(80252 KB)
OReilly.Head.First.PHP.and.MySQL.2008.pdf
(67934 KB)
Inne foldery tego chomika:
Pliki dostępne do 01.06.2025
6. tablica
CakePHP
część I
część II
Zgłoś jeśli
naruszono regulamin