有人可以给我一个过度使用的设计模式的例子吗? [英] Can anybody give me an example of overused design patterns?

查看:540
本文介绍了有人可以给我一个过度使用的设计模式的例子吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听过和阅读有关人们遇到过度设计模式的情况。好的,错过设计模式是可以理解的现象。它实际上意味着过度使用的设计模式?

I've been hearing and reading about cases when people had come across cases of overused design patterns. Ok, missused design patterns are understandable phenomenon. What does it actually mean overused design patterns?

你有什么例子,你为什么认为有太多的模式?

Do you have any examples and why do you think there are too many patterns?

推荐答案

singleton 可能是最多的过度使用的设计模式。我经常看到它在许多情况下被使用,当它超出范围并且更适合直接实例化对象。

The singleton is probably the most overused design pattern. I often see it used in many cases when it's out of scope and much more appropriate to directly instantiate objects.

之后,我相信工厂模式被用作实例化对象的捷径,多次没有真正的需要。

After that, I believe the factory pattern is way overused as a shortcut of instantiating objects, many times without a real need.

这篇关于有人可以给我一个过度使用的设计模式的例子吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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