views:

144

answers:

5

Duplicate:

Learning implementing design patterns for newbies

I have been a developer for years and have my way of developing and have always kept up with the latest techologies. I want to start using a design pattern in the hope it will improve my development speed but I need to find one to apply and I need to find a full open source sample that demonstrates it.

I use and have an application that uses LINQ to SQL and .net 3.5 I tried to apply the repository pattern but found the structure complex and having to hack my way through it.

Any advice for someone who wants to better their programming style?

A: 

Patterns aren't really "tech" in the traditional sense. Using patterns means applying your specific knowledge of a domain to a problem keeping in mind the patterns which apply to that domain. They are useful to exactly the extent that you have a base of experience to put them in context.

The repository pattern, for example, is maybe not the best starting place for constructing a database architecture based on a pattern. Have you got a simpler pattern implemented such as Table Module or (in the specific case of data access) Active Record? If not then perhaps you should start there. These patterns focus on a fairly limited, basic way of organizing data and operations. Repository is more like a meta-pattern that then builds on top of these patterns, organizing a complex domain-data boundary into a simpler collection-like interface.

Mike Burton
A: 

Read blogs (RSS Feeds are prime). Read magazines. Read random MSDN entries. Write little trial applications. The only way to keep up is to discover it and practice it.

Randolpho
A: 

Two books that I would suggest reading are:

Refactoring: Improving the Design of Existing Code (ISBN: 0-201-48567-2) and Refactoring To Patterns (ISBN: 0-321-21335-1)

Both are great books that will help you, at a high level, understand the when's and why's to applying patterns to your code. In addition, they are great reference material for some of the most commonly used patterns out there.

To be clear, these books are by no means the "complete library" of design patterns.

levi rosol
A: 

I would sincerely recommend dofactory.com

which also offers code examples in vb.net + c# for all the design patterns

Vikram
A: 

My simple advice for bettering your programming style:

  • Pick a technology that you find productive and "fun" and keep with it to learn how to fully explore it's potential.
  • Don't try to learn all the new technologies all the time - just keep yourself oriented.
  • Seek advice and solutions where and when you actually need them - don't waste time learning solutions to problems you don't (yet) have.
  • Regarding design patterns... Well... I'll probably get shot for this, but I don't really like the idea of cramming them all into my head "just in case". They are really a cooking book of "good solutions" for common problems. My advice here is: Whenever you run into problems that you can't come up with an obvious/immediate solution for - use them as reference.
  • Learn from your mistakes (you'll make them).
  • Don't marry your code. Throw away and rewrite is an excellent way of bettering the style.
Subtwo