How to Program Series


"Live in fragments no longer, only connect."

Edgar Morgan Foster

Welcome to the world of Windows, Internet and Web programming with Visual Basic, Visual Studio 2005 and the .NET 2.0 platform! This book presents leading-edge computing technologies to software developers and IT professionals.

At Deitel & Associates, we write computer science textbooks for college students and professional books for software developers. We also teach this material in industry seminars at organizations worldwide.

This book was a joy to create. To start, we put the previous edition under the microscope:

  • We audited our presentation against the most recent Microsoft Visual Basic Language SpecificationVersion 8which can be downloaded from

    http://go.microsoft.com/fwlink/?LinkId=62990

  • We fully updated the book to Visual Studio 2005 and .NET 2.0.

  • All of the chapters have been significantly updated and upgraded.

  • We changed to an early classes and objects pedagogy. Now readers build reusable classes starting with a very friendly treatment in Chapter 4.

  • We updated our object-oriented presentation to use the latest version of the UML (Unified Modeling Language)UML™ 2.0the industry-standard graphical language for modeling object-oriented systems.

  • We added an optional OOD/UML automated teller machine (ATM) case study in Chapters 1, 39 and 11. The case study includes a complete Visual Basic code implementation of the ATM in Appendix J.

  • We added several multi-section, object-oriented programming case studies.

  • We incorporated key new features of Microsoft's latest release of Visual BasicVisual Basic 2005and added discussions on generics, .NET remoting and debugging.

  • We significantly enhanced our treatment of XML, ADO.NET, ASP.NET and Web services.

All of this has been carefully scrutinized by a substantial team of .NET industry developers, academic professionals and members of the Microsoft Visual Basic development team.

Who Should Read This Book

We have several Visual Basic publications, intended for different audiences. Visual Basic 2005 for Programmers, 2/e, is part of the Deitel® Developer Series, intended for professional software developers who want a deep treatment of a new technology with minimal introductory material. The book emphasizes achieving program clarity through the proven techniques of structured programming, object-oriented programming (OOP) and eventdriven programming. It continues with upper-level topics such as XML, ASP.NET 2.0, ADO.NET 2.0 and Web services. Unlike our How to Program Series college textbooks, the Deitel® Developer Series books do not include the extensive pedagogic features and ancillary support materials required for college courses.

Visual Basic 2005 for Programmers, 2/e presents hundreds of complete, working Visual Basic programs and depicts their inputs and outputs in actual screen shots of running programs. This is our signature "live-code" approachwe present concepts in the context of complete working programs.

As you read this book, if you have questions, send an e-mail to deitel@deitel.com; we will respond promptly. For updates on this book and the status of Visual Basic software, and for the latest news on all Deitel publications and services, please visit www.deitel.com regularly and be sure to sign up for the free Deitel® Buzz Online e-mail newsletter at www.deitel.com/newsletter/subscribe.html. For more information about Visual Basic 2005, check out our Visual Basic resource center at www.deitel.com/VisualBasic. For a complete list of our resource centers, visit www.deitel.com/ResourceCenters.html.

Visual Basic 2005 for Programmers, 2/e Code Examples

You can download the book's source code from

www.deitel.com/books/vbforprogrammers2

The examples are in ZIP archive files, so you'll need a ZIP archive tool such as WinZip (available from www.winzip.com) to extract the files. The examples are organized in an examples folder with a subfolder for each chapter (e.g., ch01, ch02, etc.). The example folders are named FigXX_YY, where XX represents the chapter number and YY represents the figure number. For examples that span multiple figures, the folder name has the format FigXX_YY_ZZ, where YY and ZZ represent the example's starting and ending figure numbers. We assume in our Chapter 1 "test-drive" instructions that you extract these examples to the C:\ folder on your computer.

Microsoft Visual Basic 2005 Express Edition Software

On November 7, 2005 Microsoft released its Visual Studio 2005 development tools, including the Visual Basic 2005 Express Edition. Per Microsoft's Web site, Microsoft Express Editions are "lightweight, easy-to-use and easy-to-learn tools for the hobbyist, novice and student developer." You may use Visual Basic 2005 Express (which is packaged with this book) or a complete version of Visual Studio 2005 to compile and execute the example programs. Visual Basic 2005 Express also can be downloaded from

msdn.microsoft.com/vstudio/express/vb/

According to the Microsoft Express Editions FAQ page (msdn.microsoft.com/vstudio/express/support/faq/), "Effective April 19th, 2006, all Visual Studio 2005 Express Editions are free permanently. SQL Server 2005 Express Edition has always been and will continue to be a free download."

When you install this software, you will be asked if you wish to install the help documentation and SQL Server 2005 Expresswe recommend that you choose to install both. Microsoft provides a dedicated forum for help using the Express edition:

forums.microsoft.com/msdn/ShowForum.aspx?ForumID=24

Other Software Requirements

For some examples in Chapter 17, Graphics and Multimedia, we use Microsoft Agent, which can be downloaded from

www.microsoft.com/msagent/downloads/default.asp

For Chapter 20, you will need SQL Server 2005 Express Edition, which is available at

msdn.microsoft.com/vstudio/express/sql/

Note that you do not need to download SQL Server 2005 Express separately if you select the option to install it during the Visual Basic 2005 Express installation.

Chapters 21 and 22 require either Visual Web Developer 2005 Express (or a complete version of Visual Studio 2005). Visual Web Developer 2005 Express is available at

msdn.microsoft.com/vstudio/express/vwd/

Like Visual Basic 2005 Express, the other express editions are free for download until November 6, 2006, after which Microsoft may charge a fee for these tools.

For Chapters 21 and 22, you may also want to install the IIS Web server to test the examples. For more information about installing IIS, please visit

www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/iiiisin2.mspx?mfr=true

If you prefer not to (or cannot) install IIS, you can use the built-in test server in Visual Web Developer 2005 Express to test the examples in Chapters 21 and 22.

For updates on the software used in this book visit www.deitel.com/books/vbforprogrammers2 or subscribe to our free e-mail newsletter at www.deitel.com/newsletter/subscribe.html. Also, be sure to check out our Visual Basic resource center (www.deitel.com/VisualBasic) frequently for new Visual Basic resources.

Features in Visual Basic 2005 for Programmers, 2/e

This new edition contains many new and enhanced features.

Updated for Visual Studio 2005, Visual Basic 2005 and .NET 2.0

We updated the entire text to reflect Microsoft's release of Visual Basic 2005. New items include:

  • Screenshots updated to the Visual Studio 2005 IDE.

  • Property accessors with different access modifiers.

  • Viewing exception data with the Exception Assistant (a new feature of the Visual Studio 2005 Debugger).

  • Using drag-and-drop techniques to create data-bound windows forms in ADO.NET 2.0.

  • Using the IDE's Data Sources window to create application-wide data connections.

  • Using a BindingSource to simplify the process of binding controls to an underlying data source in ADO.NET 2.0.

  • Using a BindingNavigator to enable simple navigation, insertion, deletion and editing of database data on a Windows Form.

  • Using the Master Page Designer to create a common look and feel for ASP.NET Web pages.

  • Using Visual Studio 2005 smart tag menus to perform common programming tasks when new controls are dragged onto a Windows Form or ASP.NET Web page.

  • Using Visual Web Developer's built-in Web server to test ASP.NET 2.0 applications and Web services.

  • Using an XmlDataSource to bind XML data sources to a control.

  • Using a SqlDataSource to bind a SQL Server database to a control or set of controls.

  • Using an ObjectDataSource to bind a control to an object that serves as a data source.

  • Using the ASP.NET 2.0 "login" and "create new user" controls to personalize access to Web applications.

  • Using generics and generic collections to create general models of methods and classes that can be declared once, but used with many types of data.

  • Using generic collections from the Systems.Collections.Generic namespace.

The My Namespace

One of the new Visual Basic features receiving attention is the My namespace, which makes many common .NET programming tasks more convenient in Visual Basic. Many of the My namespace's features are beyond the scope of this book. However, we've included extensive links to My namespace resources in our Visual Basic resource center

www.deitel.com/VisualBasic

These resources include sample code, technical articles, whitepapers, webcasts, videos, presentations and more. For a quick overview of many My namespace features, check out

msdn.microsoft.com/library/en-us/dnvs05/html/mywalkthro.asp

For a detailed introduction to the My namespace, check out the following 1-hour and 23-minute presentation from the 2005 Microsoft Professional Developers Conference:

microsoft.sitestream.com/pdc05/tln/tln414_files/default.htm#nopreload=1&autostart=0

New Interior Design

Working with the creative services team at Prentice Hall, we redesigned the interior styles for our Deitel® Developer Series books. In response to reader requests, we now place the key terms and the index's page reference for each defining occurrence in bold italic text for easier reference. We emphasize on-screen components in the bold Helvetica font (e.g., the File menu) and emphasize Visual Basic program text in the Lucida font (for example, Dim x As Integer = 5).

Syntax Shading

We syntax shade all the Visual Basic code, similar to the way most Visual Basic integrateddevelopment environments and code editors syntax color code. This greatly improves code readabilityan especially important goal, given that this book contains 16,200+ lines of code. Our syntax-shading conventions are as follows:


     comments appear in italic
     keywords appear in bold, italic
     errors and ASP.NET delimiters appear in bold, black
     constants and literal values appear in bold, gray
     all other code appears in plain, black

Code Highlighting

Extensive code highlighting makes it easy for readers to spot each program's featured code segmentswe place light rectangles around the key code.

Early Classes and Objects Approach

We still introduce basic object-technology concepts and terminology in Chapter 1. In the previous edition, we developed custom classes in Chapter 9, but in this edition, we start doing that in the completely new Chapter 4. Chapters 58 have been carefully rewritten with a very friendly "early classes and objects approach."

Carefully Tuned Treatment of Object-Oriented Programming in Chapters 911

This edition is clearer and more accessibleespecially if you are new to object-oriented programming (OOP). We completely rewrote the OOP chapters, integrating an employee payroll class hierarchy case study and motivating interfaces with an accounts payable hierarchy.

Case Studies

We include many case studies, some spanning multiple sections and chapters:

  • The GradeBook class in Chapters 4, 5, 6 and 8.

  • The optional, OOD/UML ATM system in the Software Engineering sections of Chapters 1, 39 and 11 and Appendix J.

  • The Time class in several sections of Chapter 9.

  • The Employee payroll application in Chapters 10 and 11.

  • The Guestbook ASP.NET application in Chapter 21.

  • The secure book database ASP.NET application in Chapter 21.

  • The blackjack Web service in Chapter 22.

  • The airline reservation Web service in Chapter 22.

Integrated GradeBook Case Study

To reinforce our early classes presentation, we present an integrated case study using classes and objects in Chapters 46 and 8. We incrementally build a GradeBook class that represents an instructor's grade book and performs various calculations based on a set of student gradesfinding the average, finding the maximum and minimum, and printing a bar chart. Our goal is to familiarize you with the important concepts of objects and classes through a real-world example of a substantial class.

The Unified Modeling Language (UML)Using the UML 2.0 to Develop an Object-Oriented Design of an ATM

The Unified Modeling Language™ (UML™) has become the preferred graphical modeling language for designing object-oriented systems. All the UML diagrams in the book comply with the UML 2.0 specification. We use UML class diagrams to visually represent classes and their inheritance relationships, and we use UML activity diagrams to demonstrate the flow of control in each of Visual Basic's control statements.

This Second Edition includes a new, optional (but highly recommended) case study on object-oriented design using the UML. The case study was reviewed by a distinguished team of OOD/UML academic and industry professionals, including leaders in the field from Rational (the creators of the UML and now a division of IBM) and the Object Management Group (responsible for maintaining and evolving the UML). In the case study, we design and fully implement the software for a simple automated teller machine (ATM). The Software Engineering Case Study sections at the ends of Chapters 1, 39 and 11 present a carefully paced introduction to object-oriented design using the UML. We introduce a concise, simplified subset of the UML 2.0, then guide the reader through a first design experience intended for the novice object-oriented designer/programmer. The case study is not an exercise; rather, it is an end-to-end learning experience that concludes with a detailed walkthrough of the complete Visual Basic code. The Software Engineering Case Study sections help readers develop an object-oriented design to complement the objectoriented programming concepts they begin learning in Chapter 1 and implementing in Chapter 4. In the first of these sections at the end of Chapter 1, we introduce basic OOD concepts and terminology. In the optional Software Engineering Case Study sections at the ends of Chapters 36, we consider more substantial issues as we undertake a challenging problem with the techniques of OOD. We analyze a typical requirements document that specifies the system to be built, determine the classes needed to implement that system, determine the attributes the classes need to have, determine the behaviors the classes need to exhibit and specify how the classes must interact with one another to meet the system requirements. In Appendix J, we include a complete Visual Basic implementation of the object-oriented system that we design in the earlier chapters. We employ a carefully developed, incremental object-oriented design process to produce a UML model for our ATM system. From this design, we produce a substantial working Visual Basic implementation using key programming notions, including classes, objects, encapsulation, visibility, composition, inheritance and polymorphism.

Web Forms, Web Controls and ASP.NET 2.0

The .NET platform enables developers to create robust, scalable Web-based applications. Microsoft's .NET server-side technology, ASP.NET, allows programmers to build Web applications that respond to client requests. To enable interactive Web pages, server-side programs process information users input into HTML forms. ASP.NET 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 drop-ping Web controls onto Web forms. Chapter 21, ASP.NET, Web Forms and Web Controls, introduces these powerful technologies.

Web Services and ASP.NET 2.0

Microsoft's .NET strategy embraces the Internet and Web as integral to software development and deployment. Web services technology enables information sharing, e-commerce and other interactions using standard Internet protocols and technologies, such as Hypertext Transfer Protocol (HTTP), Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP). Web services enable programmers to package application functionality in a manner that turns the Web into a library of reusable software components. In Chapter 22, we present a Web service that allows users to manipulate huge integers integers too large to be represented with Visual Basic's built-in data types. In this example, a user enters two huge integers and presses buttons to invoke Web services that add, subtract and compare the two integers. We also present a blackjack Web service and a database-driven airline reservation system.

Object-Oriented Programming

Object-oriented programming is the most widely employed technique for developing robust, reusable software. This text offers a rich treatment of Visual Basic's object-oriented programming features. Chapter 4 introduces how to create classes and objects. These concepts are extended in Chapter 9. Chapter 10 discusses how to create powerful new classes quickly by using inheritance to "absorb" the capabilities of existing classes. Chapter 11 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 the Extensible Markup Language (XML) is exploding in the software-development industry and in the e-business community, and is pervasive in 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 Visual Basic-based portable applications and services. Chapter 19 introduces XML, XML markup and the technologies, such as DTDs and Schema, which are used to validate XML documents' contents. We also explain how to manipulate XML documents programmatically using the Document Object Model (DOM™) and how to transform XML documents into other types of documents via Extensible Stylesheet Language Transformation (XSLT) technology.

ADO.NET 2.0

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) technology, ADO.NET represents a new approach for building 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 20 introduces the capabilities of ADO.NET and the Structured Query Language (SQL) to manipulate databases.

Visual Studio 2005 Debugger

In Appendix C, we explain how to use key debugger features, such as setting "breakpoints" and "watches," stepping into and out of methods, and examining the method call stack.

Teaching Approach

Visual Basic 2005 for Programmers, 2/e contains a rich collection of examples that have been tested on Windows XP. The book concentrates on the principles of good software engineering and stresses program clarity. We avoid arcane terminology and syntax specifications in favor of teaching by example. We are educators who teach leading-edge topics in industry classrooms worldwide. Dr. Harvey M. Deitel has 22 years of college teaching experience and 17 years of industry teaching experience. Paul Deitel has 14 years of industry teaching experience. The Deitels have taught courses at all levels to government, industry, military and academic clients of Deitel & Associates.

World Wide Web Access

All of the source-code examples for Visual Basic 2005 for Programmers, 2/e, are available for download from:

www.deitel.com/books/vbforprogrammers2/

www.prenhallprofessional.com/title/013225140X

Site registration is quick and easy. Download all the examples, then run each program as you read the corresponding text discussions. Making changes to the examples and immediately seeing the effects of those changes is a great way to enhance your Visual Basic learning experience.

Objectives

Each chapter begins with a statement of objectives. This lets you know what to expect and gives you an opportunity, after reading the chapter, to determine if you've met these objectives.

Quotations

The learning objectives are followed by quotations. Some are humorous, philosophical or offer interesting insights. We hope that you'll enjoy relating the quotations to the chapter material. Many of the quotations are worth a second look after reading the chapter.

Outline

The chapter outline helps you approach the material in a top-down fashion, so you can anticipate what is to come, and set a comfortable and effective learning pace.

16,232 Lines of Code in 215 Example Programs (with Program Outputs)

Our live-code programs range in size from just a few lines of code to substantial examples containing hundreds of lines of code (e.g., our ATM system implementation contains 597 lines of code). Each program is followed by screenshots of the outputs produced when the program is run, so you can confirm that the programs run as expected. Our programs demonstrate the diverse features of Visual Basic. The code is syntax shaded, with Visual Basic keywords, comments and other program text emphasized with variations of bold, italic and gray text. This makes reading the code easier, especially in the larger programs.

807 Illustrations/Figures

An abundance of charts, tables, line drawings, programs and program outputs is included. We model the flow of control in control statements with UML activity diagrams. UML class diagrams model the fields, constructors and methods of classes. We use additional types of UML diagrams throughout our optional OOD/UML ATM case study.

350 Programming Tips

We include programming tips to help readers focus on important aspects of program development. We highlight these tips as Good Programming Practices, Common Programming Errors, Error-Prevention Tips, Look-and-Feel Observations, Performance Tips, Portability Tips and Software Engineering Observations. These tips and practices represent the best we have gleaned from a combined six decades of programming, college teaching and professional training experience. The tips provide a basis on which to build good software.

Good Programming Practice 1.1

Good Programming Practices call attention to techniques that will help you produce programs that are clearer, more understandable and more maintainable.


Common Programming Error 1.1

Developers learning a language tend to make certain kinds of errors frequently. Pointing out these Common Programming Errors reduces the likelihood that you'll make the same mistakes.


Error-Prevention Tip 1.1

When we first designed this tip type, we thought the tips would contain suggestions for exposing bugs and removing them from programs. In fact, many of the tips describe aspects of Visual Basic that prevent bugs from getting into programs in the first place, thus simplifying the testing and debugging processes.


Look-and-Feel Observation 1.1

We provide Look-and-Feel Observations to highlight graphical-user-interface conventions. These observations help you design attractive, user-friendly graphical user interfaces that conform to industry norms.


Performance Tip 1.1

Programmers like to "turbo charge" their programs. We include Performance Tips that high-light opportunities for improving program performancemaking programs run faster or mini-mizing the amount of memory that they occupy.


Portability Tip 1.1

We include Portability Tips to help you write portable code and to explain how Visual Basic achieves its high degree of portability.


Software Engineering Observation 1.1

The object-oriented programming paradigm necessitates a complete rethinking of the way we build software systems. Visual Basic is an effective language for achieving good software engineering. The Software Engineering Observations highlight architectural and design issues that affect the construction of software systems, especially large-scale systems.


Wrap-Up Section

Each chapter ends with a brief "wrap-up" section that recaps the chapter content and transitions to the next chapter.

Extensive Index

We have included an extensive index which is especially helpful when using the book as a reference.

"Double Indexing" of Visual Basic Live-Code Examples

Visual Basic 2005 for Programmers, 2/e has 215 live-code examples, which we have double indexed. For every source-code program in the book, we indexed the figure caption both alphabetically and as a subindex item under "Examples." This makes it easier to find examples using particular features.

A Tour of the Optional Case Study on Object-Oriented Design with the UML

In this section we tour the book's optional case study on object-oriented design with the UML. This tour previews the contents of the Software Engineering Case Study sections (in Chapters 1, 39, 11 and Appendix J). After completing this case study, you will be thoroughly familiar with an object-oriented design and implementation for a significant Visual Basic application.

The design presented in the ATM case study was developed at Deitel & Associates, Inc. and scrutinized by academic and industry professionals. Our primary goal was to create a simple design that would be clear to OOD and UML novices, while still demonstrating key OOD concepts and the related UML modeling techniques.

Section 1.9(Only Required Section of the Case Study) Software Engineering Case Study: Introduction to Object Technology and the UML introduces the objectoriented design case study with the UML. The section presents basic concepts and terminology of object technology, including classes, objects, encapsulation, inheritance and polymorphism. We discuss the history of the UML. This is the only required section of the case study.

Section 3.9(Optional) Software Engineering Case Study: Examining the ATM Requirements Documentdiscusses a requirements document that specifies the requirements for a system that we will design and implementthe software for a simple automated teller machine (ATM). We investigate the structure and behavior of object-oriented systems in general. We discuss how the UML will facilitate the design process in subsequent Software Engineering Case Study sections by providing several additional types of diagrams to model our system. We include a list of URLs and book references on object-oriented design with the UML. We discuss the interaction between the ATM system and its user. Specifically, we investigate the scenarios that may occur between the user and the system itselfthese are called use cases. We model these interactions, using UML use case diagrams.

Section 4.9(Optional) Software Engineering Case Study: Identifying the Classes in the ATM Requirements Documents begins to design the ATM system. We identify its classes by extracting the nouns and noun phrases from the requirements document. We arrange these classes into a UML class diagram that describes the class structure of our simulation. The class diagram also describes relationships, known as associations, among classes.

Section 5.14(Optional) Software Engineering Case Study: Identifying Class Attributes in the ATM System focuses on the attributes of the classes discussed in Section 3.9. A class contains both attributes (data) and operations (behaviors). As we see in later sections, changes in an object's attributes often affect the object's behavior. To determine the attributes for the classes in our case study, we extract the adjectives describing the nouns and noun phrases (which defined our classes) from the requirements document, then place the attributes in the class diagram we created in Section 3.9.

Section 6.11(Optional) Software Engineering Case Study: Identifying Objects' States and Activities in the ATM System discusses how an object, at any given time, occupies a specific condition called a state. A state transition occurs when the object receives a message to change state. The UML provides the state machine diagram, which identifies the set of possible states that an object may occupy and models that object's state transitions. An object also has an activitythe work it performs in its lifetime. The UML provides the activity diagrama flowchart that models an object's activity. In this section, we use both types of diagrams to begin modeling specific behavioral aspects of our ATM system, such as how the ATM carries out a withdrawal transaction and how the ATM responds when the user is authenticated.

Section 7.20(Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System identifies the operations, or services, of our classes. We extract from the requirements document the verbs and verb phrases that specify the operations for each class. We then modify the class diagram of Section 3.9 to include each operation with its associated class. At this point in the case study, we will have gathered all information possible from the requirements document. As future chapters introduce such topics as inheritance, we will modify our classes and diagrams.

Section 8.15(Optional) Software Engineering Case Study: Collaboration Among Objects in the ATM System provides a "rough sketch" of the model for our ATM system. In this section, we see how it works. We investigate the behavior of the simulation by discussing collaborationsmessages that objects send to each other to communicate. The class operations that we discovered in Section 6.11 turn out to be the collaborations among the objects in our system. We determine the collaborations, then collect them into a communication diagramthe UML diagram for modeling collaborations. This diagram reveals which objects collaborate and when. We present a communication diagram of the collaborations among objects to perform an ATM balance inquiry. We then present the UML sequence diagram for modeling interactions in a system. This diagram emphasizes the chronological ordering of messages. A sequence diagram models how objects in the system interact to carry out withdrawal and deposit transactions.

Section 9.14(Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System takes a break from designing the behavior of our system. We begin the implementation process to emphasize the material discussed in Chapter 8. Using the UML class diagram of Section 3.9 and the attributes and operations discussed in Section 4.11 and Section 6.11, we show how to implement a class in Visual Basic from a design. We do not implement all classesbecause we have not completed the design process. Working from our UML diagrams, we create code for the Withdrawal class.

Section 11.8(Optional) Software Engineering Case Study: Incorporating Inheritance and Polymorphism into the ATM System continues our discussion of objectoriented programming. We consider inheritanceclasses sharing common characteristics may inherit attributes and operations from a "base" class. In this section, we investigate how our ATM system can benefit from using inheritance. We document our discoveries in a class diagram that models inheritance relationshipsthe UML refers to these relationships as generalizations. We modify the class diagram of Section 3.9 by using inheritance to group classes with similar characteristics. This section concludes the design of the model portion of our simulation. We implement this model in Visual Basic in Appendix J.

Appendix JATM Case Study Code The majority of the case study involves designing the model (i.e., the data and logic) of the ATM system. In this appendix, we fully implement that model in Visual Basic, using all the UML diagrams we created. We apply the concepts of object-oriented design with the UML and object-oriented programming in Visual Basic that you learned in the chapters. By the end of this appendix, you will have completed the design and implementation of a real-world system, and should feel confident tackling larger systems, such as those that professional software engineers build.

Appendix KUML 2: Additional Diagrams Types Overviews the UML 2 diagram types not discussed the OOD/UML Case Study.

DEITEL® Buzz Online Free E-mail Newsletter

Our free e-mail newsletter, the Deitel® Buzz Online, includes commentary on industry trends and developments, links to free articles and resources from our published books and upcoming publications, product-release schedules, errata, challenges, anecdotes, information on our corporate instructor-led training courses and more. It's also a good way for you to keep posted about issues related to Visual Basic 2005 for Programmers, 2/e. To subscribe, visit

www.deitel.com/newsletter/subscribe.html

What's New at Deitel

Free Content Initiative. We are pleased to bring you guest articles and free tutorials selected from our current and forthcoming publications as part of our Free Content Initiative. In each issue of our Deitel® Buzz Online newsletter, we announce the latest additions to our free content library. Let us know what topics you'd like to see and let us know if you'd like to submit guest articles!

www.deitel.com/articles/

Resource Centers and the Deitel Internet Business Initiative. We have created many resource centers (at www.deitel.com/ResourceCenters.html) on such topics as Visual Basic, .NET, C#, C++, Java, AJAX, Ruby, PHP, Perl, Python, MySQL, RSS, XML, Web Services, Windows Vista, Google Analytics, Google Base, Google Video, Google AdSense, the Internet Business Initiative, Mash-Ups, Ning, Podcasting, Computer Games, Game Programming, Attention Economy, Affiliate Programs, Sudoku, Web 2.0, Search Engine Optimization and Skype, with many more coming. We announce new resource centers in each issue of the Deitel® Buzz Online.

Acknowledgments

It is a great pleasure to acknowledge the efforts of many people whose names may not appear on the cover, but whose hard work, cooperation, friendship and understanding were crucial to the production of the book. Many people at Deitel & Associates, Inc. devoted long hours to this project.

  • Andrew B. Goldberg is a Computer Science graduate of Amherst College. Andrew co-authored the updates to Chapters 19!22. He co-designed and co-authored the new, optional OOD/UML ATM case study. He also co-authored Appendices J and K.

  • Su Zhang holds B.Sc. and M.Sc. degrees in Computer Science from McGill University. Su contributed to Chapters 26 and 27 as well as Appendix J.

  • Cheryl Yaeger graduated from Boston University with a bachelor's degree in Computer Science. Cheryl co-authored the updates to Chapters 314.

  • Barbara Deitel, Chief Financial Officer at Deitel & Associates, Inc. applied copyedits to the book.

  • Abbey Deitel, President of Deitel & Associates, Inc., and an Industrial Management graduate of Carnegie Mellon University, co-authored Chapter 1.

  • Christi Kelsey, a graduate of Purdue University with a degree in business and a minor in information systems, co-authored Chapter 2, the Preface and Appendix C. She also worked closely with the production team at Prentice Hall coordinating virtually every aspect of the production of the book.

We would also like to thank three participants of our Honors Internship and Co-op programs who contributed to this publicationNick Santos, a Computer Science major at Dartmouth College; Jeffrey Peng, a Computer Science major at Cornell University and William Chen, a Computer Science major at Cornell University.

We are fortunate to have worked on this project with the talented and dedicated team of publishing professionals at Pearson Education/PTG. We especially appreciate the extraordinary efforts of Mark Taub, Publishing Partner of Prentice Hall/PTR, and Marcia Horton, Editorial Director of Prentice Hall's Engineering and Computer Science Division. Jennifer Cappello and Dolores Mars did an extraordinary job recruiting the review team for this book and managing the review process. Sandra Schroeder did a wonderful job designing the book's cover. Vince O'Brien, Bob Engelhardt, Donna Crilly and Marta Samsel did a marvelous job managing the production of the book.

We'd like to give special thanks to Paul Vick, (Architect, Visual Basic) and author of the Microsoft Visual Basic Language Specification, Version 8.0, and Janie Schwark, Senior Business Manager, Division of Developer Marketing, both of Microsoft, for their special effort in working with us on this project.

Microsoft Reviewers

Corneliu Barsan, Microsoft

Dharmesh Chauhan, Microsoft

John Chen, Microsoft

Eric Gruber, Microsoft

Manish Jayaswal, Microsoft

Cameron McColl, Microsoft

Alexandre Moura, Microsoft

Baiju Nair, Microsoft

Cat Rambo, Microsoft

Thom Robbins, Microsoft

Chris Smith, Microsoft Compiler UI Team

Craig Vick, Microsoft

Industry Reviewers

Harlan Brewer, SES Consulting

Kunal Cheda, Computer Enterprises, Inc. U.S

James Huddleston, Independent Consultant

Terrell Hull, Independent Consultant

Amit Kalani, TechContent Corporation

Tysen Leckie, Edge Technologies

John Mueller, DataCon Services

Academic Reviewers

Karen Arlien, Bismarck State College

Robert Benavides, Collin County CC

Rekha Bhowmik, Winston-Salem State University

Chadi Boudiab, Georgia Perimeter College

Brian Larson, Modesto Junior College

Gavin Osborne, Saskatchewan Institute of Applied Science and Technology

Warren Wiltsie, Fairleigh Dickinson University

UML Case Study Reviewers

Scott Ambler, Ambysoft, Inc.

Rekha Bhowmik, Winston-Salem State University

Chadi Boudiab, Georgia Perimeter College

Brian Cook, Zurich North America

Sergio Davalos, University of Washington-Tacoma

Sujay Ghuge, Verizon IT

Manu Gupta, Patni Computer Systems

Terrell Hull, Independent Consultant

James Huddleston, Independent Consultant

Jeff Jones, Route Match Software

John Mueller, DataCon Services

Davyd Norris, Rational/IBM

Gavin Osborne, Saskatchewan Institute

Visual C# 2005 How to Program, 2/e and C# for Programmers, 2/e were written in parallel with this book and many of the comments from the C# review teams proved valuable to us in completing this book, so we wanted to acknowledge their contributions:

Microsoft Reviewers

George Bullock, Program Manager at Microsoft, Microsoft.com Community Team

Dharmesh Chauhan, Microsoft

Shon Katzenberger, Microsoft

Matteo Taveggia, Microsoft

Matt Tavis, Microsoft

Industry Reviewers

Alex Bondarev, Investor's Bank and Trust

Peter Bromberg, Senior Architect Merrill Lynch and C# MVP

Vijay Cinnakonda, TrueCommerce, Inc.

Jay Cook, Alcon Laboratories

Jeff Cowan, Magenic, Inc.

Ken Cox, Independent Consultant, Writer and Developer and ASP.NET MVP

Stochio Goutsev, Independent Consultant, writer and developer and C# MVP

James Huddleston, Independent Consultant

Rex Jaeschke, Independent Consultant and Editor of the C# Standard ECMA-334, 2005, produced by committee Ecma TC39/TG2.

Saurabh Nandu, AksTech Solutions Pvt. Ltd.

Simon North, Quintiq BV

Mike O'Brien, State of California Employment Development Department

José Antonio González Seco, Andalucia's Parliamient

Devan Shepard, XMaLpha Technologies

Pavel Tsekov, Caesar BSC

John Varghese, UBS

Stacey Yasenka, Software Developer at Hyland Software and C# MVP

Academic Reviewers

Rekha Bhowmik, California Lutheran University

Ayad Boudiab, Georgia Perimiter College

Harlan Brewer, SES Consulting

Sam Gill, San Francisco State University

Gavin Osborne, Saskatchewan Institute of Applied Science and Technology

Catherine Wyman, DeVry-Phoenix

And thanks to the many other members of the Microsoft team who answered our questions throughout this process:

Anders Hejlsburg, Technical Fellow (C#)

Brad Abrams, Lead Program Manager (.NET Framework)

Jim Miller, Software Architect (.NET Framework)

Joe Duffy, Program Manager (.NET Framework)

Joe Stegman, Lead Program Manager (Windows Forms)

Kit George, Program Manager (.NET Framework)

Luca Bolognese, Lead Program Manager (C#)

Luke Hoban, Program Manager (C#)

Mads Torgersen, Program Manager (C#)

Peter Hallam, Software Design Engineer (C#)

Scott Nonnenberg, Program Manager (C#)

Shamez Rajan, Program Manager (Visual Basic)

Well, there you have it! Visual Basic is a powerful programming language that will help you write programs quickly and effectively. Visual Basic scales nicely into the realm of enterprise systems development to help organizations build their business-critical and mission-critical information systems. As you read the book, we would sincerely appreciate your comments, criticisms, corrections and suggestions for improvement. Please address all correspondence to:

deitel@deitel.com

We will respond promptly, and we will post corrections and clarifications on our Web site:

www.deitel.com

We hope you enjoy reading Visual Basic 2005 for Programmers, 2/e as much as we enjoyed writing it!

Paul J. Deitel

Harvey M. Deitel

About the Authors

Paul J. Deitel, CEO and Chief Technical Officer of Deitel & Associates, Inc., is a graduate of the MIT's Sloan School of Management, where he studied Information Technology. Through Deitel & Associates, Inc., he has delivered programming language courses to industry clients, including IBM, Sun Microsystems, Dell, Lucent Technologies, Fidelity, NASA at the Kennedy Space Center, the National Severe Storm Laboratory, White Sands Missile Range, Rogue Wave Software, Boeing, Stratus, Cambridge Technology Partners, Open Environment Corporation, One Wave, Hyperion Software, Adra Systems, Entergy, CableData Systems, Nortel Networks and many more. Paul is one of the world's most experienced Java trainers, having taught about 100 professional Java courses. He has also lectured on C++ and Java for the Boston Chapter of the Association for Computing Machinery. He and his father, Dr. Harvey M. Deitel, are the world's best-selling programming language textbook authors.

Dr. Harvey M. Deitel, Chairman and Chief Strategy Officer of Deitel & Associates, Inc., has 45 years of academic and industry experience in the computer field. Dr. Deitel earned B.S. and M.S. degrees from the Massachusetts Institute of Technology and a Ph.D. from Boston University. He has 20 years of college teaching experience, including earning tenure and serving as the Chairman of the Computer Science Department at Boston College before founding Deitel & Associates, Inc., with his son, Paul J. Deitel. He and Paul are the co-authors of several dozen books and multimedia packages and they are writing many more. With translations published in Japanese, German, Russian, Spanish, Traditional Chinese, Simplified Chinese, Korean, French, Polish, Italian, Portuguese, Greek, Urdu and Turkish, the Deitels' texts have earned international recognition. Dr. Deitel has delivered hundreds of professional seminars to major corporations, academic institutions, government organizations and the military.

About Deitel & Associates, Inc.

Deitel & Associates, Inc., is an internationally recognized corporate training and contentcreation organization specializing in computer programming languages, Internet and World Wide Web software technology, object technology education and Internet business development. The company provides instructor-led courses on major programming languages and platforms, such as Java, Advanced Java, C, C++, C#, Visual C++, Visual Basic, XML, Perl, Python, object technology, and Internet and World Wide Web programming. The founders of Deitel & Associates, Inc., are Paul J. Deitel and Harvey M. Deitel. The company's clients include many of the world's largest computer companies, government agencies, branches of the military and business organizations. Through its 30-year publishing partnership with Prentice Hall, Deitel & Associates, Inc. publishes leading-edge programming textbooks, professional books, interactive multimedia Cyber Classrooms, Complete Training Courses, Web-based training courses and e-content for popular course management systems such as WebCT, Blackboard and Pearson's CourseCompass. Deitel & Associates, Inc., and the authors can be reached via e-mail at:

deitel@deitel.com

To learn more about Deitel & Associates, Inc., its publications and its worldwide Dive Into® Series Corporate Training curriculum, see the last few pages of this book or visit:

www.deitel.com

and subscribe to the free Deitel® Buzz Online e-mail newsletter at:

www.deitel.com/newsletter/subscribe.html

Individuals wishing to purchase Deitel books, Cyber Classrooms, Complete Training Courses and Web-based training courses can do so through:

www.deitel.com/books/index.html

Bulk orders by corporations, the government, the military and academic institutions should be placed directly with Prentice Hall.



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net