You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>With many observers, there could be performance implications of notifying all of them if the operation is costly or takes a long time. Also, the pattern relies on the reliability and format of the notification from the subject, so any updates to the publisher requires updates to the observers.</p>
<p>Below is a sample conversation that demonstrates how the bot interacts.</p>
146
+
147
+
<details>
148
+
<summary>Expand conversation</summary>
149
+
<div>
150
+
<p>Hi!</p>
151
+
<blockquote>
152
+
<p>🐦 Hey there! I’m Pattern Pigeon. I’ll help you learn about common software design patterns like Strategy, Composite, and Observer—step by step. I might also chirp in with some pigeon trivia. What would you like to start with?</p>
153
+
</blockquote>
154
+
155
+
<p>Can I learn about the Observer pattern?</p>
156
+
157
+
<blockquote>
158
+
<p>Coo coo! Observer it is! What would you like to learn about?</p>
159
+
</blockquote>
160
+
161
+
<p>What do you know?</p>
162
+
163
+
<blockquote>
164
+
<p>About the observer pattern, why not ask for some good examples? I can answer the difference between the Publisher/Subject and the Observer, why use the Observer pattern, and any disadvantages!</p>
165
+
</blockquote>
166
+
167
+
<p>First, what is the observer pattern?</p>
168
+
169
+
<blockquote>
170
+
<p>Alright, here’s the deal, coo-coo! The Observer Pattern is a behavioral design pattern that establishes a structured subscription mechanism, wherein a ‘Publisher’ (or ‘Subject’) is capable of notifying multiple ‘Observers’ about specific events or changes in state as they occur. Just like that, when the crumbs hit the ground, everybirdy’s in the loop, ya feel me?</p>
171
+
</blockquote>
172
+
173
+
<p>Okay, let’s do something else</p>
174
+
175
+
<blockquote>
176
+
<p>Enough Observer for now, back to the coop! What to dive into next, Composite, Observer, or Strategy?</p>
177
+
</blockquote>
178
+
179
+
<p>Before we continue on the next topic, could you tell me a fun fact about pigeons?</p>
180
+
181
+
<blockquote>
182
+
<p>Oooh, ooh, ooh! Here’s a good one. Did you know that pigeons were “probably one of the first animals to be domesticated by humans?” According to Atlas Obscura, images and carvings of the pigeons first appear in the Middle East and North Africa around 3,000 years ago (https://www.atlasobscura.com/articles/ancient-egypt-pigeon-problem). Want to hear another?</p>
183
+
</blockquote>
184
+
185
+
<p>Nah.</p>
186
+
187
+
<blockquote>
188
+
<p>Enough facts for one day, I get it. Let’s fly back to the coop! What to dive into next, Composite, Observer, or Strategy?</p>
Copy file name to clipboardExpand all lines: content/projects/pattern-pigeon/index.md
+42-6Lines changed: 42 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,44 @@ There are many advantages. The subject and the observer do not require tight cou
67
67
68
68
With many observers, there could be performance implications of notifying all of them if the operation is costly or takes a long time. Also, the pattern relies on the reliability and format of the notification from the subject, so any updates to the publisher requires updates to the observers.
69
69
70
+
## Sample Conversation
71
+
Below is a sample conversation that demonstrates how the bot interacts.
72
+
73
+
<details>
74
+
<summary>Expand conversation</summary>
75
+
<divmarkdown="1">
76
+
Hi!
77
+
> 🐦 Hey there! I’m Pattern Pigeon. I’ll help you learn about common software design patterns like Strategy, Composite, and Observer—step by step. I might also chirp in with some pigeon trivia. What would you like to start with?
78
+
79
+
Can I learn about the Observer pattern?
80
+
81
+
> Coo coo! Observer it is! What would you like to learn about?
82
+
83
+
What do you know?
84
+
85
+
> About the observer pattern, why not ask for some good examples? I can answer the difference between the Publisher/Subject and the Observer, why use the Observer pattern, and any disadvantages!
86
+
87
+
First, what is the observer pattern?
88
+
89
+
> Alright, here’s the deal, coo-coo! The Observer Pattern is a behavioral design pattern that establishes a structured subscription mechanism, wherein a ‘Publisher’ (or ‘Subject’) is capable of notifying multiple ‘Observers’ about specific events or changes in state as they occur. Just like that, when the crumbs hit the ground, everybirdy’s in the loop, ya feel me?
90
+
91
+
Okay, let's do something else
92
+
93
+
> Enough Observer for now, back to the coop! What to dive into next, Composite, Observer, or Strategy?
94
+
95
+
Before we continue on the next topic, could you tell me a fun fact about pigeons?
96
+
97
+
> Oooh, ooh, ooh! Here's a good one. Did you know that pigeons were "probably one of the first animals to be domesticated by humans?" According to Atlas Obscura, images and carvings of the pigeons first appear in the Middle East and North Africa around 3,000 years ago (https://www.atlasobscura.com/articles/ancient-egypt-pigeon-problem). Want to hear another?
98
+
99
+
Nah.
100
+
101
+
> Enough facts for one day, I get it. Let's fly back to the coop! What to dive into next, Composite, Observer, or Strategy?
102
+
103
+
[End]
104
+
</div>
105
+
</details>
106
+
107
+
70
108
## For developers
71
109
72
110
### Source code
@@ -110,9 +148,9 @@ This project is licensed under the [Apache License, Version 2.0](https://www.apa
110
148
agent-id="fa2eb7a0-2d7f-49aa-8232-6944236d702d"
111
149
language-code="en"
112
150
max-query-length="-1">
113
-
<df-messenger-chat
151
+
<df-messenger-chat-bubble
114
152
chat-title="Pattern Pigeon">
115
-
</df-messenger-chat>
153
+
</df-messenger-chat-bubble>
116
154
</df-messenger>
117
155
<style>
118
156
df-messenger {
@@ -123,10 +161,8 @@ This project is licensed under the [Apache License, Version 2.0](https://www.apa
0 commit comments