Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 540 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
540
Dung lượng
6,02 MB
Nội dung
this print for content only—size & color not accurate spine = 1.028" 544 page count
Books for professionals By professionals
®
Accelerated C# 2008
Dear Reader,
In your hands is a guide to creating effective C# 3.0 code. This book focuses
precisely on the C# 3.0 language, showing you how to write programs that are
robust, fault-tolerant, and ready to be put into widely available libraries.
Accelerated C#2008 won’t burden your time with endless discussions of
libraries. Instead, it presents you with a well organized, focused and easy-to-
read text about C# 3.0 and all of the tried and true idioms, patterns, and design
principles developed in the object oriented arena during the lifetime of the
.NET Framework. With many short examples, I will show you how common
design patterns are used routinely in the .NET Framework and how you should
employ them in your own designs.
In this book I’ll explore with you all the new features of the C# 3.0 language
in detail, including extension methods, lambda expressions, and Language
Integrated Query (LINQ) among others. These are all exciting additions to C# 3.0
that foster a functional programming model within what has previously been
almost exclusively an imperative programming language. As you put these new
features of C# 3.0 to use, you’ll find that they expand your horizons and open
up new possibilities of solutions using functional programming techniques!
Another area of particular interest for C# developers is how we can write
exception-safe and fault-tolerant code. The .NET Framework includes several
facilities, including Critical Execution Regions, to help protect the state of your
application in the event of an asynchronous exception. In this book, I explain
how to use these new facilities to your advantage.
Have fun programming and remember, always defining a contract before
implementation, striving to be exception-neutral, and being frugal with your
resource usage are all keys to entering the halls of C# guru code-dom.
Trey Nash
Author of
Accelerated C# 2005
Coauthor of
Accelerated VB 2005
Accelerated VB 2008
US $39.99
Shelve in
Programming Languages/C#
User level:
Intermediate–Advanced
Nash
Accelerated C# 2008
The eXperT’s Voice
®
in .neT
Accelerated
C# 2008
cyan
MaGenTa
yelloW
Black
panTone 123 c
Trey Nash
Foreword by Wes Dyer
C# Language Design Team, Microsoft
Free Companion
eBook Available
THE APRESS ROADMAP
Pro LINQ:
Language Integrated
Query in C# 2008
Pro C#2008 and the
.NET 3.5 Framework, 4e
Illustrated C# 2008
Pro WCF: Practical Microsoft
SOA Implementation
Beginning C# 2008:
From Novice to Professional
Beginning
C# 2008 Databases:
From Novice to Professional
Accelerated C# 2008
Pro WPF in C# 2008:
Windows Presentation
Foundation with .NET 3.5, 2e
www.apress.com
SOURCE CODE ONLINE
Free Companion eBook
For a limited time only.
See last page for details.
ISBN-13: 978-1-59059-873-3
ISBN-10: 1-59059-873-3
9 781590 598733
5 3 9 9 9
For a limited time,
get the free, fully searchable
eBook—a $20 value!
See last page for details.
Offer ends June 30, 2008.
For a limited time,
get the free, fully searchable
eBook—a $20 value!
See last page for details.
Offer ends June 30, 2008.
[...]... NET Since C# derives its syntax from both C++ and Java, I don’t spend much time covering C# syntax, except where it differs starkly from C++ or Java If you already know some C#, you may find yourself skimming or even skipping Chapters 1 through 3 Chapter 1, C# Preview,” gives a quick glimpse of what a simple C# application looks like, and it describes some basic differences between the C# programming... However, you may want to read the section “Overview of What’s New in C# 3.0.” Differences Between C# and C++ C# is a strongly typed object-oriented language whose code visually resembles C++ (and Java) This decision by the C# language designers allows C++ developers to easily leverage their knowledge to quickly become productive in C#C# syntax differs from C++ in some ways, but most of the differences... Features Added in C# 2.0 Since its initial release in late 2000, the C# language has evolved considerably This evolution has likely been accelerated thanks to the wide adoption of C# With the release of Visual Studio 2005 and the NET Framework 2.0, the C# compiler supported the C# 2.0 enhancements to the language This was great news, since C# 2.0 included some handy features that provided a more natural... wealth of information and must understand how to use it correctly in order to produce sophisticated, robust, fault-tolerant C# applications In AcceleratedC#2008 I teach you what you need to know and explain how best to use your knowledge so that you can quickly develop true C# expertise Idioms and design patterns are invaluable for developing and applying expertise, and I show you how to use many... Chapter 4 C# allows you to develop applications rapidly while dealing with fewer mundane details than in a C++ environment At the same time, C# provides a language that feels familiar to either C++ or Java developers Example of a C# Program Let’s take a close look at a C# program Consider the venerable “Hello World!” program that everyone knows and loves A console version of it looks like this in C#: class... native C++ environment Chapter 2, C# and the CLR,” expands on Chapter 1 and quickly explores the managed environment within which C# applications run I introduce you to assemblies, the basic building blocks of applications into which C# code files are compiled Additionally, you’ll see how metadata makes assemblies self-describing Chapter 3, C# Syntax Overview,” surveys the C# language syntax I introduce... 11:04 AM Page xxiv 8733fmCMP4.qrk 10/16/07 11:04 AM Page xxv Introduction V isual C# NET (C#) is relatively easy to learn for anyone familiar with another object-oriented language Even someone familiar with Visual Basic 6.0, who is looking for an object-oriented language, will find C# easy to pick up However, although C#, coupled with the NET Framework, provides a quick path for creating simple applications,... Implementing the GetEnumerator method on container types is typically very tedious However, when using C# iterators, implementing the GetEnumerator method is a snap You can find more information regarding iterators in Chapter 9 Finally, C# 2.0 added support for partial types Prior to C# 2.0, you had to define each C# class entirely in one file (also called a compilation unit) This requirement was relaxed with... Page 6 CHAPTER 1 ■ C# PREVIEW Overview of What’s New in C# 3.0 C# 3.0 includes some great new features Most of the new features are stepping stones designed to support Language Integrated Query (LINQ) Nevertheless, all of them are extremely useful when used individually outside of the context of LINQ Many of them allow programmers to employ functional programming techniques more easily C# now supports... Chapter 10, “Delegates, Anonymous Functions, and Events,” shows you the mechanisms used within C# to provide callbacks Historically, all viable frameworks have always provided a mechanism to implement callbacks C# goes one step further and encapsulates callbacks into callable objects called delegates Additionally, C# 2.0 allows you to create delegates with an abbreviated syntax called anonymous functions .
Programming Languages /C#
User level:
Intermediate–Advanced
Nash
Accelerated C# 2008
The eXperT’s Voice
®
in .neT
Accelerated
C# 2008
cyan
MaGenTa
yelloW
. to entering the halls of C# guru code-dom.
Trey Nash
Author of
Accelerated C# 2005
Coauthor of
Accelerated VB 2005
Accelerated VB 2008
US $39.99
Shelve in