Preface

A journey of a thousand miles begins with a single step.

Confucius

Introduction

By the time you are reading this I will be well into my third year working with .NET. After looking at some of the books already written about .NET, I tried to figure out what you, the reader, would be interested in by the time you had some .NET under your belt. We planned a bit in conceiving and producing this book. Now that .NET has been out for a while, I feel many readers are ready for some chewy stuff on Visual Basic .NET (VB .NET).

Who Should Read This Book

I wrote this book for professionals who have gotten past the basics and are ready for some torque. This book assumes you have read an introductory book on VB .NET, progressed through a more advanced book like Visual Basic .NET Unleashed [Kimmel 2002b], and are now ready to turn on the hyperdrive.

There is just a modicum of introductory material inside these pages. If you need to know how to write loops, conditional statements, functions, or subroutines, then set this book on your shelf and try something written at the introductory level until you're comfortable with that material. Then come back to this book.

If you're the kind of code slinger who has trophy projects on your shelf, then this is the book for you. Read on.

What's in This Book

One chapter can be labeled a beginner's chapter, and that is Chapter 1. Chapters 2 through 18 contain advanced subject matter that will help you manage challenging problems whose solutions may be impossible to find in the help files and difficult to locate in other books.

Early chapters in this book cover subjects like inheritance and delegates because even seasoned Visual Basic 6 veterans might be a bit lost when it comes to these subjects. After all, neither inheritance nor delegates existed in Visual Basic 6, and delegates are unique to .NET.

Reflection

In Chapter 4 we will jump into the deep water with Reflection. If you have heard of Run Time Type Information (RTTI), think of Reflection as RTTI on anabolic steroids. All the things that can be done with Reflection haven't even been invented yet, but what has been invented and discovered is amazing.

For example, .NET code is converted to Intermediate Language (IL) code before it is just-in-time compiled (JITted) and run. .NET emulates the Java byte code model to a limited degree. VB .NET supports emitting new types at runtime directly into IL and then creating instances of those types on-the-fly. This book will show you how to emit IL using Reflection and provide you with a means of extending your code in the most fundamental ways after it is deployed.

Assemblies

“DLL hell” is vaporized in VB .NET by adding metadata to assemblies. For now think of an assembly as an application that carries extra information with it, eliminating the need to monkey around with the registry and Globally Unique Identifiers (GUIDs) so much.

Another cool technology is the ability to dynamically load assemblies over an HTTP wire. This means you can implement automatically deployable and updatable Windows applications emulating the thin client browser model.

Windows Forms–based applications provide a richer client experience than Web Forms–based applications, and thin client programming using assemblies may finally allow the convergence of Web and Windows development technologies.

This book will demonstrate how to use assembly metadata as well as how to implement thin client Windows applications that deploy over the Web and seamlessly update without user intervention.

Multithreading

There are times when you absolutely need multithreading capabilities. I will demonstrate how to use synchronous and asynchronous processes, thread pooling, and the thread class to safely incorporate multithreaded behavior and even how to do so with Windows Forms controls.

Multithreading in VB .NET is definitely a cruise missile you want in your arsenal. Learn how to use threads safely and professionally.

COM Interop

A huge body of code exists in the COM world. Microsoft hasn't pulled the plug on COM, so why should you? Even Visual Studio .NET (VS .NET) uses COM; look at the Add-Ins Manager.

COM Interop allows you to use COM components in .NET and .NET code in COM-based applications. In this book you will learn the ropes of COM Interop in VB .NET.

Remoting

Moving toward open standards, Microsoft has developed new ways to solve existing problems. Remoting supports the management of solutions in a distributed environment. Read Chapter 8 to learn how to serialize objects and implement remoting for your distributed projects.

Building Components

Historically, building advanced components for Visual Basic often required using ActiveX and a C++ compiler. VB .NET supports building professional components for VB .NET with VB .NET.

By working through Chapter 9 you will have an opportunity to build user controls, custom controls, and server controls. Several examples demonstrate the nuts and bolts of implementing and testing controls and adding those controls to VS .NET.

ADO.NET

A sweeping change in .NET is found in ADO.NET technology. .NET follows the disconnected data model necessary for Web applications. The disconnected nature of ADO.NET is supported by XML DataSets, which replace the Recordset.

DataSets are based on XML and require you to rethink the way you build database, client-server, and Web-enabled applications. This book demonstrates how to use DataSets and work with disconnected data, as well as how to use XML and XML schemas (XSD) to connect to any kind of data anywhere.

Web Services

One of the most exciting new technologies is Web Services. A Web Service represents code that can be called from anywhere in the world. Web Services use open standards protocols, like SOAP and XML, allowing any connected computer to request services from any other computer.

You will learn about XML, SOAP, Web Services, and UDDI as you read the pages of this book. I will provide many examples and describe these technologies (and acronyms, like UDDI).

ASP.NET, Debugging, and Security

The world of exciting new innovations includes ASP.NET. The ASP.NET model facilitates building Web applications very similar to how you build Windows-based applications.

While writing this book I was also working on an enterprise solution using ASP.NET. Through that experience, I learned the best practices for implementing, debugging, and securing Web applications and included them in the confines of this book.

You will have an opportunity to learn about Web Forms and server controls, as well as managing state using caching and XML serialization, connecting Web applications to data, and using the Policy Manager and new security attributes in .NET.

After reading this book you will agree that there is much to VB .NET.

Where to Get the Source Code

You can download all the source code from http://www.softconcepts.com. Like the cobbler who makes new shoes for his kids, I have time to update my own Web site, and occasionally things get moved around. Follow the Source Code link on the main page to find the source code for this book. If you have any questions or general feedback then send me some e-mail at [email protected].

Looking Ahead

I wrote this book to be readable from cover to cover, beginning with Chapter 1. I was also mindful that many readers are busy and may not have the time to read hundreds of pages in one sitting.

The many code listings will help you find examples to support the theoretical material presented; the chapters are organized to require only a modest amount of interdependency. If you are looking for answers to specific questions, you may be able to find all the material in one location.

I stand behind what I write, and I strive to offer the most accurate and informative content available. If you have any specific questions, feel free to e-mail me at [email protected]. Any feedback is appreciated.

Happy reading.

Acknowledgments

I would like to thank Sondra Scott at Addison-Wesley. I appreciate her many years of commitment to me and the chance to continue writing for the readers. It takes many people to get a book from concept to publication. Many of the people at Addison-Wesley do so quietly, consistently, and professionally book after book, asking for no recognition. I appreciate their help and know it couldn't be done without them. I would especially like to thank John Cottrell and Lowell Mauer. John and Lowell have many years of combined wisdom and programming experience. Thanks, guys, for technical editing.

A shout out to Sharon Cox, now at Wiley. Thank you, Sharon, for patiently waiting for me to finish this book. Sorry about the scheduling confusion. Tell Chris I will finish the wireless book right away.

David Fugate is my agent at Waterside. David referees when things get hectic. Thank you, David, for keeping the flow going in both directions.

I would like to thank Dan O'Donnell at Intel, Matt Markley, Adena Wilder, and Lisa Cozzens at Microsoft. These folks work at the other end of technical support at Intel and Microsoft, and I believe they set the standard for technical customer assistance. Thank you for your professional and courteous help.

A special thank you to the JET team at Multnomah County for helping me make a home away from home these many months. Thanks to Steve Chennault, Peggy Duerscherl, Karin Britton, Yvette Yutze, Brooke Riddick, Geoff Caylor, Bill Arnold, Mark Davis, Kathy Erwin, Robert Phillips, Lewis Gouge, Frank Bubenick, Joe Shook, John Armitage, Eric Cotter, John Deal, Jeff Braunstein, and Lisa Yeo. We're in the stretch now.

Thanks to Sara Kelsay, Erin, Rhiannon, and Lorinda at Wynne's for food and adult beverages, and we say goodbye to Yonnie who has moved on to bigger and better things.

It is my family that makes all things possible. Thanks to my mom, Jacqueline Benavides, for babysitting when everyone is sick and for trips to the airport. Thanks to my brother Jim Kimmel for emergency appliance repairs while I am out of town. Thanks to my younger brother Nicholas—who started at Michigan State University in 2002—for house sitting. (It was nice to have Mom and Dad Bourbonais and Grandma Blumenthal over for the holidays, up from Tampa, Florida. Hope you enjoyed the first year of retirement.) And thanks to my extended family in Oregon—Mark Davis, who takes trips to Vegas with me, and Joe Shook, Geoff Caylor, and Eric Cotter for playing Warcraft III and Unreal to help pass the time. A special thanks to my good friend Rob Golieb for sending me books for Christmas. The perfect gift.

Last and most importantly, thank you Lori, Trevor, Doug, Alex, and Noah—my wife and kids—for being flexible, lovable, and the best part of my life. I love you dearly, Dad.

About the Author

Paul Kimmel is the founder of Software Conceptions, Inc. Paul has been developing object-oriented software for more than a decade. Paul has written many books on object-oriented programming and .NET, including Advanced C# Programming for McGraw-Hill/Osborne and Sams' Visual Basic .NET Unleashed. He is a monthly columnist for Windows Developer Magazine, a bimonthly contributor to codeguru.com's Visual Basic Today, and a regular contributor to InformIT.

While writing this book Paul was helping build an enterprise ASP.NET application in Portland, Oregon. He is available to help design and implement applications anywhere in North America and can be contacted at [email protected].

Paul resides with his wife, Lori, and children—Trevor, Doug, Alex, and Noah—in Okemos, Michigan. Okemos is a sleepy little suburb full of mostly sensible people, near the beautiful Michigan State University campus.

About the Technical Reviewers

John P. Cottrell started programming in Basic in 1982 and since then has written applications in many different languages. He started programming in Visual Basic with version 4 in 1996 and has been coding in VB .NET since June 2000. John lives in Sugar Hill, Georgia, and in his spare time enjoys programming, coin collecting, and spending time with his wife, Adelle, and three-year-old daughter, Katy.

Lowell Mauer has been in data processing for over 23 years as a programmer, an instructor, and a consultant. He has taught programming at Brooklyn College in New York City and Montclair State College in New Jersey. He has developed and marketed several Visual Basic applications, including a SQL Server-based reservation system for a private golf course. Lowell currently is a senior consultant in New York City.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.231.128