本書(shū)主要從軟件工程的角度介紹面向?qū)ο蠛统绦蛟O(shè)計(jì)的基本概念,側(cè)重于講解面向?qū)ο蟪绦蛟O(shè)計(jì)原理,而不是Java語(yǔ)言細(xì)節(jié)。書(shū)中從面向?qū)ο蟮幕A(chǔ)知識(shí)講起,介紹了對(duì)象和類;然后深入到應(yīng)用結(jié)構(gòu),講解了繼承、抽象技術(shù)、構(gòu)建圖形用戶界面、錯(cuò)誤處理;最后給出了一個(gè)完整的案例。書(shū)中使用兩個(gè)工具實(shí)際運(yùn)用所介紹的概念:Java編程語(yǔ)言以及Java編程環(huán)境BlueJ。全書(shū)按照項(xiàng)目驅(qū)動(dòng)的方式來(lái)展開(kāi),討論了大量的程序項(xiàng)目,并且提供了很多練習(xí)。
本書(shū)內(nèi)容由淺入深,適合初學(xué)者快速入門,也適合高級(jí)程序員和專業(yè)人士學(xué)習(xí)參考,可作為計(jì)算機(jī)相關(guān)專業(yè)“面向?qū)ο蟪绦蛟O(shè)計(jì)”課程的教材。
David J.Barnes,任教于英國(guó)肯特大學(xué),有超過(guò)25年的程序設(shè)計(jì)教學(xué)經(jīng)驗(yàn),主要研究興趣是程序設(shè)計(jì)、軟件測(cè)試、計(jì)算機(jī)科學(xué)教學(xué)。
Part 1 Foundations of object orientation
Chapter 1 Objects and classes
1.1 Objects and classes
1.2 Creating objects
1.3 Calling methods
1.4 Parameters
1.5 Data types
1.6 Multiple instances
1.7 State
1.8 What is in an object?
1.9 Object interaction
1.10 Source code
1.11 Another example
1.12 Return values
1.13 Objects as parameters
1.14 Summary
Chapter 2 Understanding class definitions
2.1 Ticket machines
2.1.1 Exploring the behavior of a naTve ticket machine
2.2 Examining a class definition
2.3 Fields, constructors, and methods
2.3.1 Fields
2.3.2 Constructors
2.4 Passing data via parameters
2.5 Assignment
2.6 Accessor methods
2.7 Mutator methods
2.8 Printing from methods
2.9 Summary of the naive ticket machine
2.10 Reflecting on the design of the ticket machine
2.11 Making choices: the conditional statement
2.12 A further conditional-statement example
2.13 Local variables
2.14 Fields, parameters, and local variables
2.15 Summary of the better ticket machine
2.16 Self-review exercises
2.17 Reviewing a familiar example
2.18 Summary
Chapter 3 Object interaction
3.1 The clock example
3.2 Abstraction and modularization
3.3 Abstraction in software
3.4 Modularization in the clock example
3.5 Implementing the clock display
3.6 Class diagrams versus object diagrams
3.7 Primitive types and object types
3.8 The ClockDisplay source code
3.8.1 Class NumberDisplay
3.8.2 String concatenation
3.8.3 The modulo operator
3.8.4 Class ClockDisplay
3.9 Objects creating objects
3.10 Multiple constructors
3.11 Method calls
3.11.1 Internal method calls
3.11.2 External method calls
3.11.3 Summary of the clock display
3.12 Another example of object interaction
3.12.1 The mail system example
3.12.2 The this key word
3.13 Using a debugger
3.13.1 Setting breakpoints
3.13.2 Single stepping
3.13.3 Stepping into methods
3.14 Method calling revisited
3.15 Summary
……
Part 2 Application structures
Appendices
Index