Re: Has anyone used design patterns in his/her C#.NET project?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Curious <fir5tsight@xxxxxxxxx> wrote in news:9190855b-b317-41c1-8f25-
fa90e95a6a89@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:


yes, I use patterns rather religiously.

A business associate asked me what design patterns ("Gang of Four") I
used in designing my software system.

Although I read the entire book about Design Pattern, I never
explicitly used any pattern in my design. For instance, when I design
my trading system, I have many instances of "Order" and "Execution". I
simply "new" each to create a new instance without labeling this as
"Factory" pattern.

And you might only have one type of order and execution throughout your
entire process and not currently need the flexibility of a factory.

Where I routinely use factories is on communication type libraries.
Examples:

Short Url Library uses a factory to determine which short url site API
to use. Configured in the config file.

Data Access library has a factory for database type.

Even trickier, generic LINQ to SQL library (meaning uses generics) has a
factory to retrieve DataContext.

Another pattern I use often is a singleton. Almost every application has
some information that is only applicable once for all users. The
Singleton allows you to spin it up once and reuse.

I asked around my developer friends, no one explicitly has used any
design pattern in their work. Do I miss anything here? Shall I think
of using design patterns next time when I develop a new system?

Possibly, but when you first get started you will be tempted to over
design pattern things, which can be just as bad. A better approach is
building in refactoring time and refactor to patterns (which is a great
book, btw).

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
.



Relevant Pages

  • Re: PZ Myers on Evolution without Natural Selection
    ... Design is a subset of pattern. ... this may take the form of being white in a snowy environment, ... design pattern' to accurately describe the distinction you want to ... Do you understand the concept of a tautology ?http://en.wikipedia.org/wiki/Tautology_%28rhetoric%29 ...
    (talk.origins)
  • Re: advantages of forth over other languages
    ... Design patterns are nothing more than documentation that provides a name, an intent, context, and discussion. ... The Wikipedia article on design patterns gives a good overview of the usual sections found in a design pattern: ... The purpose of pseudocode is to describe abstractly an implementation. ... The basic idea in COR is that you have some notion of a command and you pass this command on down through code that either acts on the command or passes the command on to other code that can act on the command. ...
    (comp.lang.forth)
  • Re: Konstruktor Frage
    ... paar Informationen zu den hier angesprochenen Pattern: ... [Factory Method Design Pattern] ... [Abstract Factory Design Pattern] ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: DALC vs DAO
    ... DAO is a design pattern. ... >it is a GOF design pattern or at least a branch off of that. ... The J2EE DAO (Data Access Object) pattern is, ... equivalent to a "Table Data Gateway" or "Row Data Gateway" ...
    (microsoft.public.dotnet.general)
  • Re: Factory design pattern Vs abstract factory design pattern
    ... > difference between the Factory design pattern and the Abstract Factory ...
    (comp.object)