An Atypical ASP.NET Core 5 Design Patterns Guide
eBook - ePub

An Atypical ASP.NET Core 5 Design Patterns Guide

A SOLID adventure into architectural principles, design patterns, .NET 5, and C#

Carl-Hugo Marcotte

Partager le livre
  1. 762 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

An Atypical ASP.NET Core 5 Design Patterns Guide

A SOLID adventure into architectural principles, design patterns, .NET 5, and C#

Carl-Hugo Marcotte

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

A.NET developer's guide to crafting robust, maintainable, and flexible web apps by leveraging C# 9 and.NET 5 features and component-scale and application-scale design patterns

Key Features

  • Apply software design patterns effectively, starting small and progressing to cloud-scale
  • Discover modern application architectures such as vertical slice, clean architecture, and event-driven microservices
  • Explore ASP.NET design patterns, from options to full-stack web development using Blazor

Book Description

Design patterns are a set of solutions to many of the common problems occurring in software development. Knowledge of these design patterns helps developers and professionals to craft software solutions of any scale.

ASP.NET Core 5 Design Patterns starts by exploring basic design patterns, architectural principles, dependency injection, and other ASP.NET Core mechanisms. You'll explore the component scale as you discover patterns oriented toward small chunks of the software, and then move to application-scale patterns and techniques to understand higher-level patterns and how to structure the application as a whole. The book covers a range of significant GoF (Gangs of Four) design patterns such as strategy, singleton, decorator, facade, and composite. The chapters are organized based on scale and topics, allowing you to start small and build on a strong base, the same way that you would develop a program. With the help of use cases, the book will show you how to combine design patterns to display alternate usage and help you feel comfortable working with a variety of design patterns. Finally, you'll advance to the client side to connect the dots and make ASP.NET Core a viable full-stack alternative.

By the end of the book, you'll be able to mix and match design patterns and have learned how to think about architecture and how it works.

What you will learn

  • Apply the SOLID principles for building flexible and maintainable software
  • Get to grips with.NET 5 dependency injection
  • Work with GoF design patterns such as strategy, decorator, and composite
  • Explore the MVC patterns for designing web APIs and web applications using Razor
  • Discover layering techniques and tenets of clean architecture
  • Become familiar with CQRS and vertical slice architecture as an alternative to layering
  • Understand microservices, what they are, and what they are not
  • Build ASP.NET UI from server-side to client-side Blazor

Who this book is for

This design patterns book is for intermediate-level software and web developers with some knowledge of.NET who want to write flexible, maintainable, and robust code for building scalable web applications. Knowledge of C# programming and an understanding of web concepts like HTTP is necessary.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que An Atypical ASP.NET Core 5 Design Patterns Guide est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  An Atypical ASP.NET Core 5 Design Patterns Guide par Carl-Hugo Marcotte en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Ciencia de la computaciĂłn et ProgramaciĂłn de Microsoft. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2020
ISBN
9781789340655

Section 1: Principles and Methodologies

This section focuses on architectural principles and development methodologies that we use throughout the book. Those introductory chapters are essential in terms of progressing toward making great architectural decisions.
We first look at how to approach the book itself, explore prerequisites, and see a few helpful topics. Then, we cover automated testing and xUnit, to finally jump into the architectural principles, where we begin our study of the fundamentals of modern software engineering.
This section comprises the following chapters:
  • Chapter 1, Introduction to .NET
  • Chapter 2, Testing Your ASP.NET Core Application
  • Chapter 3, Architectural Principles

Chapter 1: Introduction to .NET

The goal behind this book is not to create yet another design pattern book, but instead, it organizes the chapters cohesively based on scale and topics, allowing you to start small with strong bases and build slowly on top, in just the same way that you would build a program.
Instead of writing a guide that covers a few ways of applying a design pattern, we explore the thinking process behind the systems that we are designing from a software engineer's point of view.
This is not a magic recipe book, and from experience, there is no magic recipe when designing software; there is only your logic, knowledge, experience, and analytical skills. From that last sentence, let's define experience according to your past successes and failures. And don't worry, you will fail during your career, but don't get discouraged by it. The faster you fail, the faster you can recover and learn, leading to successful products. Many techniques covered in this book should help you achieve that goal. Everyone has failed and made mistakes; you won't be the first, and you certainly won't be the last.
The high-level plan looks like this:
  • We start by exploring basic patterns, architectural principles, and some crucial ASP.NET Core mechanisms.
  • Then we move to the component scale, exploring patterns oriented toward small chunks of the software.
  • Next, we move to application-scale patterns and techniques, where we explore higher-level patterns and how to structure the application as a whole.
  • Afterward, we tackle the client side to connect the dots and make ASP.NET a viable full stack alternative.
Many subjects covered throughout the book could have a book of their own. Once you are done with this book, you should have plenty of ideas about where to continue your journey into software architecture.
Here are a few pointers that I believe are worth naming:
  • The chapters are organized to start with small-scale patterns then get to higher-level ones, making the learning curve easier.
  • Instead of giving you a recipe, the book focuses on the thinking aspect and shows evolutions of some techniques to help you understand why the evolution happened.
  • Many use-cases combine more than one design pattern to illustrate alternate usage, aiming toward the understanding of the patterns and how to use them efficiently, as well as showing that a pattern is not a beast to tame but a tool to use, manipulate, and bend to your will.
  • As in real life, no textbook solution can solve all of our problems, and real problems are always more complicated than as they are explained in textbooks. In this book, my goal is to show you how to mix and match patterns and how to think "architecture" instead of how to follow instructions.
The introduction introduces different concepts that we will be exploring throughout the book, including refreshers on a few notions. We are also covering .NET and its tooling, as well as the technical requirements, such as where the source code is located.
The following topics will be covered in this chapter:
  • What is a design pattern?
  • Anti-patterns and code smells
  • Understanding the web – Request/Response
  • Getting started with .NET

What is a design pattern?

Since you just purchased a book about design patterns, I guess that you have some idea of what they are, but let's just make sure that we are on the same page:
Abstract definition: A design pattern is a proven technique that can be used to solve a specific problem.
In this book, we apply different patterns to solve different problems and how to leverage some open source tools to go further, faster! Abstract definitions make people sound intelligent and all, but there is no better way to learn than by experimenting with something, and design patterns are no different.
If that definition does not make sense to you yet, don't worry. You should have enough information at the end of the book to correlate the multiple practical examples and explanations with that definition, making it clear enough.
I like to compare programming to playing with LEGOÂź because what you must do is mostly the same: snap small pieces together to create something. It could be a castle, a spaceship, or something else that you want to build. With that analogy in mind, a design pattern is a plan to assemble a solution that fits one or more scenarios; a tower or a reactor, for example. Therefore, if you lack imagination or skills in the case of LEGOÂź, possibly because you are too young, your castle might not look as good as someone else's that has more experience. Design patterns give you those tools, helping you build and glue beautiful and reliable pieces together to improve that masterpiece. However, instead of snapping LEGOÂź blocks together, you nest code blocks and interweave objects in a virtual environment!
Before going into more detail, well-thought-out applications of design patterns should improve your application designs. That is true when you design a small component or a whole system alike. However, be careful; throwing patterns into the mix just to use them can lead to the opposite. Aim to write readable code that solves the issue at hand, not at over-engineering systems with as many patterns as you can.
As we have briefly mentioned, there are design patterns applicable to multiple software engineering levels, and in this book, we start small and grow cloud-scale! We follow a smooth learning curve, starting with simpler patterns and code samples that bend good practices a little to focus on the patterns, and finally end with more advanced full stack topics, integrating multiple patt...

Table des matiĂšres