Atomic Refactoring: Isolating Wikipedia's logging layer with App Splitter & Android Studio
Автор: Legacy Code HQ
Загружено: 2024-09-18
Просмотров: 296
Описание:
In this video, we'll explore advanced refactoring techniques as we extract the logging layer from Wikipedia’s Android codebase. We'll demonstrate how to creatively use various tools—even in the absence of automated tests—to make safe changes that you can ship to production confidently.
The video showcases:
• Creative use of IDE refactoring capabilities
• Leveraging the Kotlin compiler and linter
• Utilizing a Git GUI client for code reviews
• Implementing strategic manual testing when applicable
We'll introduce App Splitter, a tool we're building to assist Android engineers and their teams in modularizing large Android codebases. In the first 10 minutes, we demonstrate App Splitter's capabilities to:
• Define boundaries for the logging layer before extraction
• View and review dependencies for classes under extraction
• Mark classes for extraction or breaking
• Verify boundaries after breaking dependencies
In the remaining 20 minutes, we'll put Android Studio into action:
• Extracting functions (with use of nonsensical names)
• Extracting interfaces
• Pulling members up
• Elevating local variables to properties
• Inlining functions
• Optimizing import statements to verify broken dependencies
We'll also cover:
• Dealing with cyclic dependencies
• Planning and executing strategic manual tests
• Utilizing Sublime Merge (Git GUI client) for continuous code reviews
• Employing micro-commits for granular change tracking
Whether you're tackling a legacy codebase or optimizing your current project, this step-by-step guide offers practical techniques to enhance your Android/Kotlin refactoring workflow.
Interested in early access to App Splitter? Visit this link below, and we'll let you know when the product is ready.
https://docs.google.com/forms/d/e/1FA...
0:00 Introduction & objectives
1:45 Specifying class and module to extract (App Splitter)
2:23 Planning your extraction by defining boundaries (App Splitter)
7:17 Mechanisms to use for safe and reliably refactoring
9:42 Planning the refactoring
10:21 Breaking dependency between `L` and `ReleaseUtil`
10:30 Extract function (nonsensical names)
14:18 Introducing a `ReleaseType` interface
15:00 Extract interface
15:35 Pull members up
16:41 Introduce variable & specify type explicitly
18:46 Dropping commits to rectify mistakes
20:42 Promote local variable to property
21:43 Strategic manual testing (fail first)
25:53 Breaking dependency between `L` and `WikipediaApp`
27:23 Reviewing the changeset using a git GUI client
27:47 Final touches (inline intermediate functions)
28:48 Reviewing dependencies (App Splitter)
29:41 Closing notes
#androiddevelopment #androiddeveloper #kotlin #intellij #androidstudio #refactoring
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: