avatarItchimonji

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3833

Abstract

’t wrong.</p><p id="5b28">It was an embarrassment. The worst part of it all was that I suspected something like this might happen. I was trying desperately to hold my temper. My future husband finally lost it after attempting to be patient the entire time. He took his sister outside and proceeded to yell at her.</p><p id="2409">The party was over. No one was in any mood to continue — especially me.</p><p id="db31">I just stood there, incredulous. My future mother-in-law was crying. She had put so much work into cooking and decorating. I didn’t want to add to her despair by breaking down myself. My guests hugged me and tried to console me the best they could, while also trying to recover from the shock of what had just happened.</p><blockquote id="fd34"><p>Looking back, almost thirteen years later — I <b>should</b> have broken down. I <b>should</b> have walked that spoiled brat right out of my baby shower. It <b>was</b> bullshit.</p></blockquote><p id="fc95">I didn’t realize it at the time, but that baby shower could have been a meaningful experience for me. Now that I’ve attended numerous baby showers since my daughter was born, I see that they are events meant to make the new mom-to-be feel special and doted on — to <i>shower</i> her with gifts and encouragement.</p><p id="e197">Instead, I let a raging bully upstage my special day.</p><p id="91b8">These days, my now sister-in-law doesn’t speak to my husband and me, and vice versa. The baby shower episode was just one of many unpleasant interactions we had to experience with her over the years and, eventually, we became estranged.</p><p id="ba0a">One of these days I’d like to tell my sister-in-law how much I’ve thought about that day of the baby shower in recent years, and how much I regret not speaking up about her behavior at the time.</p><p id="8aa9">I didn’t think a baby shower would mean so much to me until I looked back. If I could go back in time, I would have planned another baby shower just the way I wanted it.</p><p id="6bb6">I didn’t speak up that day and I should have.</p><p id="bf49">Live and learn.</p><p id="4717"><b><i>Do you think baby showers are meaningful? Share your thoughts in the comments…</i></b></p><h2 id="15ff">You can show your love for my writing by leaving me a tip of your choosing at my PayPal, or by contributing monthly on my Ko-fi page! Thank you!</h2><h2 id="b39e">Want more reads from me? Keep scrolling…</h2><div id="9442" class="link-block"> <a href="https://readmedium.com/things-i-did-in-the-90s-that-seem-utterly-insane-now-205740c11cd1"> <div> <div> <h2>Things I Did in The ’90s That Seem Utterly Insane Now</h2> <div><h3>There were no cell phones. There was no internet.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*VAJb6r3JsOJyMOhNnZWP9g.jpeg)"></div> </div> </div> </a> </div><div id="4db7" class="link-block"> <a href="https://readmedium.com/i-met-my-ex-husband-for-breakfast-and-learned-this-valuable-lesson-b4339dcc8ff6"> <div> <div> <h2>I Met My Ex-Husband For Breakfast — And Learned This Valuable lesson</h2> <div><h3>Time tells.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*YMHlinVefcmPudhuV7I-0g.jpeg)"></div> </div> </div> </a> </div><div id="6a56" class="link-block"> <a href="https://readmedium.com/you-dont-get-ownership-of-grief-when-someone-you-love-die

Options

s-e1c1c7243509"> <div> <div> <h2>You Don’t Get Ownership of Grief When Someone You Love Dies</h2> <div><h3>This is an uncomfortable yet necessary sentiment.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*94PeIZUykZum1a0p)"></div> </div> </div> </a> </div><div id="53b3" class="link-block"> <a href="https://readmedium.com/how-a-squeaky-bed-almost-ruined-my-marriage-e1dbcb6911d7"> <div> <div> <h2>A Squeaky Bed Almost Ruined My Marriage</h2> <div><h3>“I can fix it.”</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*dis53EGQxwB9scog)"></div> </div> </div> </a> </div><div id="ef8a" class="link-block"> <a href="https://readmedium.com/i-almost-let-poor-body-image-ruin-my-hawaiian-vacation-53ffa5384714"> <div> <div> <h2>I Almost Let Poor Body Image Ruin My Hawaiian Vacation</h2> <div><h3>The only potential saboteur on this vacation was me.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*VijipoFA9g1aeIZG)"></div> </div> </div> </a> </div><div id="421c" class="link-block"> <a href="https://readmedium.com/i-was-fired-for-not-making-a-tired-mom-spend-more-money-ef7636c0253d"> <div> <div> <h2>I Was Fired For Refusing To Make A Tired Mom Spend More Money</h2> <div><h3>Apparently, I was not a good fit.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*GlktLnG5ZIsdbWUA37zuCQ.jpeg)"></div> </div> </div> </a> </div><div id="cd9d" class="link-block"> <a href="https://readmedium.com/the-day-i-confessed-to-my-lovers-wife-7835317bef3"> <div> <div> <h2>The Day I Confessed To My Lover’s Wife</h2> <div><h3>My life changed for the better after that night.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*d36jSa44WgU81InHxqqMyA.jpeg)"></div> </div> </div> </a> </div><h2 id="489e">Still here? I have a podcast about being a stepmom. Check it out if you’re interested…</h2><div id="3de8" class="link-block"> <a href="https://podcasts.apple.com/us/podcast/the-fixer/id1485161397?i=1000647569343&amp;source=post_page-----e1c1c7243509--------------------------------"> <div> <div> <h2>‎The Pondering Stepmom Podcast: "The Fixer" on Apple Podcasts</h2> <div><h3>This week, I talk about stepmoms who feel like they are handling most of the problem-solving with their stepkids…</h3></div> <div><p>podcasts.apple.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*6VXVYhFb9ymbiL_B)"></div> </div> </div> </a> </div></article></body>

Command | Cheat Sheet

Behavioral Pattern — Design Patterns Series

Command is a behavioral design pattern which turns a request into a stand-alone object that contains all information about the request. This transformation lets you pass requests as method arguments, delay or queue a request’s execution, and support undoable operations. [https://refactoring.guru/design-patterns/command]

Real-life examples

  • Order in a restaurant: Waiter takes the order, which is the customer’s command — Waiter tells the cook, who then has all the information to cook the dish
  • In the ice cream parlour, the cook would be the ice cream maker — but taking the order remains the same
  • Postal office
  • Application controller: Handling of UI events like button clicks

Meaning

  • Encapsulation of a request as an object, thus enabling parameterisation of clients with different requests, queuing, or logging operations (+ undo)

Applicability (suitable if …)

  • Objects need to be parameterised with an executing operation (e.g. by callback in procedural languages)
  • A request is specified and then queued and executed at different times
  • UNDO (undoing of operations) needs to be supported (command history)
  • Logging of changes made needs to be supported (e.g. recovery after system crash)
  • A system with complex operations needs to be structured, based on primitive operations (e.g. transactions)

Assets and Drawbacks

  • Decoupling of an object that triggers the operation from another object that is able to perform it
  • Command objects are first-order objects that can be manipulated and extended like other objects
  • Several commands can be combined into a single command object

Example

As an example, the behavior of a text editor can be implemented. This opens, edits, saves, and closes different files.

The Receiver can perform the operations associated with the machining. Any class can serve as a Receiver. The Receiver of the example implements the actions of a text-editor:

Receiver

The Command declares an interface for the execution of an operation:

Command

The concrete classes of the Command define a binding between a Receiver and the operation. They also implement the execute() command:

Concrete Command

Finally, the Invoker needs to be implemented, which instructs the Command object to execute the request:

Invoker

The Client creates a concrete Command object and assigns its Receiver:

Client

Conclusion

Design Patterns are an important resource and base knowledge for every developer — they are very helpful for solving programmatic problems, help with consistent communication with other developers about system design, and serve as a significant introduction into object composition (besides inheritance) and dependency inversion.

Behavioral Patterns deal with algorithms and assignment of responsibilities to objects. Furthermore, they describe mutual communication patterns and grasp complex program sequences. They are therefore very well suited for use in areas where complicated code needs to be made readable and maintainable. Extensions are, in consequence, very good and quickly implementable.

Follow me on Medium, or Twitter, or subscribe here on Medium to read more about DevOps, Agile & Development Principles, Angular and other useful stuff. Happy Coding! :)

Code example on Github

Learn More

Resources

Design Patterns
Command
Behavioral Patterns
Cheatsheet
Summary
Recommended from ReadMedium