TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What are your most used design patterns?

4 点作者 era86超过 12 年前
I'm reviewing all sorts of design patterns, just to refresh my memory. What are some of the most used design patterns in the Hacker News community? Just curious. Thanks!

6 条评论

jarek-foksa超过 12 年前
Publisher/subscriber and composite patterns had the greatest impact on the quality of my code, apps that are composited from small decoupled parts are much easier to reason about.<p>I'm also using delegate and prototype patterns a lot, though those are rather dangerous when misused. Deep inheritance chains or excessive method overrides can easly make the code unmaintainable.
评论 #5029286 未加载
fusiongyro超过 12 年前
I get a lot of mileage out of the delegate pattern. We used visitor exactly once in our codebase, but it's pretty fantastic for that one place it's needed. We use observer extensively. More than other patterns that one strikes me as something the language should do for me.
评论 #5029279 未加载
memracom超过 12 年前
I suspect that the most used pattern in the HN community is the ActiveRecord pattern although many who use it probably are not aware that they are doing so.
Avalaxy超过 12 年前
Service Layer, Repository, Unit of Work. Those are the first I can think of (and use very often).
elclanrs超过 12 年前
In JavaScript I'd say I use the module pattern and prototype pattern the most.
ulisesrmzroche超过 12 年前
Composed Method.