| |
| |
| |
内容简介
设计模式是优秀的、可修改的可重用方案,用于解决日常软件开发中的难题。这是一本指导C#程序如何使用设计模式的书。在书中,作者介绍了三大类(创建型、结构型和行为型)共23个模式,详细解释了如何用最常用的设计模式编写C#程序。
| |
|
顾客评论 |
|
目录
目 录 Preface Acknowledgments Part I Object-Oriented Programming in C# Chapter 1 What Am Design Patterns Defining Design Patterns The Learning Process Studying Design Patterns Notes on Object-Oriented Approaches C# Design Patterns How This Book Is Organized Chapter 2 Syntax of the O# Language Data Types Converting between Numbers and Strings Declaring Multiple Variables Numeric Constants Character Constants Variables Declaring Variables as You Use Them Multiple Equals Signs for Initialization A Simple C# Program Arithmetic Operators Increment and Decrement Operators Combining Arithmetic and Assignment Statements Making Decisions in C# Comparison Operators Combining Conditions The Most Common Mistake The Switch Statement C# Comments The Ornery Ternary Operator Looping Statements in C# The While Loop The Do-While Statement The For Loop Declaring Variables as Needed in For Loops Commas in For Loop Statements How C# Differs from C How C# Differs from Java Summary Chapter 3 Writing Windows C# Programs Objects in C# Managed Languages and Garbage Collection Classes and Namespaces in C# Building a C# Application The Simplest Window Program in C# Windows Controls Labels TextBox CheckBox Buttons Radio Buttons ListBoxes and ComboBoxes The Items Collection Menus ToolTips The Windows Controls Program Summary Programs on the CD-ROM Chapter 4 Using C/asses and Objects in C# What Do We Use Classes For A Simple Temperature Conversion Program Building a Temperature Class Converting to Kelvin Putting the Decisions into the Temperature Class Using Classes for Format and Value Conversion Handling Unreasonable Values A String Tokenizer Class Classes as Objects Class Containment Initialization Classes and Properties Programming Style in C# Delegates Indexers Operator Overloading Summary Programs on the CD-ROM Chapter 5 Inheritance Constructors Drawing and Graphics in C# Using Inheritance Namespaces Creating a Square from a Rectangle Public, Private, and Protected Overloading Virtual and Override Keywords Overriding Methods in Derived Classes Replacing Methods Using New Overriding Windows Controls Interfaces Abstract Classes Comparing Interfaces and Abstract Classes Summary Programs on the CD-ROM Chapter 6 UML Diagrams Inheritance Interfaces Composition Annotation WithClass UML Diagrams C# Project Files Chapter 7 Arrays, Files, and Exceptions in C# Arrays Collection Objects ArrayLists Hasbtables SortedLists Exceptions Multiple Exceptions Throwing Exceptions File Handling The File Object&nb | |