Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Adapter Pattern: Fitting a Third-Party SDK to Your Own Interface
Adapter fits a class you can't change to the interface the client expects; in C# that is almost always an object adapter, built with composition. Connecting two imaginary payment SDKs to a single IPaymentGateway, turning a callback into a Task with TaskCompletionSource, mapping error codes to domain exceptions and verifying both adapters with the same contract test.
Boundaries: Wrapping Third-Party Code and Learning Tests
Put code you don't control, such as a payment SDK, an email library and a cache, behind an interface shaped by your own need and a single adapter; don't let its types and exceptions leak in. Pin the library's behavior down with learning tests: MimeKit's TryParse even accepts "ada", and on the upgrade from 4.17.0 to 4.18.2 all 13 tests passed unchanged while a transitive security warning disappeared.