Monday, 24 February 2014

C# How to Program C# Deitel and Deitel

Welcome to C# and the world of Windows, Internet and World-Wide-Web programming
with Visual Studio and the .NET platform! This book is the second in our new .NET How
to Program series, which presents various leading-edge computing technologies in the context
of the .NET platform.

C# is the next phase in the evolution of C and C++ and was developed expressly for
Microsoft’s .NET platform. C# provides the features that are most important to programmers,
such as object-oriented programming, strings, graphics, graphical-user-interface
(GUI) components, exception handling, multithreading, multimedia (audio, images, animation
and video), file processing, prepackaged data structures, database processing,
Internet and World-Wide-Web-based client/server networking and distributed computing.
The language is appropriate for implementing Internet- and World-Wide-Web-based applications
that seamlessly integrate with PC-based applications.
C# How to Program C# Deitel and Deitel


The .NET platform offers powerful capabilities for software development and deployment,
including independence from a specific language or platform. Rather than requiring
developers to learn a new programming language, programmers can contribute to the same
software project, but write code using any (or several) of the .NET languages (such as C#,
Visual Basic .NET, Visual C++ .NET and others) with which they are most competent. In
addition to providing language independence, .NET extends program portability by
enabling .NET applications to reside on, and communicate across, multiple platforms—
thus facilitating the delivery of Web services over the Internet. The .NET platform enables
Web-based applications to be distributed to consumer-electronic devices, such as cell
Preface XXXIX
phones and personal digital assistants, as well as to desktop computers. The capabilities that
Microsoft has incorporated into the .NET platform create a new software-development paradigm
that will increase programmer productivity and decrease development time.
New Features in C# How to Program
This edition contains many new features and enhancements, including:
• Full-Color Presentation. This book is now in full color. Full color enables readers
to see sample outputs as they would appear on a color monitor. Also, we now syntax
color the C# code, similar to the way Visual Studio .NET colors the code in its
editor window. Our syntax-coloring conventions are as follows:
comments appear in green
keywords appear in dark blue
literal values appear in light blue
text, class, method and variable names appear in black
errors and ASP .NET directives appear in red
• “Code Washing.” This is our term for the process we use to format the programs
in the book so that they have a carefully commented, open layout. The code appears
in full color and is grouped into small, well-documented pieces. This greatly
improves code readability—an especially important goal for us, considering that
this book contains approximately 23,500 lines of code.
• Web Services and ASP .NET. Microsoft’s .NET strategy embraces the Internet
and Web as integral to the software development and deployment processes. Web
services—a key technology in this strategy—enables information sharing, commerce
and other interactions using standard Internet protocols and technologies,
such as Hypertext Transfer Protocol (HTTP), Simple Object Access Protocol
(SOAP) and Extensible Markup Language (XML). Web services enable programmers
to package application functionality in a form that turns the Web into a library
of reusable software components. In Chapter 21, ASP .NET and Web
Services, we present a Web service that allows users to make airline seat reservations.
In this example, a user accesses a Web page, chooses a seating option and
submits the page to the Web server. The page then calls a Web service that checks
seat availability. We also present information related to Web services in Appendix
P, Crystal Reports® for Visual Studio® .NET, which discusses popular reporting
software for database-intensive applications. Crystal Reports, which is integrated
into Visual Studio .NET, provides the ability to expose a report as a Web service.
The appendix provides introductory information and directs readers to a walkthrough
of this process on the Crystal Decisions Web site (www.crystaldecisions.
com/net).
• Web Forms, Web Controls and ASP .NET. Application developers must be able
to create robust, scalable Web-based applications. The .NET platform architecture
supports such applications. Microsoft’s .NET server-side technology, Active
Server Pages (ASP) .NET, allows programmers to build Web documents that respond
to client requests. To enable interactive Web pages, server-side programs
process information users input into HTML forms. ASP .NET is a significant deXL
Preface
parture from previous versions of ASP, allowing developers to program Webbased
applications using the powerful object-oriented languages of .NET. ASP
.NET also provides enhanced visual programming capabilities, similar to those
used in building Windows forms for desktop programs. Programmers can create
Web pages visually, by dragging and dropping Web controls onto Web forms.
Chapter 20, ASP .NET, Web Forms and Web Controls, introduces these powerful
technologies.
• Object-Oriented Programming. Object-oriented programming is the most widely
employed technique for developing robust, reusable software, and C# offers enhanced
object-oriented programming features. This text offers a rich presentation
of object-oriented programming. Chapter 8, Object-Based Programming, introduces
how to create classes and objects. These concepts are extended in Chapter
9, Object-Oriented Programming: Inheritance, which discusses how programmers
can create new classes that “absorb” the capabilities of existing classes. Chapter
10, Object-Oriented Programming: Polymorphism, familiarizes the reader with
the crucial concepts of polymorphism, abstract classes, concrete classes and interfaces,
which facilitate powerful manipulations among objects belonging to an inheritance
hierarchy.
• XML. Use of Extensible Markup Language (XML) is exploding in the softwaredevelopment
industry, the e-business and e-commerce communities, and is pervasive
throughout the .NET platform. Because XML is a platform-independent technology
for describing data and for creating markup languages, XML’s data
portability integrates well with C#’s portable applications and services. Chapter
18, Extensible Markup Language (XML), introduces XML. In this chapter, we introduce
basic XML markup and discuss the technologies such as DTDs and Schema,
which are used to validate XML documents’ contents. We also explain how
to programmatically manipulate XML documents using the Document Object
Model (DOM™) and how to transform XML documents into other types of documents
via Extensible Stylesheet Language Transformations (XSLT).
• Multithreading. Computers enable us to perform many tasks in parallel (or concurrently),
such as printing documents, downloading files from a network and
surfing the Web. Multithreading is the technology through which programmers
can develop applications that perform concurrent tasks. Historically, a computer
has contained a single, expensive processor, which its operating system would
share among all applications. Today, processors are becoming so inexpensive that
it is possible to build affordable computers that contain many processors that work
in parallel—such computers are called multiprocessors. Multithreading is effective
on both single-processor and multiprocessor systems. C#’s multithreading capabilities
make the platform and its related technologies better prepared to deal
with today’s sophisticated multimedia-intensive, database-intensive, networkbased,
multiprocessor-based distributed applications. Chapter 14, Multithreading,
provides a detailed discussion of multithreading.
• ADO .NET. Databases store vast amounts of information that individuals and organizations
must access to conduct business. As an evolution of Microsoft's ActiveX
Data Objects (ADO), ADO .NET represents a new approach for building
Preface XLI
applications that interact with databases. ADO .NET uses XML and an enhanced
object model to provide developers with the tools they need to access and manipulate
databases for large-scale, extensible, mission-critical multi-tier applications.
Chapter 19, Database, SQL and ADO .NET, details the capabilities of ADO .NET
and the Structured Query Language (SQL) to manipulate databases.
• Visual Studio .NET Debugger. Debuggers are programs that help programmers
find and correct logic errors in program code. Visual Studio .NET contains a powerful
debugging tool that allows programmers to analyze their programs line-byline
as those programs execute. In Appendix D, Visual Studio .NET Debugger, we
explain how to use key debugger features, such as setting breakpoints and “watches,”
stepping into and out of procedures, and examining the procedure call stack.
• COM (Component Object Model) Integration. Prior to the introduction of .NET,
many organizations spent tremendous amounts of time and money creating reusable
software components called COM components, which include ActiveX®
controls and ActiveX DLLs (dynamic link libraries) for Windows applications. In
Appendix H, COM Integration, we discuss some of the tools available in Visual
Studio .NET for integrating these legacy components into .NET applications. This
integration allows programmers to use existing sets of COM-based controls with
.NET components.
• XML Documentation. Documenting program code is crucial for software development,
because different programmers often work on an application during the
software’s lifecycle, which usually includes multiple versions and can span many
years. If programmers document software code and methods, other programmers
working on the application can learn and understand the logic underlying the code,
thus saving time and avoiding misunderstandings. To automate documenting programs,
Visual Studio .NET provides an XML tool for C# programmers. Appendix
E, XML Documentation, explains how a programmer can insert comments in the
code, which produces a separate file providing the code documentation.
• Career Opportunities. Appendix C, Career Opportunities, introduces career services
available on the Internet. We explore online career services from both the
employer’s and employee’s perspectives. We list many Web sites at which you
can submit applications, search for jobs and review applicants (if you are interested
in hiring someone). We also review services that build recruiting pages directly
into e-businesses. One of our reviewers told us that he had used the Internet as a
primary tool in a recent job search, and that this appendix would have helped him
expand his search dramatically.
• Unicode. As computer systems evolved worldwide, computer vendors developed
numeric representations of character sets and special symbols for the local languages
spoken in different countries. In some cases, different representations were
developed for the same languages. Such disparate character sets hindered communication
among computer systems. C# supports the Unicode Standard (maintained
by a non-profit organization called the Unicode Consortium), which
maintains a single character set that specifies unique numeric values for characters
and special symbols in most of the world’s languages. Appendix G, Unicode, discusses
the standard, overviews the Unicode Consortium Web site (www.uniXLII
Preface
code.org) and presents a C# application that displays “Welcome to Unicode!”
in several languages.
• XHTML. The World Wide Web Consortium (W3C) has declared HTML to be a
legacy technology that will undergo no further development. HTML is being replaced
by the Extensible Hypertext Markup Language (XHTML)—an XMLbased
technology that is rapidly becoming the standard for describing Web content.
We use XHTML in Chapter 18, Extensible Markup Language (XML), and
offer an introduction to the technology in Appendix K, Introduction to XHTML:
Part 1, and Appendix L, Introduction to XHTML: Part 2. These appendices overview
headers, images, lists, image maps and other features of this emerging markup
language. (We also present a treatment of HTML in Appendices I and J,
because ASP .NET, used in Chapters 20 and 21, generates HTML content).
• Accessibility. Although the World Wide Web has become an important part of
many people’s lives, the medium currently presents many challenges to people
with disabilities. Individuals with hearing and visual impairments, in particular,
have difficulty accessing multimedia-rich Web sites. In an attempt to improve this
situation, the World Wide Web Consortium (W3C) launched the Web Accessibility
Initiative (WAI), which provides guidelines for making Web sites accessible
to people with disabilities. Chapter 24, Accessibility, describes these guidelines
and highlights various products and services designed to improve the Web-browsing
experiences of individuals with disabilities. For example, the chapter introduces
VoiceXML and CallXML—two XML-based technologies for increasing the
accessibility of Web-based content for people with visual impairments.
• Bit Manipulation. Computers work with data in the form of binary digits, or bits,
which can assume the values 1 or 0. Computer circuitry performs various simple
bit manipulations, such as examining the value of a bit, setting the value of a bit
and reversing a bit (from 1 to 0 or from 0 to 1). Operating systems, test-equipment,
networking software and many other kinds of software require that programs communicate
“directly with the hardware” by using bit manipulation. Appendix O, Bit
Manipulation, overviews the bit manipulation capabilities that the .NET Framework
provides.

0 comments:

Post a Comment