软件架构师 学习路线
This article is a summary of what I'm writing about in my newest project, solidbook.io - The Handbook to Software Design and Architecture with TypeScript. Check it out it you like this post.
本文是我在最新项目solidbook.io(使用TypeScript进行软件设计和架构的手册)中所写内容的摘要。 看看你喜欢这篇文章。
It's crazy to me to consider the fact that Facebook was once an empty text file on someone's computer.
考虑到Facebook曾经是某人计算机上的一个空文本文件,这让我感到疯狂。
Lol.
大声笑。
This past year, I've been going hard in software design and architecture, Domain-Driven Design, and writing a book on it, and I wanted to take a moment to try to piece it together into something useful I could share with the community.
在过去的一年中,我一直在努力进行软件设计和体系结构, 领域驱动设计 ,并为此编写一本书 ,我想花一点时间尝试将其组合成一些有用的东西,以便与社区分享。
Here's my roadmap for how to learn software design and architecture.
这是我学习软件设计和体系结构的路线图。
I've broken it down into two artifacts: the stack and the map.
我将其分解为两个工件: 堆栈和map 。
堆栈 (The Stack)
Similar to the OSI Model in networking, each layer builds on top of the foundation of the previous one.
与网络中的OSI模型类似,每一层都建立在前一层的基础之上。
地图 (The Map)
While I think the stack is good to see the bigger picture of how everything works together, the map is a little bit more detailed (and inspired by the web developer roadmap) and as a result, I think it's more useful.
尽管我认为可以很好地查看所有组件如何协同工作的总体情况,但该地图稍微详细一点(并受到Web开发人员路线图的启发),因此,我认为它更有用。
Here it is below! To fork the repo, read my detailed write-up and download it in high-res, click here.
在这里在下面! 要生成仓库,请阅读我的详细文章并以高分辨率下载,请单击此处 。
阶段1:清除程式码 (Stage 1: Clean code)
The very first step towards creating long-lasting software is figuring out how to write clean code.
创建持久软件的第一步是弄清楚如何编写简洁的代码 。
Clean code is code that is easy to understand and change. At the low-level, this manifests in a few design choices like:
干净的代码是易于理解和更改的代码。 在底层,这体现在一些设计选择中,例如:
- being consistent 保持一致
- preferring meaningful variable, method and class names over writing comments 优先于有意义的变量,方法和类名,而不是编写注释
- ensuring code is indented and spaced properly 确保代码缩进并正确间隔
- ensuring all of the tests can run 确保所有测试都可以运行
- writing pure functions with no side effects 编写没有副作用的纯函数
- not passing null 不传递空
Writing clean code is incredibly important.
编写干净的代码非常重要。
Think of it like a game of jenga.
可以把它想像成是一种积木游戏。
In order to keep the structure of our project stable over time, things like indentation, small classes and methods, and meaningful names, pay off a lot in the long run.
为了使我们的项目结构长期稳定,缩进,小类和方法以及有意义的名称之类的东西从长远来看很有意义。
The best resource to learn how to write clean code is Uncle Bob's book, "Clean Code".
学习如何编写干净代码的最佳资源是Bob叔叔的书“ Clean Code ”。
第二阶段:编程范例 (Stage 2: Programming Paradigms)
Now that we're writing readable code that's easy to maintain, it would be a good idea to really understand the 3 major programming paradigms and the way they influence how we write code.
既然我们正在编写易于维护的可读代码,那么真正了解这三种主要的编程范例及其对我们编写代码的方式的影响将是一个好主意。
In Uncle Bob's book, "Clean Architecture", he brings attention to the fact that:
在Bob叔叔的书《 Clean Architecture 》中,他注意到以下事实:
- Object-Oriented Programming is the tool best suited for defining how we cross architectural boundaries with polymorhpism and plugins 面向对象编程是最适合定义我们如何利用多态性和插件跨越架构边界的工具
- Functional programming is the tool we use to push data to the boundaries of our applications 函数式编程是我们用来将数据推送到应用程序边界的工具
- and Structured programming is the tool we use to write algorithms 结构化编程是我们用来编写算法的工具
This implies that effective software uses a hybrid all 3 programming paradigms styles at different times.
这意味着有效的软件在不同时间使用所有三种编程范例样式的混合。
While you could take a strictly functional or strictly object-oriented approach to writing code, understanding where each excels will improve the quality of your designs.
尽管您可以采用严格的功能性或严格的面向对象的方法来编写代码,但是了解每个方面的优势将提高您的设计质量。
If all you have is a hammer, everything seems like a nail.
如果您只有锤子,那么一切似乎都像钉子。
软件架构师 学习路线