Building Maintainable Software, Java Edition: Ten Guidelines for Future-Proof Code (Paperback) (構建可維護的軟體:Java 版未來-proof 代碼的十條準則)

Joost Visser, Sylvan Rigal, Rob van der Leek, Pascal van Eck, Gijs Wijnholds

買這商品的人也買了...

相關主題

商品描述

Have you ever felt frustrated working with someone else’s code? Difficult-to-maintain source code is a big problem in software development today, leading to costly delays and defects. Be part of the solution. With this practical book, you’ll learn 10 easy-to-follow guidelines for delivering Java software that’s easy to maintain and adapt. These guidelines have been derived from analyzing hundreds of real-world systems.

Written by consultants from the Software Improvement Group (SIG), this book provides clear and concise explanations, with advice for turning the guidelines into practice. Examples for this edition are written in Java, while our companion C# book provides workable examples in that language.

  • Write short units of code: limit the length of methods and constructors
  • Write simple units of code: limit the number of branch points per method
  • Write code once, rather than risk copying buggy code
  • Keep unit interfaces small by extracting parameters into objects
  • Separate concerns to avoid building large classes
  • Couple architecture components loosely
  • Balance the number and size of top-level components in your code
  • Keep your codebase as small as possible
  • Automate tests for your codebase
  • Write clean code, avoiding "code smells" that indicate deeper problems

商品描述(中文翻譯)

你是否曾經在與他人的程式碼合作時感到沮喪?難以維護的原始碼是當今軟體開發中的一個大問題,導致延誤和缺陷的成本增加。成為解決方案的一部分。透過這本實用書,您將學習到10個易於遵循的指南,以提供易於維護和適應的Java軟體。這些指南是從分析數百個真實系統中獲得的。

本書由軟體改進小組(SIG)的顧問撰寫,提供清晰簡明的解釋,並提供將指南轉化為實踐的建議。本版本的示例是用Java編寫的,而我們的C#書籍則提供了該語言的可行示例。

- 編寫短小的程式碼單元:限制方法和建構函式的長度
- 編寫簡單的程式碼單元:限制每個方法的分支點數量
- 避免複製有錯誤的程式碼,而是編寫一次
- 通過將參數提取到物件中,使單元介面保持小巧
- 分離關注點,避免構建大型類別
- 鬆散耦合架構組件
- 在程式碼中平衡頂層組件的數量和大小
- 保持程式碼庫尺寸盡可能小
- 自動化程式碼庫的測試
- 編寫乾淨的程式碼,避免顯示更深層次問題的「程式碼異味」