Stefan ฤokiฤ‡ Profile picture
May 12 โ€ข 5 tweets โ€ข 2 min read Twitter logo Read on Twitter
Adapter Design Pattern - Simplifed๐Ÿ’ก

Definition:

The adapter pattern converts the interface of a class into another interface clients expect. The adapter lets classes work together that couldnโ€™t otherwise because of incompatible interfaces.

#Dotnet Image
Real-Wolrd Analogy:

โ€ขย Stefan from Serbia arrived in the UK.
โ€ขย Stefan has a classic EU charger with a two-part outlet.
โ€ขย The UK has a standard three-part plug.

How will Stefan charge his phone? Image
Answer: By using an adapter.

The adapter creates the possibility of connecting two different interfacesย 
(2 plugs).ย 
It gets one type of input and produces a different type of output. Image
When to use:

โ€ขย Ado .Netย SqlAdapter, MySqlAdapter
โ€ข Allow a system to use classes of another system that is incompatible with it. Image
If you like this content, you'll love my newsletter.

Subscribe: stefandjokic.tech

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Stefan ฤokiฤ‡

Stefan ฤokiฤ‡ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @TheCodeMan__

May 11
How to increase productivity?

5 Visual Studio Refactoring Tips ๐Ÿ’ก

If we use ๐•๐ข๐ฌ๐ฎ๐š๐ฅ ๐’๐ญ๐ฎ๐๐ข๐จ as an ๐ˆ๐ƒ๐„, it can help us a lot to quickly and successfully refactor the code.

Visual Studio makes things easy for us and has support for a lot of code changes.

#Dotnet Image
โ€ข ๐‘๐ž๐ง๐š๐ฆ๐ข๐ง๐  ๐ข๐๐ž๐ง๐ญ๐ข๐Ÿ๐ข๐ž๐ซ

Use ๐‚๐ญ๐ซ๐ฅ+๐‘, ๐‘ - when you change the name of a variable in one place, all references are automatically changed.
โ€ข ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐Œ๐ž๐ญ๐ก๐จ๐

The hotkeyย ๐‚๐ญ๐ซ๐ฅ+. triggers theย ๐๐ฎ๐ข๐œ๐ค ๐€๐œ๐ญ๐ข๐จ๐ง๐ฌ ๐š๐ง๐ ๐‘๐ž๐Ÿ๐š๐œ๐ญ๐จ๐ซ๐ข๐ง๐ ๐ฌ menu. From this menu, we can chooseย ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐Œ๐ž๐ญ๐ก๐จ๐ orย ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐‹๐จ๐œ๐š๐ฅ ๐…๐ฎ๐ง๐œ๐ญ๐ข๐จ๐งย ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐‹๐จ๐œ๐š๐ฅ ๐…๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง.
Read 6 tweets
May 10
I almost started working on a new project. ๐Ÿš€

These are the 4 steps I follow before coding: ๐Ÿงต

#Dotnet
1. Requirements Gathering

I try to have a deep understanding of project goals, functionality, and user expectations. Therefore, I believe that clear communication at this stage lays the foundation for a successful outcome.
2. Software Architecture

I carefully create the pieces of the software architecture. I analyze all client requirements and consider factors such as scalability, performance, security, and maintainability. I do this together with the client.
Read 6 tweets
May 10
C# | .Net Tip ๐Ÿ’ก

๐‡๐จ๐ฐ ๐ญ๐จ ๐ข๐ง๐œ๐ซ๐ž๐š๐ฌ๐ž ๐ญ๐ก๐ž ๐ซ๐ž๐š๐๐š๐›๐ข๐ฅ๐ข๐ญ๐ฒ ๐จ๐Ÿ ๐ฒ๐จ๐ฎ๐ซ ๐œ๐จ๐ง๐Ÿ๐ข๐ ๐ฎ๐ซ๐š๐ญ๐ข๐จ๐ง ๐œ๐จ๐๐ž?

I'm sure everyone reading this post has heard of ๐ž๐ฑ๐ญ๐ž๐ง๐ฌ๐ข๐จ๐ง ๐ฆ๐ž๐ญ๐ก๐จ๐๐ฌ. ๐Ÿงต

Good practice at the end of the post. ๐Ÿ‘Œ

#Dotnet Image
When creating an application, the first thing we do is configure it.

We configure: logging, connect the database with ORM, and configure CORS.
We define the method of authentication, DI services, and various bindings.
When we write all this code in theย ๐‚๐จ๐ง๐Ÿ๐ข๐ ๐ฎ๐ซ๐ž๐’๐ž๐ซ๐ฏ๐ข๐œ๐ž๐ฌ ๐ฆ๐ž๐ญ๐ก๐จ๐ ๐ข๐ง ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ.๐œ๐ฌ, everything gets messy. These methods can reach over 500 lines of configuration code.
Changing something is very difficult to navigate. Image
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(