- Clean Code in C#
- Jason Alls
- 202字
- 2021-06-18 18:28:09
Classes, Objects, and Data Structures
In this chapter, we will look at organizing, formatting, and commenting on classes. We will also look at writing clean C# objects and data structures that respect the Law of Demeter. In addition, we will look at immutable objects and data structures and the interfaces and classes that define immutable collections in the System.Collections.Immutable namespace.
We will cover the following broad topics:
- Organizing classes
- Commenting for document generation
- Cohesion and coupling
- The Law of Demeter
- Immutable objects and data structures
As you progress through this chapter, you will learn the following skills:
- How to effectively organize your classes using namespaces.
- Your classes will become smaller and more meaningful as you learn to program them with only a single responsibility.
- When it comes to writing your own APIs, you will be able to provide good developer documentation by providing comments that aid document generation tools.
- Any programs you write will be easy to modify and extend due to their high cohesion and low coupling.
- Finally, you will be able to apply the Law of Demeter and write and use immutable data structures.
So, let's start by looking at how we can effectively organize our classes by using namespaces.
推薦閱讀
- 微服務(wù)設(shè)計(jì)(第2版)
- The Supervised Learning Workshop
- Learning Cython Programming(Second Edition)
- 移動(dòng)UI設(shè)計(jì)(微課版)
- MATLAB圖像處理超級(jí)學(xué)習(xí)手冊(cè)
- PyQt從入門到精通
- MySQL 8 DBA基礎(chǔ)教程
- FreeSWITCH 1.6 Cookbook
- 編寫(xiě)高質(zhì)量代碼:改善C程序代碼的125個(gè)建議
- C語(yǔ)言實(shí)驗(yàn)指導(dǎo)及習(xí)題解析
- Salesforce Reporting and Dashboards
- 執(zhí)劍而舞:用代碼創(chuàng)作藝術(shù)
- Spring MVC+MyBatis開(kāi)發(fā)從入門到項(xiàng)目實(shí)踐(超值版)
- Maker基地嘉年華:玩轉(zhuǎn)樂(lè)動(dòng)魔盒學(xué)Scratch
- ASP.NET求職寶典