Skip to content

Commit 700f1d5

Browse files
authored
Merge pull request #52 from ForEvolve/design-pattern-third-edition
Architecting ASP.NET Core Applications—Unveiling the Third Edition
2 parents eb5cd9d + 55e5168 commit 700f1d5

13 files changed

+826
-961
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Gemfile.lock
44
_drafts/en/_emmet.html
55
.jekyll-metadata
66
.jekyll-cache
7-
raft
7+
raft
8+
rafts

.vscode/settings.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@
1010
"grammarly.selectors": [
1111
{
1212
"language": "jekyll",
13-
"scheme": "file",
14-
"pattern": "_drafts/en/2022-05-28-an-atypical-asp-net-core-6-design-patterns-guide-second-edition.md"
13+
"scheme": "file"
1514
},
1615
{
1716
"language": "markdown",
1817
"scheme": "file",
19-
"pattern": "_drafts/en/2022-05-28-an-atypical-asp-net-core-6-design-patterns-guide-second-edition.md"
18+
"pattern": "_drafts/en/2024-02-01-an-atypical-asp-net-core-8-design-patterns-guide-third-edition-unveiling.md"
2019
}
2120
],
22-
"[markdown]":{
21+
"[markdown]": {
2322
"editor.wordWrap": "on"
24-
},
23+
}
2524
}

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ The blog content is Copyright (c) 2017 Carl-Hugo Marcotte under Creative Commons
88

99
```
1010
jekyll serve --watch
11-
grunt watch
11+
npx grunt
12+
npx grunt watch
13+
~~grunt watch~~
1214
jekyll serve --watch --drafts
1315
bundle exec jekyll serve --watch --drafts
1416
bundle exec jekyll serve --watch --drafts --incremental --future

_data/buy-books.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
[
2+
{
3+
"linkHref": "https://adpg.link/buy8",
4+
"bookTitle": "Architecting ASP.NET Core Applications: An Atypical Design Patterns Guide for .NET 8, C# 12, and Beyond, 3rd Edition",
5+
"imageSrc": "//cdn.forevolve.com/blog/images/net8-book-cover/ADPG-NET8-book-cover-200.png",
6+
"amazonExt": "",
7+
"enabled": true
8+
},
29
{
310
"linkHref": "https://adpg.link/buycom6",
411
"bookTitle": "An Atypical ASP.NET Core 6 Design Patterns Guide: A SOLID adventure into architectural principles and design patterns using .NET 6 and C# 10, 2nd Edition",
@@ -41,4 +48,4 @@
4148
"amazonExt": ".ca",
4249
"enabled": false
4350
}
44-
]
51+
]
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
---
2+
title: 'Book: An Atypical ASP.NET Core 8 Design Patterns Guide'
3+
subtitle: "What's new in the third edition?"
4+
date: 2023-12-01 00:00:00 -0500
5+
post-img: '/img/2023-12-Book3-release-960.png'
6+
# og-img: '//cdn.forevolve.com/blog/images/articles-header/2022-05-Book2-release-LinkedIn.png'
7+
# twitter-img: '//cdn.forevolve.com/blog/images/articles-header/2022-05-Book2-release-LinkedIn.png'
8+
lang: en
9+
categories: en/articles
10+
tags:
11+
- UML
12+
- Book
13+
proficiency-level: Intermediate
14+
---
15+
16+
...<!--more-->
17+
18+
# What's new and what's changed?
19+
20+
## Sections/general
21+
22+
- Renamed and reworked the sections
23+
- Removed Section 5 and all (or most?) UI code and moved the focus of the book purely on REST APIs instead.
24+
- Consolidated on using the term `REST APIs` instead of `web APIs`, since `web APIs` can be confused with Browsers web APIs (like local storage).
25+
- Refactored pararaphs into lists into **tables** to improve clarity.
26+
- Refactored many section heading to improve navigation to a specific subject.
27+
- Reviewed the questions and answers of many chapters; lot's of improvements.
28+
- Reviewed the introduction, section conclusions, and chapter summary of multiple chapters.
29+
- Lots of code formatting improvements.
30+
- Removed grid background in diagrams
31+
32+
## Chapter 2
33+
34+
- Major reorg of subjects.
35+
- Improve the readability of the code samples.
36+
- Add a section about black-, white-, and grey-box testing.
37+
- Add a section about _Test case creation_, _Boundary Value Analysis_, _Decision Table Testing_, _State Transition Testing_, and _Use Case Testing_.
38+
39+
## Chapter 3
40+
41+
- Reorder subjects, starting with separation of concerns, DRY, and KISS instead of SOLID. Moved SOLID after.
42+
- Rewrite SOLID code samples. They are now simpler and more enterprise focused than game focused.
43+
- Rewrite the covariant and contravariant explanation and sample using generics.
44+
- PLANNED: Add "you aren’t gonna need it (YAGNI) principle"
45+
46+
## Chapter 4-6
47+
48+
- Chapter 4: extracted REST, HTTP, DTO, and API contracts (part of section 1) + rewrite/improvements
49+
- Chapter 5: new introduction to the minimal hosting model and minimal APIs (part of section 2), including deep dive into minimal APIs.
50+
- Chapter 6: Merged the two MVC chapters into one (2nd ed. Chapter 4 and 5) with a focus on REST APIs.
51+
- The same new, real-world oriented code example is used with both Minimal APIs (Chapter 5) and MVC (Chapter 6), allowing readers to compare the two implementations.
52+
53+
## Chapter 7
54+
55+
- Minor changes improving the explanations, descriptions, and the flow.
56+
57+
**Strategy:**
58+
59+
- Replaced the Strategy console app by a minimal API app.
60+
61+
**AbstractFactory:**
62+
63+
- Rename HighGrade and LowGrade by HighEnd and LowEnd for more proper English. Also renamed MiddleGrade & MiddleEnd to MidRange.
64+
- Simplify tests to make them easier to read. Converted the `Theory` to `Fact`.
65+
- Simplified the projects and solutions structure (kept only one solution).
66+
- Grouped the classes by familly instread of by "layers". The folders went from (root, models) to (root{abstractions}, HighEnd, LowEnd, MidRange).
67+
68+
**Singleton:**
69+
70+
- Use the null-coalescing assignment operator `??=` instead of a `if` block.
71+
72+
## Chapter 8
73+
74+
- Reordered and reworked the Dependency Injection theory section.
75+
- Rewrote and improved the code sample and most of the Strategy section, including Constructor/Property/Method injection, and Guard clauses.
76+
- Extracted Guard clauses into its own top-level section
77+
- Updated the project Application state.
78+
- Talk quickly about the new .NET 8 `TimeProvider` (wishlist project).
79+
- Rewrote the factory section and updated the code to reflect the new Strategy code. (the old code could be a good blog post).
80+
- Rewrote the summary to reflect the new content and added a list of Key takeaways.
81+
82+
## Chapter 9
83+
84+
- Split the chapter in two.
85+
- Rewrote most of the options chapter, including code samples. Made them clearer, shorter, more consise, and more "building-block-oriented".
86+
- Add a code sample about the IOptionsMonitor.OnChange method.
87+
- Add a code sample about centralizing the configuration and validation into the options class.
88+
- Add a section about .NET 8 configuration-binding source generator
89+
- Add a section about .NET 8 options validation source generator
90+
- Add a section about ValidateOptionsResultBuilder
91+
92+
## Chapter 10
93+
94+
- No significant changes
95+
96+
## Chapter 11
97+
98+
- Rewrote the Book Store UI into an API (Composite Pattern)
99+
- Removed the ultra-large bookstore diagram and simplified it
100+
- Updated the bookstore data structure to reflect the API focus
101+
- Renamed the corporation and bookstores, added managers, and improved locations
102+
103+
## Chapter 12
104+
105+
**Template method**
106+
107+
- Added two test cases in a new test project
108+
- Corrected a bug in the code
109+
- Refactor the LinearSearchMachine algo
110+
111+
**Chain of Responsibilities**
112+
113+
- Improved the text by adding a few more steps to the example.
114+
- Extracted "Mixing the Template Method and Chain of Responsibility patterns" to its own section.
115+
116+
**Mixing the Template Method and Chain of Responsibility patterns**
117+
118+
- New section
119+
- Improved flow and reworked some explanations.
120+
121+
## Chapter 13
122+
123+
- Minor tweaks
124+
- Added a few questions
125+
- Added a life-like code sample to wrap the chapter
126+
127+
## Chapter 14
128+
129+
- Minor text tweaks
130+
131+
## Chapter 15
132+
133+
- Improved the headings
134+
- Add an example using Mapperly
135+
136+
## Chapter 16
137+
138+
- Few code tweaks, including the use of record classes instead of regular classes in the Mediator examples.
139+
- Renamed the pattern CQS from CQRS; even if it was true before, it's more precise now since CQS is a subset of CQRS.
140+
- Promoted the Code Smell – Marker Interfaces section to Heading 1.
141+
- Updated MediatR to version 12 (from v9).
142+
143+
## Chapter 17
144+
145+
- Update dependencies of the project to the latest versions (including a few breaking changes).
146+
- Refactor the headings, promoting `Anti-pattern – Big Ball of Mud` and `Continuing your journey` as level 1 sections.
147+
- Updated all diagrams (improved contrasts to some of them, making them more accessible).
148+
- Removed the custom FluentValidation & MediatR code to make validation work as it now works out of the box. Deleted the `FluentValidationExceptionFilter` (`IExceptionFilter`) class and the `ThrowFluentValidationExceptionBehavior<TRequest, TResponse>` (`IPipelineBehavior<TRequest, TResponse>`) class. Removed the need to register the validators as `ServiceLifetime.Singleton`.
149+
150+
## Chapter 18
151+
152+
- A brand new chapter about Request-EndPoint-Response (REPR) & Minimal API.
153+
- Defines the pattern.
154+
- Organize the code in different ways using only Minimal APIs.
155+
- Explore a larger project that includes exception handling, object mapping, and grey-box testing.
156+
157+
## Chapter 19
158+
159+
- Minor updates throughout the chapter.
160+
- Add a BFF example that fronts the Chapter 18 REPR example and showcases API layering (low-level operation in Chapter 18 and higher-level logic/operation in Chapter 19). 30 pages
161+
- Remake the Adapter section images.
162+
- Add an _Advantages and potential risks_ section under CQRS.
163+
164+
## Chapter 20
165+
166+
- New chapter about Modular Monolith.
167+
- Takes the nano-e-commerce app from Chapter 18 and 19 and makes it a modular monolith.
168+
- Adapt the code of the BFF to front the Monolith.
169+
- Add in-process EDA to synchronize the two domains (cart and catalog) using MassTransit.
170+
171+
# New Outline
172+
173+
```
174+
Section 1: Principles and Methodologies
175+
1. Introduction
176+
2. Automated Testing
177+
3. Architectural Principles
178+
4. REST APIs
179+
180+
Section 2: Designing with ASP.NET Core
181+
5. Minimal API
182+
6. Model-View-Controller
183+
7. Strategy, Abstract Factory, and Singleton Design Patterns
184+
8. Dependency Injection
185+
9. Application Configuration and the Options Pattern
186+
10. Logging patterns
187+
188+
Section 3: Components patterns
189+
11. Structural Patterns
190+
12. Behavioral Patterns
191+
13. Operation Result Pattern
192+
193+
Section 4: Applications patterns
194+
14. Layering and Clean Architecture
195+
15. Object Mappers, Aggregate Services, and Façade
196+
16. Mediator and CQRS Patterns
197+
17. Vertical Slice Architecture
198+
18. Request-EndPoint-Response (REPR)
199+
19. Introduction to Microservices Architecture
200+
20. Modular Monolith
201+
===
202+
**Notes about the content**
203+
#4: REST, HTTP, API Contracts, and the DTO pattern (were part of the MVC chapters before)
204+
#5: Includes an introduction to the Minimal Hosting model (consolidate the content about this and make it clearer for the readers)
205+
#6: MVC pattern & MVC + DTO (a stripped down version of the MVC chapters, focusing on MVC for REST APIs)
206+
===
207+
**TODO:**
208+
#2: add an info box about minimal hosting and the new Chapter 4 to explain readers that don't know about that, that we will talk about it there.
209+
```
210+
211+
# Wave 2
212+
213+
- Replaced code sample in Chapter 10 (logging)
214+
- Replaced code sample in Chapter 11 (facade)

_includes/buy-net5-book.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{%- for book in site.data.buy-books -%}
1+
{%- assign limit = 10 -%}
2+
{%- if include.limit -%}
3+
{%- assign limit = include.limit -%}
4+
{%- endif -%}
5+
{%- for book in site.data.buy-books limit: limit -%}
26
{%- if book.enabled -%}
37
<aside class="book">
48
<a

_layouts/post.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{%- endif -%}
2525
{%- endif -%}
2626
<header class="intro-header">
27-
<div class="hidden-xs intro-header-buy-net5-book">{%- include buy-net5-book.html -%}</div>
27+
<div class="hidden-xs intro-header-buy-net5-book">{%- include buy-net5-book.html limit=1 -%}</div>
2828

2929

3030
<div class="post-heading">
@@ -65,7 +65,7 @@ <h2 class="subheading">{{ page.subtitle }}</h2>
6565
>
6666
<small>({{ level.short-description }})</small>
6767
</aside>
68-
{% endif %} {%- include technology-relative-level-list.html technology-relative-level=page.technology-relative-level -%}
68+
{% endif %} {%- include technology-relative-level-list.html technology-relative-level=page.technology-relative-level -%}
6969
{% if page.tags[0] %}
7070
<aside class="tags">
7171
<i class="glyphicon glyphicon-tags"></i>
@@ -81,6 +81,13 @@ <h2 class="subheading">{{ page.subtitle }}</h2>
8181
{%- endif -%}
8282
</figure>
8383
{% endif %}
84+
{% if page.ai-assisted %}
85+
<aside class="ai-assisted">
86+
<i class="fa fa-info-circle" aria-hidden="true"></i>
87+
<strong>AI-assisted content:</strong>
88+
<small>An AI assisted a human in developing portions of this article. A human refined and edited the content for accuracy and clarity.</small>
89+
</aside>
90+
{% endif %}
8491
</header>
8592

8693
<article>

0 commit comments

Comments
 (0)