
写代码的艺术
写代码的艺术 Building Maintainable Software
Dreamer who
=== Happiness isn't something you experience; it's something you remember.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
8 design patterns that every developer should know
8 design patterns that every developer should knowAs a developer, you are constantlyresolving problems. Many of these problems probably werealready solved by other developers, so, why do w...转载 2019-05-15 23:35:07 · 344 阅读 · 0 评论 -
Why you should avoid conditional statements
Developers tend to use a lot of conditional statements in their code. Of course, each flow has one specific path, its own specific validations, etc. It is very natural that your code has a lot of deci...转载 2019-05-16 14:08:39 · 400 阅读 · 0 评论 -
11 mistakes java developers make when using exceptions
11 mistakes java developers make when using exceptionsThe problem: If you use Exceptions in the wrong way, bugs will be very difficult to find. If you always use generic Exceptions, how can oth...转载 2019-04-29 16:23:13 · 294 阅读 · 0 评论 -
5 great programming techniques every developer should know
5 great programming techniques every developer should know1 – Encapsulate ifs inside their methods, not outside them:Bad example:? 1 2 3 4 5 6 7 8 9 ...转载 2019-04-29 16:30:21 · 243 阅读 · 0 评论 -
Software Architecture Patterns:Microkernel Architecture
目录 Software Architecture Patterns:Microkernel ArchitectureBase design principlePattern DescriptionPattern ExamplesConsiderationsPattern AnalysisOverall agilityEase of deployment...原创 2019-04-21 22:06:59 · 844 阅读 · 0 评论 -
Software Architecture Patterns: Layered Architecture
目录 Software Architecture Patterns: Layered ArchitecturePattern DescriptionKey ConceptsPattern ExampleConsiderationsPattern AnalysisOverall agilityEase of deploymentTestabilityPe...原创 2019-04-21 19:01:36 · 1025 阅读 · 0 评论 -
分层架构之间的调用关系
为了美感和欣赏!艺术家们提出了设计即化妆!为了有共同的语言交流,就制定了化妆规则! 代码记得分层,为了避免循环依赖,上层只能调用下层,严格的只能调用临近的下层,而不能跨层。如果跨层,可以用事件的方式(后门,但不能随便乱用啊)。 注:同层之间最好不要相互调用,因为也会带来循环依赖!https://msdn.microsoft.com/en-us/library/ee658109...原创 2018-04-05 16:42:40 · 2153 阅读 · 0 评论 -
What Causes Poor Availability?
What Causes Poor Availability?What causes an application that previously performed well to begin exhibiting pooravailability? There are many causes:Resource exhaustionIncrease the number原创 2017-11-20 23:50:13 · 475 阅读 · 0 评论 -
高效能程序员的修炼
高效能程序员的修炼一、永远都是你的错在怨天尤人之前,我们应该自我反省、努力把自身的问题解决了。、代码产权的另一方面是代码责任。无论你的软件出现什么样的问题--甚至最开始错的地方根本就不是你的代码-你也应该总是假定问题出在你的代码里,并且根据这个假设采取行动。二、大道至简你永远都有简化的空间。作为一个软件开发者,你就是自己最大的敌人。你越早认识到这点,你的境况就会原创 2017-02-12 15:46:59 · 1171 阅读 · 0 评论 -
REST API 设计规则
REST API 设计规则URIsREST API用URI(Uniform Resource Identifiers )来表示资源。例如: http://api.example.restapi.org/france/paris/louvre/leonardo-da-vinci/mona-lisa下面的URI就可读性很差: http://api.example.r原创 2016-11-06 18:55:03 · 3147 阅读 · 0 评论 -
java设计模式之单例模式(Singleton pattern)
java设计模式之单例模式(Singleton pattern)单例模式的定义:Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine. The singlet原创 2016-08-01 12:42:32 · 1921 阅读 · 0 评论 -
Google首席工程师Joshua Bloch谈如何设计优秀的API
Google首席工程师Joshua Bloch谈如何设计优秀的APIHow to Design a Good API and Why it MattersWhy is API Design Important?APIs can be among a company's greatest assets_ Customers invest原创 2016-07-24 19:45:48 · 3204 阅读 · 1 评论 -
利用Swagger Maven Plugin生成Rest API文档
利用Swagger Maven Plugin生成Rest API文档Swagger Maven PluginThis plugin enables your Swagger-annotated project to generate Swagger specs and customizable, templated static documents during t原创 2016-03-06 23:49:21 · 18813 阅读 · 5 评论 -
Building Maintainable Software-java篇之 Write Clean Code
Building Maintainable Software-java篇之 Write Clean CodeWriting clean code is what you must do in order to call yourself a professional.—Robert C. MartinGuideline:• Write clean code.原创 2016-02-16 23:16:10 · 1988 阅读 · 0 评论 -
Building Maintainable Software-java篇之Automate Tests
Building Maintainable Software-java篇之Automate TestsKeep the bar green to keep the code clean.—The jUnit mottoGuideline:• Automate tests for your codebase.• Do this by writing autom原创 2016-02-16 22:58:19 · 1106 阅读 · 0 评论 -
Building Maintainable Software-java篇之Keep Your Codebase Small
Building Maintainable Software-java篇之Keep Your Codebase SmallProgram complexity grows until it exceeds the capability of the programmer who must maintain it.—7th Law of Computer Programming原创 2016-02-16 22:36:56 · 1779 阅读 · 0 评论 -
Building Maintainable Software-java篇之Keep Architecture Components Balanced
Building Maintainable Software-java篇之Keep Architecture Components BalancedBuilding encapsulation boundaries is a crucial skill in software architecture. —George H. F原创 2016-02-16 00:00:16 · 1629 阅读 · 0 评论 -
Building Maintainable Software-java篇之Couple Architecture Components Loosely
Building Maintainable Software-java篇之Couple Architecture Components LooselyThere are two ways of constructing a software design: one way is to make it so simplethat there are obviously no de原创 2016-02-15 23:41:24 · 1580 阅读 · 0 评论 -
Building Maintainable Software-java篇之Write Short Units of Code
Building Maintainable Software-java篇之Write Short Units of CodeAny fool can write code that a computer can understand. Good programmers writecode that humans can understand.原创 2016-02-12 12:05:22 · 1703 阅读 · 0 评论 -
Building Maintainable Software-java篇之Write Simple Units of Code
Building Maintainable Software-java篇之Write Simple Units of Code Each problem has smaller problems inside. —MartinFowlerGuide原创 2016-02-12 14:46:05 · 1140 阅读 · 0 评论 -
Building Maintainable Software-java篇之Write Code Once
Building Maintainable Software-java篇之Write Code OnceNumber one in the stink parade is duplicated code.—Kent Beck and Martin Fowler,Bad Smells in CodeGuideline:• Do not copy code.原创 2016-02-13 12:45:55 · 1798 阅读 · 0 评论 -
Building Maintainable Software-java篇之Keep Unit Interfaces Small
Building Maintainable Software-java篇之Keep Unit Interfaces SmallBunches of data that hang around together really ought to be made into their own object. —Marti原创 2016-02-13 13:18:41 · 1645 阅读 · 0 评论 -
Building Maintainable Software-java篇之Separate Concerns in Modules
Building Maintainable Software-java篇之Separate Concerns in Modules In a system that is both complex and tightly coupled, accidents are inevitable.—Charles Perrow’s Normal Accidentstheory in原创 2016-02-13 14:24:55 · 1700 阅读 · 0 评论