用C#设计模式[英] Design Patterns with C#

本文是小编为大家收集整理的关于用C#设计模式的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我打算在工作中学习C# - 中等复杂的(2000行代码)项目.我有兴趣沿途拾起"设计模式".

任何人都可以建议一本不假设C#专业知识并教授设计模式的书吗?如果这本书不专门设计模式(可能是章节之一)是可以的.

推荐答案

一本出色的书是头部首次设计模式.易于理解和遵循,有趣的阅读.

gof book ,但我发现它非常干燥,很难掌握. 不是我建议学习.

示例在Java中,但是这些概念翻译得很好.

您甚至可以得到 c#示例.

其他推荐答案

头部第一个系列是一个很好的起点

我会说请先使用第一本书

其他推荐答案

设计模式实际上是语言不可知论.他们没有与特定语言有关.因此,例如,与Java一起使用的任何设计模式都将适用于C#.

当然,有一些模式可以与MVVM等特定的语言/技术一起使用,但我认为您不在WPF或Silverlight中写作,对吗?对于Web,您可以选择使用MVC而不是WebForms.

以及关于书籍,您可以看一下

因为C#是一种完整的OO语言,因此您必须适应OO设计原理和图案.

本文地址:https://www.itbaoku.cn/post/627766.html

问题描述

I am planning to learn C# on the job - a moderately complex (2000 lines of code) project. I am interested in picking up "design patterns" along the way.

Can anyone suggest a book that doesn't assume too much of c# expertise and teaches design patterns? It's ok if the book is not devoted to design patterns (it could be one of the chapters).

推荐答案

An excellent book is Head First Design Patterns. Easy to understand and follow and a fun read.

The GoF book is where it all started, but I found it very dry and difficult to grasp. Not what I would recommend for learning.

Examples are in Java, but the concepts translate well.

You can even get C# examples.

其他推荐答案

HEAD First Series is a good starting point

i would say please use HEAD First OOAD book also

其他推荐答案

Design patterns are actually language agnostic. They are not tied to a particular language. So for instance any design pattern that works with Java, will work for C# too.

Of course there are patterns which works with a particular language/technology such as MVVM, but I don't think you are writing in WPF or Silverlight, do you? For web you can choose to go with MVC instead of WebForms.

And about the books, you can take a look at

Because C# is a full OO language, you will have to adapt to OO design principles and patterns.