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.
โขย 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?
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.
When to use:
โขย Ado .Netย SqlAdapter, MySqlAdapter
โข Allow a system to use classes of another system that is incompatible with it.
If you like this content, you'll love my newsletter.
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.
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.