diff --git a/templateview/README.md b/templateview/README.md index 3a53447c2..6708fa227 100644 --- a/templateview/README.md +++ b/templateview/README.md @@ -21,18 +21,22 @@ Separate the structure and static parts of a webpage (or view) from its dynamic ## Detailed Explanation of Template View Pattern with Real-World Examples -### Real-World Example +Real-World Example > 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. -### In Plain Words +In Plain Words > 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. -### Wikipedia Says +Wikipedia Says > 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. +Flowchart + +![Template View Pattern Flowchart](./etc/template-view-flowchart.png) + ## Programmatic Example of Template View Pattern in Java 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 --git a/templateview/etc/template-view-flowchart.png b/templateview/etc/template-view-flowchart.png new file mode 100644 index 000000000..0887ac8bc Binary files /dev/null and b/templateview/etc/template-view-flowchart.png differ diff --git a/throttling/README.md b/throttling/README.md index d35c346de..ab5f92fbe 100644 --- a/throttling/README.md +++ b/throttling/README.md @@ -34,6 +34,10 @@ In plain words > 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. +Flowchart + +![Throttling Pattern Flowchart](./etc/throttling-flowchart.png) + ## Programmatic Example of Throttling Pattern in Java 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 --git a/throttling/etc/throttling-flowchart.png b/throttling/etc/throttling-flowchart.png new file mode 100644 index 000000000..0c7d6cc32 Binary files /dev/null and b/throttling/etc/throttling-flowchart.png differ