Professional Refactoring in Visual Basic (Programmer to Programmer)
معرفی کتاب «Professional Refactoring in Visual Basic (Programmer to Programmer)» نوشتهٔ Danijel Arsenovski، منتشرشده توسط نشر Wrox/Wiley Pub در سال 2008. این کتاب در 2 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Professional Refactoring in Visual Basic (Programmer to Programmer)» در دستهٔ بدون دستهبندی قرار دارد.
Книга Professional Refactoring in Visual Basic Professional Refactoring in Visual BasicКниги Basic / Visual Basic Автор: Danijel Arsenovski Год издания: 2008 Формат: pdf Издат.:Wrox Страниц: 517 Размер: 4,1 ISBN: 0470179791 Язык: Английский0 (голосов: 0) Оценка:Professional Refactoring in Visual Basic In this one-of-a-kind book, Microsoft MVP Danijel Arsenovski shows you how to utilize the power of refactoring to improve the design of your existing code and become more efficient and productive. He provides you with a hands-on approach so you'll quickly learn how to manage and modify your code with refactoring tools and features. You'll also discover how to perform unit testing, refactoring to patterns, and refactoring to upgrade legacy Visual Basic code. As you progress through the chapters, you'll build a prototype application from scratch. You'll then utilize refactoring techniques to transform the code into a properly designed, enterprise-level application. Arsenovski walks you step-by-step through each process while offering expert coding tips. You'll then be able to apply this information to real situations that arise as a result of company expansion, policy changes, or similar business decisions. What you will learn from this book The steps involved in assembling a refactoring toolkit How to activate explicit and strict compiler options Effective strategies for error handling How to eliminate dead code, reduce scope, and remove unused references Method consolidation and extraction techniques Advanced object-oriented concepts and related refactorings How to organize code for large-scale projects Tips for taking advantage of LINQ and other VB 2008 enhancements Core refactorings and basic code smells How to use the free Refactor! add-in for Visual Basic Visual Basic–specific refactorings and smells Who this book is forThis book is for intermediate to expert programmers, developers, or .NET software architects who are familiar with basic object-oriented concepts, Visual Basic, and the Visual Studio environment. Prefessional Refactoring in Visual Basic 1 About the Author 9 Credits 10 Acknowledgments 11 Contents 12 Foreword 22 Introduction 24 Whom This Book Is For 25 What This Book Covers 25 How This Book Is Structured 26 What You Need to Use This Book 28 Conventions 28 Smell, Refactoring, and Object-Oriented Design Principle Boxes 29 Source Code 33 Errata 33 p2p.wrox.com 33 Part I: Introduction to Refactoring 36 Chapter 1: Refactoring: What’s All the Fuss About? 38 A Quick Refactoring Overview 39 The Refactoring Process: A Closer Look 42 Visual Basic and Refactoring 49 Summary 51 Chapter 2: A First Taste of Refactoring 54 Calories Calculator Sample Application 54 Refactoring in Action 61 Implementing the Persistence Functionality 78 Calories Calculator, Refactored Version 91 Summary 93 Chapter 3: Assembling a Refactoring Toolkit 94 Using an Automated Refactoring Tool 95 Unit-Testing Basics: The Testing Harness 104 A Few Words about Version Control 119 Summary 120 Chapter 4: Rent-a-Wheels Application Prototype 122 Interviewing the Client 123 Taking the Initial Steps in the Rent-a-Wheels Project 126 Making the Prototype Work 131 Fast and Furious, a VB Approach to Programming 137 From Prototype to Delivery Through the Refactoring Process 140 Summary 140 Part II: Preliminary VB Refactorings 142 Chapter 5: Chameleon Language: From Weak Static Typing to Strong Dynamic Typing 144 Option Explicit and Option Strict, the .NET Effect 145 Setting Option Explicit On in Relaxed Code 146 Setting Option Strict On in Relaxed Code 150 Static Versus Dynamic Typing and Visual Basic 170 Activating Explicit and Strict Compiler Options 176 Summary 180 Chapter 6: Error Handling: From Legacy to Structured in a Few Easy Steps 182 Legacy Error Handling Versus Structured Error Handling 183 The Benefits of Structured Error Handling 188 Replacing the On Error Construct with Try-Catch-Finally 191 Replacing Error Code with Exception Type 199 Error Handling in the Rent-a-Wheels Application 204 Summary 206 Chapter 7: Basic Hygiene: Eliminating Dead Code, Reducing Scope, Using Explicit Imports, and Removing Unused References 208 Eliminating Dead Code 209 Reducing the Scope and Access Level of Unduly Exposed Elements 214 Using Explicit Imports 222 Removing Unused Assembly References 226 Basic Hygiene in the Rent-a-Wheels Application 227 Summary 228 Part III: Getting Started with Standard Refactoring Transformations 230 Chapter 8: From Problem Domain to Code: Closing the Gap 232 Understanding the Problem Domain 233 Naming Guidelines 236 Published and Public Interfaces 243 Rename and Safe Rename Refactoring in the Rent-a-Wheels Application 252 Summary 253 Chapter 9: The Method Extraction Remedy for Duplicated Code 254 Why Keep Code Encapsulated and Details Hidden? 254 Information and Implementation Hiding 255 Decomposing Methods 258 The Duplicated Code Smell 269 Magic Literals 272 Extract Method and Replace Magic Literal Refactoring in the Rent-a-Wheels Application 275 Summary 275 Chapter 10: Method Consolidation and Extraction Techniques 278 Dealing with Temporary Variables 278 Method Reorganization Heuristics 293 Method Reorganization and Rent-a-Wheels 294 Summary 302 Part IV: Advanced Refactorings 304 Chapter 11: Discovering Objects 306 A Quick Object-Oriented Programming Overview 307 Designing Classes 316 Discovering Hidden Classes 333 Summary 355 Chapter 12: Advanced Object-Oriented Concepts and Related Refactorings 358 Inheritance, Polymorphism, and Genericity 359 Inheritance Abuse and Refactoring Solutions 369 Making Use of Generics 395 Inheritance and Generic Types in the Rent-a-Wheels Application 399 Summary 404 Chapter 13: Code Organization on a Large Scale 406 Namespaces 406 Assemblies 410 Visual Basic Project File Structure Organization 422 Namespace Organization and Windows Forms Inheritance in Rent-a-Wheels 429 Summary 438 Part V: Refactoring Applied 440 Chapter 14: Refactoring to Patterns 442 Design Patterns: What’s All the Fuss About? 443 Example Design Pattern: Abstract Factory 446 Dependency Injection Pattern 461 Refactoring to Patterns and Rent-a-Wheels Application 469 Summary 473 Chapter 15: LINQ and Other VB 2008 Enhancements 474 Type Inference for Local Variables 474 XML Productivity Enhancements 475 Querying the Objects with LINQ 480 Summary 499 Chapter 16: The Future of Legacy VB Code 500 To Migrate or Not To Migrate 501 Preliminary VB 6 Refactorings 505 Putting Your Migrated Code under a Testing Harness 507 Upgrading Your Legacy Code 512 Summary 517 Appnedix A: Unleash Refactor! 518 Appendix B: Rent-a-Wheels Prototype Internals and Intricacies 522 Hand Over Button Click Event-Handling Code 522 Receive Button Click Event-Handling Code 523 Charge Button Click Event-Handling Code 523 Change Branch Button Click Event-Handling Code 524 To Maintenance and From Maintenance Button Click Event Code 528 Administer Fleet Form 529 Display Button Click Event-Handling Routine 537 Summary 541 Index 542
دانلود کتاب Professional Refactoring in Visual Basic (Programmer to Programmer)