Skip to content

Commit 95bfd6c

Browse files
committed
docs: new diagrams for template view and throttling
1 parent ba7be25 commit 95bfd6c

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Diff for: templateview/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@ Separate the structure and static parts of a webpage (or view) from its dynamic
2121

2222
## Detailed Explanation of Template View Pattern with Real-World Examples
2323

24-
### Real-World Example
24+
Real-World Example
2525

2626
> Think of a blog website where each post page follows the same layout with a header, footer, and main content area. While the header and footer remain consistent, the main content differs for each blog post. The Template View pattern encapsulates the shared layout (header and footer) in a base class while delegating the rendering of the main content to subclasses.
2727
28-
### In Plain Words
28+
In Plain Words
2929

3030
> The Template View pattern provides a way to define a consistent layout in a base class while letting subclasses implement the specific, dynamic content for different views.
3131
32-
### Wikipedia Says
32+
Wikipedia Says
3333

3434
> While not a classic Gang of Four pattern, Template View aligns closely with the Template Method pattern, applied specifically to rendering webpages or views. It defines a skeleton for rendering, delegating dynamic parts to subclasses while keeping the structure consistent.
3535
36+
Flowchart
37+
38+
![Template View Pattern Flowchart](./etc/template-view-flowchart.png)
39+
3640
## Programmatic Example of Template View Pattern in Java
3741

3842
Our example involves rendering different types of views (`HomePageView` and `ContactPageView`) with a common structure consisting of a header, dynamic content, and a footer.

Diff for: templateview/etc/template-view-flowchart.png

62.4 KB
Loading

Diff for: throttling/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ In plain words
3434

3535
> Control the consumption of resources used by an instance of an application, an individual tenant, or an entire service. This can allow the system to continue to function and meet service level agreements, even when an increase in demand places an extreme load on resources.
3636
37+
Flowchart
38+
39+
![Throttling Pattern Flowchart](./etc/throttling-flowchart.png)
40+
3741
## Programmatic Example of Throttling Pattern in Java
3842

3943
In this Java example, we demonstrate throttling. A young human and an old dwarf walk into a bar. They start ordering beers from the bartender. The bartender immediately sees that the young human shouldn't consume too many drinks too fast and refuses to serve if enough time has not passed. For the old dwarf, the serving rate can be higher.

Diff for: throttling/etc/throttling-flowchart.png

42.3 KB
Loading

0 commit comments

Comments
 (0)