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.
โข We will create a folder called "๐๐ฑ๐ญ๐๐ง๐ฌ๐ข๐จ๐ง๐ฌ" in our web project.
โข Let's say we're moving the Hangfire settings first, we need to create the ๐๐๐๐๐๐ง๐ ๐๐ข๐ซ๐.๐๐ฌ ๐๐ฅ๐๐ฌ๐ฌ
โข Inside the class, we will add only one ๐๐จ๐ง๐๐ข๐ ๐ฎ๐ซ๐๐๐๐ง๐ ๐๐ข๐ซ๐ method that will be called at the point of configuring Hangfire.
The method is static, without a return value.
As a parameter, it has "๐ญ๐ก๐ข๐ฌ", which is the data type of the object that is using the given extension, in this case, ๐๐๐๐ซ๐ฏ๐ข๐๐๐๐จ๐ฅ๐ฅ๐๐๐ญ๐ข๐จ๐ง.
Within the method, we will configure settings over the services collection, as we would in the Program class.
As a result, we get a method that we can use in the Program class:
When we repeat this for each configuration, we get separate configurations, modules responsible for only one thing, and significantly more readable code.
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.
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.