我们为什么需要设计模式 [英] Why do we need design patterns

查看:148
本文介绍了我们为什么需要设计模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们为什么需要设计模式,如工厂,抽象工厂和辛格尔顿?

Why do we need design patterns like Factory, Abstract Factory and Singleton?

推荐答案

设计模式提供易于识别和使用OOP解决共同的问题。他们是天生易于维护,因为很多人都熟悉他们。这非常类似于谷歌是如何工作的。每个人都知道谷歌,所以当你得到一个像查询什么是设计模式的目的,可以非常快速地使用这个通用的接口来解决问题。

Design Patterns provide easy to recognize and use OOP solutions to common problems. They're inherently easy to maintain, because many people are familiar with them. This is very similar to how google works. Everyone knows HOW to google, so when you get a query like "What is the purpose of design patterns", you can very quickly use this common interface to solve a problem.

设计模式也解决了有关可用性和可维护性特定的编程挑战。拿起书四的刚和拥有它。

Design Patterns also solve specific programming challenges regarding usability and maintainability. Pick up the Gang of Four book and have at it.

这篇关于我们为什么需要设计模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆