وبلاگ بلیان

Objects First With Java: A Practical Introduction Using BlueJ (4th Edition)

معرفی کتاب «Objects First With Java: A Practical Introduction Using BlueJ (4th Edition)» نوشتهٔ Barnes, Barnes David John; Kölling, Michael در سال 2008. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Objects First With Java: A Practical Introduction Using BlueJ (4th Edition)» در دستهٔ بدون دسته‌بندی قرار دارد.

the Bluej Development Environment Was Specifically Designed To Support Introductory Teaching Of Object-orientations And Helps Users Grasp The Complicated Concepts Of Class Structure. Unlike Most Books On The Subject, This Text Uses Bluej To Get Readers Started On Object-oriented Programming From Day One. uses A Spiral Approach That Introduces A Topic In A Simple Context Early On, Then Revisits It Later To Increase Understanding; Offers An Abundance Of Projects For Hands-on Practice; Chapters Are Ordered Around Software Development Concepts Rather Than Language Features; Language-feature Introduction Is Naturally Driven By Problems To Be Solved; Chapters Are Based Around Distinct Projects For More Variety; Does Not Cover Traditional Topics Like Control Structures. a Useful Reference For Programmers. Cover......Page 1 Contents......Page 8 Foreword......Page 19 Preface to the instructor......Page 20 Guided Tour......Page 28 List of projects discussed in detail in this book......Page 30 Acknowledgments......Page 32 Part 1 Foundations of object orientation......Page 36 1.1 Objects and classes......Page 38 1.2 Creating objects......Page 39 1.3 Calling methods......Page 40 1.4 Parameters......Page 41 1.5 Data types......Page 42 1.7 State......Page 43 1.8 What is in an object?......Page 44 1.9 Object interaction......Page 45 1.10 Source code......Page 46 1.12 Return values......Page 48 1.13 Objects as parameters......Page 49 1.14 Summary......Page 50 2.1 Ticket machines......Page 53 2.2 Examining a class definition......Page 55 2.3 Fields, constructors, and methods......Page 57 2.4 Passing data via parameters......Page 62 2.5 Assignment......Page 64 2.6 Accessor methods......Page 65 2.7 Mutator methods......Page 67 2.8 Printing from methods......Page 69 2.9 Summary of the naïve ticket machine......Page 71 2.10 Reflecting on the design of the ticket machine......Page 72 2.11 Making choices: the conditional statement......Page 75 2.12 A further conditional-statement example......Page 76 2.13 Local variables......Page 77 2.14 Fields, parameters, and local variables......Page 79 2.16 Self-review exercises......Page 80 2.17 Reviewing a familiar example......Page 82 2.18 Experimenting with expressions: The Code Pad......Page 85 2.19 Summary......Page 87 3.1 The clock example......Page 91 3.2 Abstraction and modularization......Page 92 3.4 Modularization in the clock example......Page 93 3.5 Implementing the clock display......Page 94 3.6 Class diagrams versus object diagrams......Page 95 3.8 The ClockDisplay source code......Page 98 3.9 Objects creating objects......Page 106 3.11 Method calls......Page 108 3.12 Another example of object interaction......Page 111 3.13 Using a debugger......Page 114 3.14 Method calling revisited......Page 118 3.15 Summary......Page 119 4.1 Grouping objects in flexible-size collections......Page 122 4.3 A first look at library classes......Page 123 4.4 Object structures with collections......Page 126 4.5 Generic classes......Page 127 4.6 Numbering within collections......Page 128 4.7 Removing an item from a collection......Page 129 4.8 Processing a whole collection......Page 131 4.9 Summary of the notebook example......Page 140 4.10 Another example: an auction system......Page 141 4.11 Flexible collection summary......Page 148 4.12 Fixed-size collections......Page 149 4.13 Summary......Page 161 Chapter 5 More sophisticated behavior......Page 163 5.1 Documentation for library classes......Page 164 5.2 The TechSupport system......Page 165 5.3 Reading class documentation......Page 171 5.4 Adding random behavior......Page 175 5.5 Packages and import......Page 181 5.6 Using maps for associations......Page 182 5.7 Using sets......Page 187 5.8 Dividing strings......Page 188 5.9 Finishing the TechSupport system......Page 189 5.10 Writing class documentation......Page 191 5.11 Public versus private......Page 193 5.12 Learning about classes from their interfaces......Page 196 5.13 Class variables and constants......Page 198 5.14 Summary......Page 201 6.1 Introduction......Page 204 6.3 Unit testing within BlueJ......Page 205 6.4 Test automation......Page 212 6.5 Modularization and interfaces......Page 221 6.7 Commenting and style......Page 223 6.8 Manual walkthroughs......Page 225 6.9 Print statements......Page 230 6.10 Choosing a test strategy......Page 233 6.11 Debuggers......Page 234 6.13 Summary......Page 235 7.1 Introduction......Page 236 7.2 The world-of-zuul game example......Page 238 7.3 Introduction to coupling and cohesion......Page 240 7.4 Code duplication......Page 241 7.5 Making extensions......Page 245 7.6 Coupling......Page 247 7.7 Responsibility-driven design......Page 252 7.9 Implicit coupling......Page 255 7.10 Thinking ahead......Page 259 7.11 Cohesion......Page 260 7.12 Refactoring......Page 263 7.13 Refactoring for language independence......Page 268 7.14 Design guidelines......Page 272 7.15 Executing without BlueJ......Page 273 7.16 Summary......Page 275 Part 2 Application structures......Page 278 8.1 The DoME example......Page 280 8.2 Using inheritance......Page 291 8.3 Inheritance hierarchies......Page 292 8.4 Inheritance in Java......Page 293 8.5 DoME: adding other item types......Page 297 8.6 Advantages of inheritance (so far)......Page 299 8.7 Subtyping......Page 300 8.8 The Object class......Page 306 8.9 Autoboxing and Wrapper classes......Page 307 8.11 Summary......Page 308 9.1 The problem: DoME’s print method......Page 311 9.2 Static type and dynamic type......Page 313 9.3 Overriding......Page 316 9.4 Dynamic method lookup......Page 317 9.5 Super call in methods......Page 320 9.7 Object methods: toString......Page 322 9.8 Object equality: equals and hashCode......Page 325 9.9 Protected access......Page 327 9.10 The instanceof operator......Page 329 9.11 Another example of inheritance with overriding......Page 330 9.12 Summary......Page 332 10.1 Simulations......Page 335 10.2 The foxes-and-rabbits simulation......Page 336 10.3 Abstract classes......Page 351 10.4 More abstract methods......Page 357 10.5 Multiple inheritance......Page 359 10.6 Interfaces......Page 363 10.8 Summary......Page 369 11.1 Introduction......Page 372 11.3 AWT and Swing......Page 373 11.4 The ImageViewer example......Page 374 11.5 ImageViewer 1.0: the first complete version......Page 386 11.6 ImageViewer 2.0: improving program structure......Page 400 11.7 ImageViewer 3.0: more interface components......Page 405 11.8 Further extensions......Page 409 11.9 Another example: SoundPlayer......Page 411 11.10 Summary......Page 414 Chapter 12 Handling errors......Page 416 12.1 The address-bookproject......Page 417 12.2 Defensive programming......Page 421 12.3 Server error reporting......Page 424 12.4 Exception-throwing principles......Page 428 12.5 Exception handling......Page 434 12.6 Defining new exception classes......Page 440 12.7 Using assertions......Page 442 12.8 Error recovery and avoidance......Page 445 12.9 File-based input/output......Page 448 12.10 Summary......Page 457 13.1 Analysis and design......Page 459 13.2 Class design......Page 466 13.3 Documentation......Page 467 13.4 Cooperation......Page 468 13.6 Software growth......Page 469 13.7 Using design patterns......Page 471 13.8 Summary......Page 477 14.1 The case study......Page 479 14.2 Analysis and design......Page 480 14.3 Class design......Page 484 14.4 Iterative development......Page 490 14.5 Another example......Page 498 14.6 Taking things further......Page 499 A: Working with a BlueJ project......Page 500 B: Java data types......Page 503 C: Operators......Page 506 D: Java control structures......Page 509 E: Running Java without BlueJ......Page 515 F: Using the debugger......Page 518 G: JUnit unit-testing tools......Page 522 H: Teamwork tools......Page 524 I: Javadoc......Page 526 J: Program style guide......Page 529 K: Important library classes......Page 533 A......Page 537 C......Page 538 D......Page 540 E......Page 541 G......Page 542 I......Page 543 J......Page 544 M......Page 545 O......Page 546 P......Page 547 S......Page 548 T......Page 550 Z......Page 551 Cover 1 Contents 8 Foreword 19 Preface to the instructor 20 Guided Tour 28 List of projects discussed in detail in this book 30 Acknowledgments 32 Part 1 Foundations of object orientation 36 Chapter 1 Objects and classes 38 1.1 Objects and classes 38 1.2 Creating objects 39 1.3 Calling methods 40 1.4 Parameters 41 1.5 Data types 42 1.6 Multiple instances 43 1.7 State 43 1.8 What is in an object? 44 1.9 Object interaction 45 1.10 Source code 46 1.11 Another example 48 1.12 Return values 48 1.13 Objects as parameters 49 1.14 Summary 50 Chapter 2 Understanding class definitions 53 2.1 Ticket machines 53 2.2 Examining a class definition 55 2.3 Fields, constructors, and methods 57 2.4 Passing data via parameters 62 2.5 Assignment 64 2.6 Accessor methods 65 2.7 Mutator methods 67 2.8 Printing from methods 69 2.9 Summary of the naïve ticket machine 71 2.10 Reflecting on the design of the ticket machine 72 2.11 Making choices: the conditional statement 75 2.12 A further conditional-statement example 76 2.13 Local variables 77 2.14 Fields, parameters, and local variables 79 2.15 Summary of the better ticket machine 80 2.16 Self-review exercises 80 2.17 Reviewing a familiar example 82 2.18 Experimenting with expressions: The Code Pad 85 2.19 Summary 87 Chapter 3 Object interaction 91 3.1 The clock example 91 3.2 Abstraction and modularization 92 3.3 Abstraction in software 93 3.4 Modularization in the clock example 93 3.5 Implementing the clock display 94 3.6 Class diagrams versus object diagrams 95 3.7 Primitive types and object types 98 3.8 The ClockDisplay source code 98 3.9 Objects creating objects 106 3.10 Multiple constructors 108 3.11 Method calls 108 3.12 Another example of object interaction 111 3.13 Using a debugger 114 3.14 Method calling revisited 118 3.15 Summary 119 Chapter 4 Grouping objects 122 4.1 Grouping objects in flexible-size collections 122 4.2 A personal notebook 123 4.3 A first look at library classes 123 4.4 Object structures with collections 126 4.5 Generic classes 127 4.6 Numbering within collections 128 4.7 Removing an item from a collection 129 4.8 Processing a whole collection 131 4.9 Summary of the notebook example 140 4.10 Another example: an auction system 141 4.11 Flexible collection summary 148 4.12 Fixed-size collections 149 4.13 Summary 161 Chapter 5 More sophisticated behavior 163 5.1 Documentation for library classes 164 5.2 The TechSupport system 165 5.3 Reading class documentation 171 5.4 Adding random behavior 175 5.5 Packages and import 181 5.6 Using maps for associations 182 5.7 Using sets 187 5.8 Dividing strings 188 5.9 Finishing the TechSupport system 189 5.10 Writing class documentation 191 5.11 Public versus private 193 5.12 Learning about classes from their interfaces 196 5.13 Class variables and constants 198 5.14 Summary 201 Chapter 6 Well-behaved objects 204 6.1 Introduction 204 6.2 Testing and debugging 205 6.3 Unit testing within BlueJ 205 6.4 Test automation 212 6.5 Modularization and interfaces 221 6.6 A debugging scenario 223 6.7 Commenting and style 223 6.8 Manual walkthroughs 225 6.9 Print statements 230 6.10 Choosing a test strategy 233 6.11 Debuggers 234 6.12 Putting the techniques into practice 235 6.13 Summary 235 Chapter 7 Designing classes 236 7.1 Introduction 236 7.2 The world-of-zuul game example 238 7.3 Introduction to coupling and cohesion 240 7.4 Code duplication 241 7.5 Making extensions 245 7.6 Coupling 247 7.7 Responsibility-driven design 252 7.8 Localizing change 255 7.9 Implicit coupling 255 7.10 Thinking ahead 259 7.11 Cohesion 260 7.12 Refactoring 263 7.13 Refactoring for language independence 268 7.14 Design guidelines 272 7.15 Executing without BlueJ 273 7.16 Summary 275 Part 2 Application structures 278 Chapter 8 Improving structure with inheritance 280 8.1 The DoME example 280 8.2 Using inheritance 291 8.3 Inheritance hierarchies 292 8.4 Inheritance in Java 293 8.5 DoME: adding other item types 297 8.6 Advantages of inheritance (so far) 299 8.7 Subtyping 300 8.8 The Object class 306 8.9 Autoboxing and Wrapper classes 307 8.10 The collection hierarchy 308 8.11 Summary 308 Chapter 9 More about inheritance 311 9.1 The problem: DoME’s print method 311 9.2 Static type and dynamic type 313 9.3 Overriding 316 9.4 Dynamic method lookup 317 9.5 Super call in methods 320 9.6 Method polymorphism 322 9.7 Object methods: toString 322 9.8 Object equality: equals and hashCode 325 9.9 Protected access 327 9.10 The instanceof operator 329 9.11 Another example of inheritance with overriding 330 9.12 Summary 332 Chapter 10 Further abstraction techniques 335 10.1 Simulations 335 10.2 The foxes-and-rabbits simulation 336 10.3 Abstract classes 351 10.4 More abstract methods 357 10.5 Multiple inheritance 359 10.6 Interfaces 363 10.7 Summary of inheritance 369 10.8 Summary 369 Chapter 11 Building graphical user interfaces 372 11.1 Introduction 372 11.2 Components, layout, and event handling 373 11.3 AWT and Swing 373 11.4 The ImageViewer example 374 11.5 ImageViewer 1.0: the first complete version 386 11.6 ImageViewer 2.0: improving program structure 400 11.7 ImageViewer 3.0: more interface components 405 11.8 Further extensions 409 11.9 Another example: SoundPlayer 411 11.10 Summary 414 Chapter 12 Handling errors 416 12.1 The address-bookproject 417 12.2 Defensive programming 421 12.3 Server error reporting 424 12.4 Exception-throwing principles 428 12.5 Exception handling 434 12.6 Defining new exception classes 440 12.7 Using assertions 442 12.8 Error recovery and avoidance 445 12.9 File-based input/output 448 12.10 Summary 457 Chapter 13 Designing applications 459 13.1 Analysis and design 459 13.2 Class design 466 13.3 Documentation 467 13.4 Cooperation 468 13.5 Prototyping 469 13.6 Software growth 469 13.7 Using design patterns 471 13.8 Summary 477 Chapter 14 A case study 479 14.1 The case study 479 14.2 Analysis and design 480 14.3 Class design 484 14.4 Iterative development 490 14.5 Another example 498 14.6 Taking things further 499 Appendices 500 A: Working with a BlueJ project 500 B: Java data types 503 C: Operators 506 D: Java control structures 509 E: Running Java without BlueJ 515 F: Using the debugger 518 G: JUnit unit-testing tools 522 H: Teamwork tools 524 I: Javadoc 526 J: Program style guide 529 K: Important library classes 533 Index 537 A 537 B 538 C 538 D 540 E 541 F 542 G 542 H 543 I 543 J 544 K 545 L 545 M 545 N 546 O 546 P 547 R 548 S 548 T 550 U 551 V 551 W 551 Z 551
دانلود کتاب Objects First With Java: A Practical Introduction Using BlueJ (4th Edition)