OOP with Microsoft Visual Basic .NET and Microsoft Visual C# Step by Step

Robin A Reynolds-Haertle

  • 出版商: MicroSoft
  • 出版日期: 2002-02-28
  • 售價: $1,580
  • 貴賓價: 9.5$1,501
  • 語言: 英文
  • 頁數: 393
  • 裝訂: Paperback
  • ISBN: 8120320077
  • ISBN-13: 9780735615687
  • 相關分類: .NETC#Visual BasicVisual C#
  • 已絕版

買這商品的人也買了...

商品描述

Description:

Learn object-oriented programming with the most popular development languages for the Microsoft® .NET Framework.

Embark upon object-oriented programming in the .NET era with this straightforward, accessible guide. Progress at your own pace from the basics through advanced OOP concepts with the help of clear instructions, candid reference notes and design tips, and engaging programming examples. Learn how to take full advantage of the objects provided by Visual Basic® .NET and Visual C#™—or how to create and implement your own objects. In less time than you thought possible, you’ll absorb object-oriented design concepts and terminology and understand how to construct elegant object-oriented programs with two of the most powerful development languages. Topics covered include:

• Writing your first object-oriented program
• Creating class instances with constructors
• Creating fields and properties
• Working with methods
• Using inheritance to create specialized classes
• Designing base classes and abstract classes
• Responding to changes with events and exceptions
• Putting it all together with components
• Providing services using interfaces
• Using classes interchangeably through polymorphism
• Using shared and static members
• Overloading operators with Visual C#
• Saving instance data
• Reducing complexity by design

INCLUDED ON CD-ROM:
• Sample code in Visual Basic .NET and Visual C#

 

 

Table of Contents:

Introduction ix
CHAPTER 1  Writing Your First Object-Oriented Program 1
    Reading Books: Your First Object-Oriented Program 2 / Using the Class View 16 / Creating the ReadBooks Program 22  
CHAPTER 2  Creating Class Instances with Constructors 29
    Constructors 29 / Reading Books: Another Implementation 30 / Reference and Value Types 38 / Understanding Array Declarations 40  
CHAPTER 3  Creating Fields and Properties 43
    Design Considerations for Properties 44 / Code Analysis: A Host of Properties 44 / Code Analysis: Using Indexers and Default Properties 58  
CHAPTER 4  Working with Methods 71
    A Deck of Cards 72  
CHAPTER 5  Using Inheritance to Create Specialized Classes 105
    Inheritance: An Overview 106 / BankAccount: A Simple Example 106 / Inherit from a Control: The RoundButton Class 127  
CHAPTER 6  Designing Base Classes as Abstract Classes 137
    Abstract Classes 138 / The BankAccount Class Revisited 139 / A Typed Collection Class 151  
CHAPTER 7  Responding to Changes with Events and Exceptions 163
    Fire on the Tracks! An Event-Driven Application 164 / Setting Up Event Methods Without Using the Designer 184 / Exceptions—When Things Go Wrong 187  
CHAPTER 8  Putting It All Together with Components 197
    The Memory Game 198 / The Games Class Library 201 / The Memory Game Application 232  
CHAPTER 9  Providing Services Using Interfaces 237
    An IMoveable Interface 237 / .NET Framework Interfaces 245 / Two Other Uses of Interfaces 263  
CHAPTER 10  Using Classes Interchangeably Through Polymorphism 267
    Pattern Maker 267 / Pattern Maker Design 268 / The Base Classes 271 / The Derived Classes 273 / The User Interface 285  
CHAPTER 11  Using Shared and Static Members 293
    Shared and Static Members 294 / A More Interesting Point 294 / A More Efficient Card 302 / The Singleton Pattern 309 / Design Considerations 314  
CHAPTER 12  Overloading Operators with Visual C# 317
    A Short Lesson on Vectors 318 / Vector Algebra Application 320  
CHAPTER 13  Saving Instance Data 331
    Serialization 331 / DataSets 348  
CHAPTER 14  Reducing Complexity by Design 359
    The .NET Design Guidelines 360 / Refactoring 368 / Design Patterns 372  
APPENDIX  Additional Resources 377
    Books 377 / Organizations 378  
INDEX 379