<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Design Pattern on Rizky Note's</title><link>https://rizkynotes.com/en/tags/design-pattern/</link><description>Recent content in Design Pattern on Rizky Note's</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Fri, 31 Jul 2026 09:00:00 +0700</lastBuildDate><atom:link href="https://rizkynotes.com/en/tags/design-pattern/index.xml" rel="self" type="application/rss+xml"/><item><title>Registry Pattern: A Clean Way to Manage Multiple Providers</title><link>https://rizkynotes.com/en/posts/registry-pattern-clean-way-to-manage-multiple-providers/</link><pubDate>Fri, 31 Jul 2026 09:00:00 +0700</pubDate><guid>https://rizkynotes.com/en/posts/registry-pattern-clean-way-to-manage-multiple-providers/</guid><description>&lt;h5 id="photo-by-daria-glakteeva-on-unsplash">Photo by &lt;a href="https://unsplash.com/@olenichek?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Daria Glakteeva&lt;/a> on &lt;a href="https://unsplash.com/photos/a-close-up-of-a-puzzle-board-with-many-pieces-missing-sKnQ7he3flU?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash&lt;/a>&lt;/h5>
&lt;p>A while back I worked on a project that integrated AI with two providers at once: OpenCode and Anthropic.
Before I start writing code, I like to sit with the problem for a bit and think through what&amp;rsquo;s likely to come up down the road. I also just like clean, readable code.
The question arises:&lt;/p>
&lt;blockquote>
&lt;p>How do I implement these two providers in a way that won&amp;rsquo;t turn into an ever-growing pile of &lt;code>switch&lt;/code>/&lt;code>if-else&lt;/code> statements the moment a new one shows up?&lt;/p></description></item></channel></rss>