Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 3.44 KB

README.md

File metadata and controls

55 lines (39 loc) · 3.44 KB

Design Patterns: Not Just for Architects

Level: Introductory

Design patterns are not just for architects. In fact, you already use design patterns without even knowing it. Observer, Facade, Iterator, Proxy -- these are just a few of the patterns that you have probably used. But it is really hard to use a tool effectively when you don't even know you are using it. So let's fix that.

In this session, you will learn what design patterns are (and what they are not). You will see both the benefits and consequences of patterns. And you will see several of the Gang of Four patterns that you already use (they may even be built into your programming language). Don't know who the Gang of Four is? You'll learn that, too. Once we understand design patterns, we can find solutions that people way smarter than us have already implemented. This gives us another set of tools that we can use to build great software.

You will learn:

  • What design patterns are
  • How you are already using design patterns (even if you don't realize it)
  • How intentional use of patterns can lead to better software

Project Layout

Each pattern has its own folder/project of the same name.

  • Observer/Observer.csproj
  • Iterator/Iterator.csproj
  • Facade/Facade.csproj
  • ChainOfResponsibility/ChainOfResponsibility.csproj
  • Proxy/Proxy.csproj

In addition, there are 2 supporting projects:

  • People.Service/People.Service.csproj
    The service used by the "Proxy" sample.
  • Shared/Shared.csproj
    Shared elements like the "Person" object and sample data.

Running the Projects

Each project can be started by setting the startup project from Visual Studio 2022 or by using "dotnet run" on the command line for the project.

In order for the "Proxy" sample to work, the "People.Service" service must be started. To start the service, navigate to the "Person.Service" folder from the command line and type "dotnet run".

Ex:

C:\learning-design-patterns\People.Service> dotnet run

The service endpoint can be found at http://localhost:9874/people

Additional Resources