Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Refactoring with C#

You're reading from  Refactoring with C#

Product type Book
Published in Nov 2023
Publisher Packt
ISBN-13 9781835089989
Pages 434 pages
Edition 1st Edition
Languages
Author (1):
Matt Eland Matt Eland
Profile icon Matt Eland

Table of Contents (24) Chapters

Preface Part 1: Refactoring with C# in Visual Studio
Chapter 1: Technical Debt, Code Smells, and Refactoring Chapter 2: Introduction to Refactoring Chapter 3: Refactoring Code Flow and Iteration Chapter 4: Refactoring at the Method Level Chapter 5: Object-Oriented Refactoring Part 2: Refactoring Safely
Chapter 6: Unit Testing Chapter 7: Test-Driven Development Chapter 8: Avoiding Code Anti-Patterns with SOLID Chapter 9: Advanced Unit Testing Chapter 10: Defensive Coding Techniques Part 3: Advanced Refactoring with AI and Code Analysis
Chapter 11: AI-Assisted Refactoring with GitHub Copilot Chapter 12: Code Analysis in Visual Studio Chapter 13: Creating a Roslyn Analyzer Chapter 14: Refactoring Code with Roslyn Analyzers Part 4: Refactoring in the Enterprise
Chapter 15: Communicating Technical Debt Chapter 16: Adopting Code Standards Chapter 17: Agile Refactoring Index Other Books You May Enjoy

Refactoring the flight tracker

This chapter’s code focuses largely on a single FlightTracker class intended to track and display the outgoing flights from a commercial airport for passengers in the terminal, as pictured in Figure 4.1:

Figure 4.1 – FlightTracker displaying outbound flight statuses

Figure 4.1 – FlightTracker displaying outbound flight statuses

The FlightTracker class has a number of methods related to managing and displaying flights. It is supported by the Flight class which represents an individual flight in the system and the FlightStatus enum which represents all relevant statuses of a flight, as shown in the class diagram in Figure 4.2:

Figure 4.2 – A class diagram showing FlightTracker and supporting classes

Figure 4.2 – A class diagram showing FlightTracker and supporting classes

We’ll explore these pieces of code throughout this chapter, but for now, we need to understand that the key responsibilities of FlightTracker include the following:

  • Tracking a list of flights
  • Scheduling new flights (adding...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}