<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Caio Cesar</title>
    <description>The latest articles on DEV Community by Caio Cesar (@caiocesar).</description>
    <link>https://dev.to/caiocesar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F251073%2F914a810b-e23f-47e0-80eb-028f6697bd10.jpeg</url>
      <title>DEV Community: Caio Cesar</title>
      <link>https://dev.to/caiocesar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/caiocesar"/>
    <language>en</language>
    <item>
      <title>Software Testing for Developers</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Thu, 23 Jan 2025 23:24:03 +0000</pubDate>
      <link>https://dev.to/caiocesar/software-testing-for-developers-4fkm</link>
      <guid>https://dev.to/caiocesar/software-testing-for-developers-4fkm</guid>
      <description>&lt;h2&gt;
  
  
  Why do we Test
&lt;/h2&gt;

&lt;p&gt;How secure would you feel using a system that has not been tested?&lt;br&gt;
Let’s say that you intend to buy a car, but no testing was done the engineers worked on the car solely based on their experience.&lt;br&gt;
How would you feel about using the car?&lt;br&gt;
That’s why we test software to give a better sense of quality to the end-user of the software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh6t43kinmet5the0x422.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh6t43kinmet5the0x422.png" alt="Car crash testing" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Reasons for testing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Compromise&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Depending on the bug of the software, an error can compromise a person, a group, or a whole operation.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Quality Assurance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensures that software meets standards for quality expected by the end-user. It validates software behaves as planned.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Having a secure software is essential to protect against malicious attacks and prevent data breaches. &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Cost&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saves your organization time and money, testing is one of the most cost-effective ways to ensure the quality and reliability of your software.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Other&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There are many other reasons to consider software testing, such as documentation, productivity, compliance, user experience, etc.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Types of Tests
&lt;/h2&gt;

&lt;p&gt;There are many types of tests out there such as load testing, mutation testing, acceptance testing, smoke testing, etc. To focus on what is essential in this article we will focus on 3 main types of tests that developers could consider:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Unit Tests&lt;/li&gt;
&lt;li&gt;Integration Tests&lt;/li&gt;
&lt;li&gt;End-to-End Tests &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Unit Tests
&lt;/h3&gt;

&lt;p&gt;Unit Tests focuses on the units or components of a software. A Unit is typically a method within a class or program. It validates a small part of  code, should be small fast to run and typically automated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfqnlfr7tvijjlz9r1fx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsfqnlfr7tvijjlz9r1fx.png" alt="Unit Tests" width="670" height="910"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Integration Tests
&lt;/h3&gt;

&lt;p&gt;Unit tests are great as they test a unit of the application, however you cannot be sure your system works if you rely on unit tests. Integration testing helps validate how  components work in integration with external systems. The purpose is to detect faults in the interaction between integrated units.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For80c0eb42et5iz45lgz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2For80c0eb42et5iz45lgz.png" alt="Integration Testing" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing Balance
&lt;/h3&gt;

&lt;p&gt;It’s important to maintain a balance between unit and integration tests. The number of tests between integration and unit can drastically differ from application to application depending on the needs. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwam40ar2k2kvrdhkfja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frwam40ar2k2kvrdhkfja.png" alt="Testing Balance" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  End-to-end tests
&lt;/h3&gt;

&lt;p&gt;In end-to-end testing, the whole application is tested in a real-world scenario such with interaction with the database, front-end, network, hardware, and other applications. This can involve several components of the system working together, such as the database, user interface, network, and APIs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjlzc75iri7umom1cdxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjlzc75iri7umom1cdxx.png" alt="End-to-End Tests" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The testing Pyramid
&lt;/h2&gt;

&lt;p&gt;When working with testing it is important to first have a clear understanding if the different test levels their cons and pros. Therefore, you can invest on whatever makes more sense to the objective of the organization or project in-hands.&lt;/p&gt;

&lt;p&gt;The following pyramid contains three levels of testing, if you research testing pyramid you should find a couple of variations of this pyramid.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;First&lt;/strong&gt;, we have unit tests at the bottom where all major business rules should be tested.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Second&lt;/strong&gt;, we have integration testing where you tend to have more complexity due to the integrations with external services and they tend to be written for less scenarios than unit tests.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Finally&lt;/strong&gt;, we have end-to-end that covers functionality of the entire software application and tend to more complex to write and maintain due to possible constant change in the application.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As seen in the figure, the bottom of the pyramid is less realistic and tend to be easier to maintain and as we go up the pyramid complexity/maintainability should rise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foasbdg5muytv7mt24796.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foasbdg5muytv7mt24796.png" alt="Testing Pyramid" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>testing</category>
    </item>
    <item>
      <title>Fundamentals of Clean Architecture</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Fri, 08 Mar 2024 00:18:01 +0000</pubDate>
      <link>https://dev.to/caiocesar/fundamentals-of-clean-architecture-14ng</link>
      <guid>https://dev.to/caiocesar/fundamentals-of-clean-architecture-14ng</guid>
      <description>&lt;h1&gt;
  
  
  Design and Objectives
&lt;/h1&gt;

&lt;p&gt;Software Architecture involves design. Design involves understanding the concept of or proposal of a system. The objective of software architecture is to minimize the efforts to create and maintain systems.&lt;/p&gt;

&lt;h1&gt;
  
  
  Structure of Systems
&lt;/h1&gt;

&lt;p&gt;Systems are everywhere, they are within our bodies, in electronic devices, and we are constantly interacting with various systems that we might not realize. See the figure below that contains the car brake system. This system contains layers or separate parts that interact with each other to reach the end goal of controlling the speed of the car.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbdqpeg6t3eumeon39lrp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbdqpeg6t3eumeon39lrp.png" alt="Car Brake System" width="800" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The design or architecture of systems tends to display the objectives of what it intends to provide.&lt;/p&gt;

&lt;h1&gt;
  
  
  Details
&lt;/h1&gt;

&lt;p&gt;Many newcomers to the IT world learn by practice, this means that they learn by problem solving, like writing lines of code to solve a specific problem. Therefore, many times the software architecture is not taken into consideration. Many complex software exists today without proper design or architecture, the question is how long it will survive or evolve to fit market needs.&lt;/p&gt;

&lt;p&gt;When analyzing code, you might see something like HTML, CSS, and JavaScript. You might run into a mobile or desktop application, then you might work on the data access layers where you connect to the database and retrieve data. The User interface, data access frameworks are all details of the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzcnqixdp9tw6ostwvxwt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzcnqixdp9tw6ostwvxwt.png" alt="App Details" width="479" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Databases
&lt;/h3&gt;

&lt;p&gt;The modeling of the database schema has architectural implications, however the frameworks behind the data access for CRUD operations do not. Therefore, your code should not have dependencies on the frameworks behind the data access technology.&lt;/p&gt;

&lt;h3&gt;
  
  
  Web
&lt;/h3&gt;

&lt;p&gt;The web is a (GUI)graphical user interface. With time the frameworks of GUI can evolve and change. Within Microsoft Technologies there is a clear evolution of frameworks within Microsoft frameworks from classic ASP to Web Forms then ASP.NET MVC and Web API's. Therefore, since the web can evolve, when architecting applications there should be limits to the GUI and the business logic of the application also known as the core of the application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Frameworks
&lt;/h3&gt;

&lt;p&gt;Many frameworks today are open source and that's great, but it does not mean that frameworks will adapt to all your applications needs as time passes. Some frameworks will make your applications tightly coupled when it comes to setting them up with derived classes etc.&lt;/p&gt;

&lt;h4&gt;
  
  
  Risks of adopting frameworks
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;They might violate your architecture standards and dependency rules.&lt;/li&gt;
&lt;li&gt;They might not evolve to fit your needs with time.&lt;/li&gt;
&lt;li&gt;New and better frameworks might become available.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You should not ignore the use of framework, but you should avoid coupling a framework to your application. Frameworks should be part of the details of the application and discarded/replaced if necessary.&lt;/p&gt;

&lt;h1&gt;
  
  
  Business Rules
&lt;/h1&gt;

&lt;p&gt;The business rules of an application are what typically generate value to organizations. Business rules are tied to the business and systems facilitate the validation of these rules. Let's suppose that we have a banking organization that opens bank accounts to its customers and a requirement to open a bank account is a social security number. If those rules are used within a software or not it is still a valid rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Entities
&lt;/h2&gt;

&lt;p&gt;When working with software data is generically being transferred through objects and business rules are validated. These objects can be associated with entities. The entity object contains the core business rules data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6plhtdotznexsm79lbp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6plhtdotznexsm79lbp1.png" alt="Entities" width="479" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;Let's suppose that in the banking application, once an account is open you could choose to have a premium or black card. However, the rules for that are that your credit score needs to be higher than 750. In that case you have rules that verify the credit score based on input data, processed information, and output, this is a use case. Use cases differ from the core business data since the rules are specific to the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzydhralzpwo9bv1un9ed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzydhralzpwo9bv1un9ed.png" alt="Use Case" width="479" height="441"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Clean Architecture
&lt;/h1&gt;

&lt;p&gt;Based on the analysis of the previous sections we have a couple of takeaways.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Don't depend on frameworks - Software architecture should not be tightly coupled to frameworks. This allows for the use of frameworks as a replaceable tool.&lt;/li&gt;
&lt;li&gt;Testability - When the core and business logic of the application has few dependencies it isolates itself and facilitates the application of testing principles.&lt;/li&gt;
&lt;li&gt;User interface tends to evolve - The web has evolved and could be changed to desktop, mobile or other future interfaces. Not having your core or logic of the application tied to the user interface could be of great value.&lt;/li&gt;
&lt;li&gt;Independence of connected services - Services like databases, message bus, email provider can evolve and change. Keeping these layers away from the core functionality can be beneficial.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The figure below contains a version of clean architecture. Clean architecture may vary. Some versions may have more or fewer layers depending on the design and necessity. To make things simple I create a 3 layered architecture.&lt;/p&gt;

&lt;p&gt;The main rule for this architecture is the dependency rule. The core or center of the application cannot depend on external layers and so on. Core is independent, use case may depend on the core and the details may depend on any layer. This separation of concerns allows one to follow the takeaways described in the initial part of this section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzfuv5i5yfex7brds4jj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzfuv5i5yfex7brds4jj.png" alt="Clean Architecture" width="719" height="752"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Clean architecture is not the ideal architecture for all applications. It is important to understand the fundamentals and different patterns and variations that come with this architecture and analyze if it makes sense for the system that you are working on.&lt;/p&gt;

&lt;p&gt;Since this is only an introduction, simplicity is key. Following the rules for each of the layers will allow independence of frameworks and UI and facilitate unit testing the rules of the application. There is a lot more to clean architecture and if you want to dive a little deeper, I suggest reading the clean architecture book by uncle bob or for practical experience doing the &lt;a href="https://www.udemy.com/course/clean-architecture-fundamentals/?referralCode=CBA6DE37963F357954B8"&gt;course&lt;/a&gt; reference on this post. &lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Martin, Robert C. "Clean architecture".&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.udemy.com/course/clean-architecture-fundamentals/?referralCode=CBA6DE37963F357954B8"&gt;Clean Architecture Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>design</category>
      <category>cleanarchitecture</category>
      <category>architecture</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Why Architect Software?</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Thu, 03 Aug 2023 11:37:37 +0000</pubDate>
      <link>https://dev.to/caiocesar/why-architect-software-3el6</link>
      <guid>https://dev.to/caiocesar/why-architect-software-3el6</guid>
      <description>&lt;h1&gt;
  
  
  Software Architecture Definition
&lt;/h1&gt;

&lt;p&gt;Software architecture abstracts a system and the elements consisted in a software defines its structure. Defining the relationship of elements within a software is one of the goals of architecting software. The focal point of is to define how elements of the software interact with each other while avoiding too much implementation detail.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why should one Architect a Software?
&lt;/h1&gt;

&lt;p&gt;Software Architecture lays out the base of a system. This foundation can have a high impact on the software through time. This impact can impact the quality of the system and how developers interact with the software. This interaction could include time to deliver modules, testability, maintenance, reusability, etc. To successfully deliver a software that lives up to its purpose it is highly recommended to architect it well.&lt;/p&gt;

&lt;h1&gt;
  
  
  Who might benefit from Software Architecture?
&lt;/h1&gt;

&lt;p&gt;Software architecture is crucial for the software architect's first. It allows one to reason about the decisions that where made and why. Writing software should not be like autonomous, but careful planning and decision making should take place. Other teams involved including: developers, scrum masters, quality assurance, end-users, directors, managers, business analysists and the involved teams. The Software Architecture can have a direct influence on the decision and actions each of these members have to account for. Some of these like the developers should analyze and understand the architecture in depth.&lt;/p&gt;

&lt;h1&gt;
  
  
  What does a Software Architect Actually do?
&lt;/h1&gt;

&lt;p&gt;A Software Architect should be taking ownership of a software project and see the 'big picture' of how the software is built. They should have the ability to lead the team technically and help evolve the software as necessary.&lt;/p&gt;

&lt;p&gt;A Software Architect should be responsible for documenting the software, designing the software and the actual architecture of the software. &lt;/p&gt;

&lt;p&gt;In practice the Software Architect should &lt;code&gt;Care Deeply&lt;/code&gt; about the software in hand. Many times architects are required to communicate with stakeholders from other teams and defend the decisions that were taken from a software perspective. The effective communication can help architects evolve the architecture as requirements change.&lt;/p&gt;

&lt;p&gt;Architects should be curious and up to date with technologies. This is because he should have the ability to create solutions many times more than one to a given task and be able to reason about those decisions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;With some experience as a Software Architect I can state that this role can have major differences between organizations. This could occur due to the company's policies and how the current team is structured. Some organizations may have only one or no architects, others may have several architects with different roles and responsibilities.&lt;/p&gt;

&lt;p&gt;I highly recommend that developers work with software architects at some point in their careers to gather experience and learn. For some organizations team leaders and senior developers have put into this position, but the ideal scenario is that many organizations should have this as a role.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>role</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Git/Github Quick Start Reference Document</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Fri, 02 Jun 2023 12:35:53 +0000</pubDate>
      <link>https://dev.to/caiocesar/gitgithub-quick-start-reference-document-3e5d</link>
      <guid>https://dev.to/caiocesar/gitgithub-quick-start-reference-document-3e5d</guid>
      <description>&lt;h1&gt;
  
  
  Git and GitHub
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;- A cloud platform used for collaborating that makes use of &lt;code&gt;git&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Features of GitHub: &lt;code&gt;Issues&lt;/code&gt;, &lt;code&gt;Discussions&lt;/code&gt;, &lt;code&gt;Pull requests,&lt;/code&gt; &lt;code&gt;Notifications&lt;/code&gt;, &lt;code&gt;Labels&lt;/code&gt;, &lt;code&gt;Actions&lt;/code&gt;, &lt;code&gt;Forks&lt;/code&gt;, &lt;code&gt;Projects&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt;- Allows people to contribute to projects with the use of a distributed version control system (DVCS).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In its most basic form git is a content tracker&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Basic Git Commands
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/strong&gt; - Initialized an existing git repository or creates an empty git repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lV6x5B46--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhhiev9vkav72lu2rjp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lV6x5B46--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhhiev9vkav72lu2rjp4.png" alt="Git Init Screenshot" width="375" height="33"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git Status&lt;/code&gt;&lt;/strong&gt; - Displays the status of the working tree. It could inform changes to be committed, changes not staged for commit, untracked files or if the tree is clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mz-C4ZCV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7y7r0nl8gfdukvb0xn4y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mz-C4ZCV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7y7r0nl8gfdukvb0xn4y.png" alt="Git Status Screenshot" width="279" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git add&lt;/code&gt;&lt;/strong&gt; - Add file contents to the index/working tree.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ytHLJK3d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp1c8dc7wzzpicey422p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ytHLJK3d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wp1c8dc7wzzpicey422p.png" alt="Git Add" width="305" height="27"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nXEpRWbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44azffwv3d2u87zdep0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nXEpRWbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44azffwv3d2u87zdep0g.png" alt="Git Status Screenshot" width="333" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git commit&lt;/code&gt;&lt;/strong&gt; - Record changes to the repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dsslncg8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxbw6zn5kg5shkpqgeae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dsslncg8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxbw6zn5kg5shkpqgeae.png" alt="Git Commit" width="345" height="57"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git log&lt;/code&gt;&lt;/strong&gt; -  Displays commit logs history for the current repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fQgk5qI4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7np81p6sa4yyxel4wi1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fQgk5qI4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7np81p6sa4yyxel4wi1.png" alt="Git log Screenshot" width="464" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Branches
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Branch&lt;/strong&gt;- Git branches are a reference to a snapshot of your changes. By default git initializes with the branch name of &lt;code&gt;main&lt;/code&gt; or &lt;code&gt;master&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/strong&gt; command can also show the list of existing branches for a repository, create new branches or delete existing ones.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  List
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The current selected branch in the screenshot bellow is &lt;code&gt;master&lt;/code&gt; that's why it has an asterisk by its name and its color is green.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aZTRHemE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1gy7nsq6n43hmwvpdvc.png" alt="Git Branch List" width="119" height="34"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Creates a new branch based of the selected branch named &lt;code&gt;b1&lt;/code&gt;.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gnEnMfgn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cuedjp42evbz6v4dn5m3.png" alt="Git Branch Create" width="203" height="28"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  List
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lists two branches from the repo.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YNHhKksS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9tg2k4y01limaxycvnk.png" alt="Git Branch List" width="304" height="48"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  HEAD
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The HEAD of the current project is a reference to the selected branch that is &lt;code&gt;refs/heads/master&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git switch&lt;/code&gt;&lt;/strong&gt; - Allows one to switch the selected branch to an existing branch.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RSFqeBcw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sz8sdnaba4rmq162kmc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RSFqeBcw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sz8sdnaba4rmq162kmc6.png" alt="Git Swtich" width="198" height="27"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now the HEAD of the branch is &lt;code&gt;refs/heads/b1&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git checkout&lt;/code&gt;&lt;/strong&gt; - Also allows one to switch the selected branch to an existing branch o create new branches.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S0bq9V32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9v1pvceyz644tj7db01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S0bq9V32--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9v1pvceyz644tj7db01.png" alt="Git Checkout" width="204" height="28"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now the HEAD of the branch is back to &lt;code&gt;refs/heads/master&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Basic Git Knowledge
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Repository&lt;/strong&gt;- A project that may contain files and folders with versioning.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commit&lt;/strong&gt;- represents a change with an assigned a unique ID to 1 or many files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pull Request&lt;/strong&gt;- Responsible for alerting that a commit is ready for merging between branches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pull&lt;/strong&gt;- The &lt;code&gt;git pull&lt;/code&gt; command retrieves all base branch commits that hasn't been applied to the current branch.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cloning and forking
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Cloning a Repository&lt;/strong&gt;- Represents a copy of the repository and its history to a machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forking a Repository&lt;/strong&gt;- Represents a copy of a repository in a GitHub account.&lt;/p&gt;

&lt;h1&gt;
  
  
  Merging
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Merge&lt;/strong&gt;- Allows one to adds the changes in the pull request and branch into the &lt;code&gt;target&lt;/code&gt; branch.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Lets say you have two branches master and b1 with the same ReadMe.txt file and different content on them. Lets assume you want the content in the &lt;code&gt;b1&lt;/code&gt; branch to merge into the &lt;code&gt;master&lt;/code&gt; branch. To start the merge you can switch to the master then run the following command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;git merge b1&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y4F6X7cs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ui3sonsmc3oew6f9tou9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y4F6X7cs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ui3sonsmc3oew6f9tou9.png" alt="git Merge" width="464" height="58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;As you can see from the screenshot above since the content differs there is a merge conflict that needs to be resolved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now you can resolve the merge conflict in the ReadMe.txt file then add and commit the merged file into the &lt;code&gt;master&lt;/code&gt; branch.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f0cq0F1---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5vc2j2semjq7qnhm2wa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f0cq0F1---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5vc2j2semjq7qnhm2wa.png" alt="Git Merge" width="268" height="36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Merge Conflict&lt;/strong&gt;- Occurs when a merge is attempted and changes to the same line of code from parallels changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resolving Merge Conflicts&lt;/strong&gt;- Git can generate a temporary file that contains differences from each branch. One can manually select what should or shouldn't be merged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preventing Merge Conflicts&lt;/strong&gt;- pull updates frequently and  keep branches close to base.&lt;/p&gt;

&lt;h1&gt;
  
  
  Rebasing
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Lets say you have two branches master and b1 with the same ReadMe.txt file and different content on them as seen in the figure bellow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uEUaTNQH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gydcuntljimbjzvsfi95.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uEUaTNQH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gydcuntljimbjzvsfi95.png" alt="2 branches" width="504" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The rebase command such as &lt;code&gt;rebase master&lt;/code&gt; changes the base of the command to move b1 to the end of master as displayed in the image bellow:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZTrRX_Tt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrbfs9m0fyb4qjkbyw5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZTrRX_Tt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jrbfs9m0fyb4qjkbyw5w.png" alt="Rebase" width="775" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Why Not Microservices?</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Sun, 19 Mar 2023 20:20:36 +0000</pubDate>
      <link>https://dev.to/caiocesar/why-not-microservices-1ih9</link>
      <guid>https://dev.to/caiocesar/why-not-microservices-1ih9</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Many organizations and teams may see microservices as the best approach to a determined problem. This post covers 5 basic concepts to think about when implementing this type of architecture. The idea is to revise some concepts that will help you question the need for this approach.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Communication Services
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Microservices&lt;/strong&gt; are services that attend a certain domain and are released independently. These services could then be exposed to other services through API's, Service Brokers, or other communication services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0lwkadqoh65u7rv946p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0lwkadqoh65u7rv946p.png" alt="Two API's" width="800" height="157"&gt;&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Figure 1 - Microservices through API's&lt;/b&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Independent Deployability
&lt;/h2&gt;

&lt;p&gt;Many consider independent deployability the most important piece to microservices. Applying this concept is necessary to validate that applications are loosely coupled. To certify this, one should be able to make changes to a specific microservice without having to change other services. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iostkoq2zbu0jnqkc1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8iostkoq2zbu0jnqkc1a.png" alt="Releases" width="768" height="578"&gt;&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Figure 2 - Releases&lt;/b&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Databases Sharing
&lt;/h2&gt;

&lt;p&gt;It is highly recommended that each microservice contains its own database. When we think of a microservice as a unique piece of software it should have independence in all levels and that includes the database. When one or more microservice share the same database one can easily fall into the assumption of shared deployment or accessing the same data between these services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe7xmepha5s9u9fu9prcz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe7xmepha5s9u9fu9prcz.png" alt="Database" width="771" height="722"&gt;&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Figure 3 - Databases&lt;/b&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Business Domain
&lt;/h2&gt;

&lt;p&gt;With a microservice approach each microservice needs to be independent and organized. To effectively allow for independence, design techniques are commonly used like layered architecture, clean architecture, domain-driven design(DDD), etc. These approaches allows for teams to structure the code with independent contextualization efficiently.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qenbxu1rxef52hdhftj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qenbxu1rxef52hdhftj.png" alt="Business Domain" width="767" height="959"&gt;&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Figure 4 - Business Domain&lt;/b&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Client Communication
&lt;/h2&gt;

&lt;p&gt;With the growth of business and processes within an organization the tendency is that the number of services will also grow. However the consumers of these microservices needs to be able to effectively communicate or call the microservice for the desired job. There are a couple of strategies to solve this issue. Having an API gateway is a strategy to expose, version and evolve microservices effectively. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrt04uwynta7dz0qgli6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqrt04uwynta7dz0qgli6.png" alt="API Gateway" width="553" height="330"&gt;&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Figure 5 - API Gateway&lt;/b&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This post contains only the tip of the iceberg when it come to microservices. To develop this type of solution more situations needs to be considered like the teams experience, deployment automation, cloud computing, security, scalability, testing, resilience, observability, organization alignment, etc. &lt;/p&gt;

&lt;p&gt;The increase in complexity and team experience when creating microservices are many times why these projects tend to fail. It is common to have less experience or reduced teams working on software projects, with the mindset of a microservice architecture.&lt;/p&gt;

&lt;p&gt;Microservices are effective when used, planned, and executed in appropriate scenarios, but I always tend to ask myself why not microservices?&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Building Microservices: Designing Fine-Grained Systems&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>discuss</category>
      <category>ethereum</category>
      <category>crypto</category>
      <category>blockchain</category>
    </item>
    <item>
      <title>Clean Architecture Evolution</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Sat, 18 Jun 2022 15:51:01 +0000</pubDate>
      <link>https://dev.to/caiocesar/clean-architecture-evolution-182k</link>
      <guid>https://dev.to/caiocesar/clean-architecture-evolution-182k</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Architecture evolution is the mechanism of adjusting current software architecture to match new requirements. To help you understand how you might improve a solution that applies clean architecture, lets review some basic principles. &lt;/p&gt;

&lt;h2&gt;
  
  
  1.Dependency Inversion Principle
&lt;/h2&gt;

&lt;p&gt;Flexible systems should have source code dependencies on abstractions and not concretions, see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MCOV51fF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsm9abfppbbo1z15j9e7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MCOV51fF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dsm9abfppbbo1z15j9e7.png" alt="Dependency inversion principle" width="800" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2.Component Principles
&lt;/h2&gt;

&lt;p&gt;Components are the minimal units the can be deployed in a system. &lt;br&gt;
Independently deployable components are usually well designed and could be independently developed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ytx02naT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pw995l85fu042jh4zljt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ytx02naT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pw995l85fu042jh4zljt.png" alt="Image description" width="800" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3.Component Cohesion
&lt;/h2&gt;

&lt;p&gt;Defining the classes that goes into components is a crucial decision see: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rqbGV4Yg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fk3vo5gur1oszqlkozk0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rqbGV4Yg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fk3vo5gur1oszqlkozk0.png" alt="Image description" width="776" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To tackle this issue we will consider three principles of components cohesion:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Reuse/Release Equivalence Principle - Those who want to reuse software components will choose not to, unless those components are tracked through a release process and are given release numbers. Developers should be aware of new releases, and what changes these new releases will bring.&lt;/li&gt;
&lt;li&gt;The Common Closure Principle - A component should not have multiple reasons to change.&lt;/li&gt;
&lt;li&gt;The Common Reuse Principle - Classes that are not tightly bound to each other should not be in the same component. &lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Clean Architecture
&lt;/h1&gt;

&lt;p&gt;Clean architecture keeps the business logic and application model at the center of the application. To achieve this the infrastructure concerns depend on the domain of the application, see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DOOrQ5VH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzv150idp1ypp5ja0ai4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DOOrQ5VH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uzv150idp1ypp5ja0ai4.png" alt="Image description" width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main advantages of implementing clean architecture is that it allows applications to be loosely coupled. That gives developers the power to update infrastructure like frameworks and databases. It also allows for highly testable application.&lt;/p&gt;

&lt;h1&gt;
  
  
  Applied Principles to Clean Architecture
&lt;/h1&gt;

&lt;p&gt;To implement and evolve a project that applies clean architecture, it is wise to understand the SOLID Principles, Component Principles  and other knowledge available in uncle bobs clean architecture book. Lets go over a two of these principles: &lt;/p&gt;

&lt;h3&gt;
  
  
  Dependency inversion principle
&lt;/h3&gt;

&lt;p&gt;when one applies the dependency inversion principle it enables infrastructure to be injected through at compile time and database can be included with more ease, see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--32r3Xgy8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jayysyu4piribfdcb225.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--32r3Xgy8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jayysyu4piribfdcb225.png" alt="Image description" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Reuse/Release Equivalence Principle
&lt;/h3&gt;

&lt;p&gt;Applying the Reuse/Release Equivalence Principle in your infrastructure layer may allow developers to evolve each component independently from each other, see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fFlmkFxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nt670nvnj967vwozx3re.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFlmkFxr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nt670nvnj967vwozx3re.png" alt="Image description" width="384" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Implementing an architecture project requires knowledge to understand a specific pattern and applied it. Developers might face gaps when deciding when and why it would be necessary to create new components.&lt;/p&gt;

&lt;p&gt;To successfully maintain and evolve the software projects, learning software design principles are a good starting point that developers should take into account.&lt;/p&gt;

&lt;p&gt;For a more complete explanation of this post, with more details and diagrams checkout this &lt;a href="https://www.youtube.com/watch?v=hdjoReV1wQA&amp;amp;t=6s"&gt;youtube presentation&lt;/a&gt;. &lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Martin, Robert C. Clean Architecture: A Craftsman's Guide to Software Structure and Design&lt;/li&gt;
&lt;li&gt;Steve Smith Architecting Modern Web Applications with ASP.NET Core and Microsoft Azure&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=hdjoReV1wQA&amp;amp;t=6s"&gt;Clean Architecture | Theory and Concepts&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>architecture</category>
      <category>design</category>
      <category>cleanarchitecture</category>
    </item>
    <item>
      <title>Rest API Design Guide</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Tue, 31 May 2022 22:31:19 +0000</pubDate>
      <link>https://dev.to/caiocesar/basic-rest-api-design-guide-5dmc</link>
      <guid>https://dev.to/caiocesar/basic-rest-api-design-guide-5dmc</guid>
      <description>&lt;h1&gt;
  
  
  Design Principles of Rest API's
&lt;/h1&gt;

&lt;p&gt;When designing for API's one must make sure the API can be independent of the client. Also API's might need to evolve without breaking existing implementations. To help navigate this, learning about standards can be beneficial when designing new API's.&lt;/p&gt;

&lt;p&gt;This guide contains some basic design guides that can be considered for Restful HTTP API design. The Representational State Transfer (REST) is a way design web services. It is independent of HTTP protocol but we will consider the HTTP protocol in this post.&lt;/p&gt;

&lt;h3&gt;
  
  
  URI Based
&lt;/h3&gt;

&lt;p&gt;An API resource is identified through an URI for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://domain.com/items/10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Response Types
&lt;/h3&gt;

&lt;p&gt;Consumers of API's frequently exchange information through represented data. One of the most common approaches for exchanging data is the use of JSON, such as the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Caio"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Operation Verbs
&lt;/h3&gt;

&lt;p&gt;REST API's makes use of a standard interface for client server communication the most common operations are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GET&lt;/strong&gt;- Should only &lt;em&gt;retrieve&lt;/em&gt; data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;POST&lt;/strong&gt;- Generally used to &lt;em&gt;create&lt;/em&gt; new resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PUT&lt;/strong&gt;- Generally used to fully &lt;em&gt;update&lt;/em&gt; a resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PATCH&lt;/strong&gt;- Applies &lt;em&gt;partial&lt;/em&gt; modifications to a resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DELETE&lt;/strong&gt;- &lt;em&gt;Deletes&lt;/em&gt; the specified resource.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  URI Naming Convention
&lt;/h3&gt;

&lt;p&gt;Resource URIs should be based on plural nouns (the resource) and not verbs (the operations on the resource).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Verbs&lt;/th&gt;
&lt;th&gt;Correct URI&lt;/th&gt;
&lt;th&gt;Incorrect URI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/items"&gt;https://domain.com/items&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/get-item"&gt;https://domain.com/get-item&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/items"&gt;https://domain.com/items&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/insert-item"&gt;https://domain.com/insert-item&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PUT&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/items"&gt;https://domain.com/items&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/update-item"&gt;https://domain.com/update-item&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/items"&gt;https://domain.com/items&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://domain.com/delete-tiem"&gt;https://domain.com/delete-tiem&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  HTTP Media Types Semantics
&lt;/h3&gt;

&lt;p&gt;For HTTP Requests formats are defined through the use of media types, also called MIME types. The most common media types are JSON(media type = application/json) and XML(media type = application/xml) formats. The following has an example of a POST request with the JSON media type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST https://domain.com/items HTTP/1.1
Content-Type: application/json; charset=utf-8
Content-Length: 80
{"name":"Caio", "id":2, "value":100}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the media type is not supported the server returns the status code 415 (Unsupported Media Type).&lt;/p&gt;

&lt;p&gt;A request can have the Accept header defined with the supported media types as displayed in the following sample:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://domain.com/items/1 HTTP/1.1
Accept: application/xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the request does match the accepted media types the server returns the status code 406 (Not Acceptable).&lt;/p&gt;

&lt;h3&gt;
  
  
  Typical Status Codes
&lt;/h3&gt;

&lt;p&gt;The following table displays the most typical list status codes of success and failures to the most common verbs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Verbs&lt;/th&gt;
&lt;th&gt;Success&lt;/th&gt;
&lt;th&gt;Partial Success&lt;/th&gt;
&lt;th&gt;Failure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;200(OK)&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;404 (Not Found)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;201 (Created)&lt;/td&gt;
&lt;td&gt;200(OK)&lt;/td&gt;
&lt;td&gt;204 (No Content)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PUT&lt;/td&gt;
&lt;td&gt;201 (Created)&lt;/td&gt;
&lt;td&gt;200(OK) OR 204(No Content)&lt;/td&gt;
&lt;td&gt;409 (Conflict)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PATCH&lt;/td&gt;
&lt;td&gt;201 (Created)&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;415 (Unsupported Media Type) OR 400 (Bad Request) OR 409 (Conflict)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;204(No Content)&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;404 (Not Found)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Data Filtering
&lt;/h3&gt;

&lt;p&gt;To minimize cost of requests it is a good practice to have filters in GET Operations to filter only necessary data. To effectively apply this a good strategy is to use query strings such as the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://domain.com/items?minValue=100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Data Pagination
&lt;/h3&gt;

&lt;p&gt;When working with large collection of data it can return a high amount of unnecessary information. Consider limiting the return for these requests. A solution to this is using query strings that limits the max number of items to get and a starting offset into the collection as displayed in the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://domain.com/items?limit=10&amp;amp;offset=50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To help consumers, GET requests that returns paginated information should include metadata that shows the total number of data available for the request. Also set all optional query string parameters  to default values:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://domain.com/items?limit=100&amp;amp;offset=0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Versioning
&lt;/h3&gt;

&lt;p&gt;Most API's will need to evolve with time. Static API's are not very common for many business and application needs. Versioning allows new features to be included to API's without breaking existing resources. There are several strategies regarding the versioning of API's.&lt;/p&gt;

&lt;h4&gt;
  
  
  URI versioning
&lt;/h4&gt;

&lt;p&gt;A new version is added to the URI such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://domain.com/v2/items/10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Query string versioning
&lt;/h4&gt;

&lt;p&gt;A parameter in a query string indicates the version of the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET https://domain.com/items/10?version=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Header versioning
&lt;/h4&gt;

&lt;p&gt;A custom header will contain the version of the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTTP
GET https://domain.com/items/10 HTTP/1.1
Custom-Header: api-version=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;There many other considerations to API design that are not covered here such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;HATEOAS&lt;/li&gt;
&lt;li&gt;Partial Responses&lt;/li&gt;
&lt;li&gt;Open API Initiative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Therefore seeking a deeper understanding to protocols and standards is a good practice to fully comprehend design principles. For every project there might be a different approach to designing an API based on resources available and necessity. It is highly recommended to have a least a basic design strategy when structuring new or existing API's.&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods"&gt;https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/services/api-management/#overview"&gt;https://azure.microsoft.com/en-us/services/api-management/#overview&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>api</category>
      <category>architecture</category>
      <category>cloud</category>
      <category>design</category>
    </item>
    <item>
      <title>Consider Actors for the Single Responsibility Principle (SRP)</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Sun, 22 May 2022 18:34:09 +0000</pubDate>
      <link>https://dev.to/caiocesar/consider-actors-for-the-single-responsibility-principle-srp-46mj</link>
      <guid>https://dev.to/caiocesar/consider-actors-for-the-single-responsibility-principle-srp-46mj</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The Single Responsibility Principle is the S in &lt;a href="http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod"&gt;SOLID&lt;/a&gt;, it is defined as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Single Responsibility Principle(SRP) - A class should have one, and only one, reason to change.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The SRP is at many times misinterpreted as a method should  do one thing and one thing only, this is a wrong definition of the SRP.&lt;br&gt;
When we think about methods or modules having single responsibility we can consider it is part of a &lt;a href="https://dev.to/caiocesar/clean-code-in-c-part-2-methods-58mb"&gt;clean code&lt;/a&gt; concept and not how the SRP should be addressed.&lt;/p&gt;

&lt;p&gt;Instead software developers needs to think about the users or group of users that will make use of a certain classes as seen in the following sections.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Definition
&lt;/h2&gt;

&lt;p&gt;When applying the SRP software developers need to take into consideration the actors that will make use of the developed module. Consider Figure 1 and its actors.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IMpK7yg_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbiiowrh185w71k5lg30.png" alt="Student class diagram" width="691" height="437"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 1 - Student class diagram and its actors&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There are three public methods contained in the student class:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The CalculateGradePointAverage is mostly used by the students.&lt;/li&gt;
&lt;li&gt;The GetAbsence is mostly used by the parent to check the status of the student absence.&lt;/li&gt;
&lt;li&gt; The GetRanking is typically used by the school to print the student ranking compared to his peers in his report card.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;At this point all of these methods are coupled into a single Student class that is used by different groups of users.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--scRtyQ5W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wz4a2cq759j553sa17u.png" alt="Shared private method" width="463" height="219"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 2 - Shared private method&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Figure 2 displays that the calculateGradeAverage private method is used by the  CalculateGradePointAverage and GetRanking. The developer considered creating this private method to prevent code duplication.&lt;/p&gt;

&lt;p&gt;Lets now consider business changes in the school policies that will affect the ranking system logic. In this case changes to the calculateGradeAverage method is necessary to comply with the rules, however the changes to the calculateGradeAverage method also introduced changes to the CalculateGradePointAverage that should not have changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Resolution
&lt;/h2&gt;

&lt;p&gt;This is where architectural decisions can come into place, since there may be different solutions to the same problem. Creating a separate class for each user is one solution as displayed in Figure 3. Also a common model between these classes could reduce code duplication.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d0OU7Xvp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hx40do3x30eu8iczzc8a.png" alt="classes isolated" width="800" height="265"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 3 - Different classes isolated from each other&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Going Deeper
&lt;/h2&gt;

&lt;p&gt;At this point we now have three classes that should be instantiated, if these classes are used in the same scope a facade could be introduced as displayed in Figure 4.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFI3kdfX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8h3etmb44ywzyqvwcyc.png" alt="Facade" width="800" height="206"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 4 - Facade pattern&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Student Facade class does not implement much code since it redirects to the classes responsible for each operation.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The SRP is connected with methods and classes, when designing classes for different users or groups of users it is crucial to take into account the context and classes that are created to solve the users need and how these changes might impact code maintenance and business growth.&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Martin, Robert C. Clean Architecture&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>architecture</category>
      <category>design</category>
      <category>solid</category>
      <category>oop</category>
    </item>
    <item>
      <title>Introduction to Azure API Management Services</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Thu, 05 May 2022 14:26:03 +0000</pubDate>
      <link>https://dev.to/caiocesar/introduction-to-azure-api-management-services-2mn0</link>
      <guid>https://dev.to/caiocesar/introduction-to-azure-api-management-services-2mn0</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The use of Application Programing Interface (API) are common nowadays for may reasons. Service exposure, integrations with third party organizations, modernizations, are some common use case of API's. Migrating a monolithic application to a distributed system such as microservices is also a common use case of API's. &lt;/p&gt;

&lt;p&gt;Figure 1 has an example of a monolithic application that interacts with a service layer and database. In many cases to expand the consumers of this application the creation of multiple services becomes necessary and the use of more than one API may also be necessary. &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fai9kswrw7zaihxr7xabc.png" alt="Monolithic and Distributed System"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 1 - Monolithic and Distributed System&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Therefore many organizations may choose to implement multiple API's   and expose them to multiple consumers. A distributed system in these cases may be a solution to contextualize API's as the business grows.&lt;/p&gt;

&lt;h1&gt;
  
  
  Handling Multiple API's
&lt;/h1&gt;

&lt;p&gt;The growth of the number of API's can cause more complexity in a sense of handling these API's. API's needs to be exposed and may have distinct end-points, they might have many types of authentication, caching and logging errors can be a difficult task.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F916vbt5fhkgt2fkqd4xm.png" alt="Handling multiple API's"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 2 - Handling multiple API's &lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Figure 3 illustrates an example of 3 different API's with distinct authentication and end-points. Consuming these API's can create more complexity to the consumers due to many types of authentications and multiples end-point prefixes.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gcxbqltllpust44fjnb.png" alt="Exposure and Authentication"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 3 - Exposure and Authentication &lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  Why Azure API Management
&lt;/h1&gt;

&lt;p&gt;The use of Azure API Management (APIM) can facilitate the management of multiples API's within an organization. APIM acts as a proxy to multiple back-end API's. The consumers doesn't call the back-end API's directly, they call the APIM end-point and it routes back to the API's.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8c61udrgxnl83azio8d.png" alt="Azure API Management (APIM)"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 4 - Azure API Management (APIM)&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Benefits of APIM
&lt;/h2&gt;

&lt;p&gt;There are several of benefits to using APIM:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It facilitates the client consumption to API's through portals and resources.&lt;/li&gt;
&lt;li&gt;Allows Azure Active Directory integration for B2B and B2C.&lt;/li&gt;
&lt;li&gt;Has throttling configuration to avoid the abuse of API calls.&lt;/li&gt;
&lt;li&gt;Contains Policies with resources such as mocking, response caching, etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwkfb6uv286imwlrdkven.png" alt="Benefits of APIM"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 5 - Benefits of APIM&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  APIM Resources
&lt;/h2&gt;

&lt;p&gt;The main resources available in APIM are the API Gateway, Azure Portal and Developer Portal. Figure 6 contains details of these resources.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6mn07l4uo3u5u9upojyk.png" alt="APIM Resources"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 6 - APIM Resources&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  API Gateway, Azure Portal and Developer Portal
&lt;/h3&gt;

&lt;p&gt;The API gateway Receives API requests and routes them to the back-end. It also Authenticate to the back-end API. It allows configurations such as limitations to API calls and cache responses from back-end API’s. Figure 7 contains some details of the routing from consumer to the back-end API's.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe802atqfjhrvuoi7no6j.png" alt="API Gateway"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 7 - API Gateway&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The azure portal allows you to Import and configure new API’s, Configure policies for the API’s, Setup user access and many other configurations.&lt;/p&gt;

&lt;p&gt;The developer portal allows access to the API documentation. It enable login to account and access API Keys. It also permits testing the API's via web interface.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;There are many other configurations and resources that APIM has to offer such as products, subscriptions, groups, policies, etc. The goal of this introduction was to help you understand the basics of APIM and why some organizations might choose APIM as an API gateway.&lt;/p&gt;

</description>
      <category>azure</category>
      <category>api</category>
      <category>architecture</category>
      <category>apim</category>
    </item>
    <item>
      <title>Azure IaaS, PaaS, and SaaS Concepts</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Wed, 23 Mar 2022 03:30:52 +0000</pubDate>
      <link>https://dev.to/caiocesar/azure-iaas-paas-and-saas-concepts-3klo</link>
      <guid>https://dev.to/caiocesar/azure-iaas-paas-and-saas-concepts-3klo</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The cloud in azure offers three main categories of cloud services. The Infrastructure as a Service(IaaS), Platform as a service (PaaS), and Software as a Service(SaaS).&lt;/p&gt;

&lt;p&gt;Each of theses services have different responsibilities as seen on with different responsibilities kind of like a pyramid, as displayed in figure 1.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F890oueay8s9vk3iwzvjw.png" alt="Cloud Services"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 1 - Categories of cloud services.&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The higher in the pyramid the lesser the control, the lower in the pyramid the more control one has over the software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Infrastructure as a Service(IaaS)
&lt;/h2&gt;

&lt;p&gt;Infrastructure as a service (IaaS) is related to the hardware the system is making use of. Creating an IaaS in azure causes the allocation of a Virtual Machine. In some cases you will be responsible for installing or configuring the Operating system for that Virtual Machine and keeping up with the software updates for that machine.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fump8g5xr3lwxgd2c0yxk.png" alt="Azure VM"&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;b&gt;Figure 2 - Azure Virtual Machine.&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Platform as a Service(PaaS)
&lt;/h2&gt;

&lt;p&gt;Platform as a service (PaaS) azure will provide the Operating System and will handle installing and configuring software on that operating system for the users need.&lt;/p&gt;

&lt;p&gt;There are many services available in azure some of these are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Azure Storage&lt;/li&gt;
&lt;li&gt; Azure Cosmos DB&lt;/li&gt;
&lt;li&gt; Azure CDN&lt;/li&gt;
&lt;li&gt; Azure Database for MySQL &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmbdmxs80cqmwvhfjztm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmbdmxs80cqmwvhfjztm.png" alt="Azure PaaS Services"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Software as a Service(SaaS)
&lt;/h2&gt;

&lt;p&gt;Software as a service (SaaS) azure will have control of basically everything. This enables users to use out of the box solutions such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft 365 &lt;/li&gt;
&lt;li&gt;Xbox Live
&lt;/li&gt;
&lt;li&gt;One Drive &lt;/li&gt;
&lt;li&gt;Power Automate&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/overview/what-is-iaas/" rel="noopener noreferrer"&gt;IaaS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/overview/what-is-paas/" rel="noopener noreferrer"&gt;PaaS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/overview/what-is-saas/" rel="noopener noreferrer"&gt;SaaS&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>azure</category>
      <category>cloud</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Clean Code in C# Part 9 Rules for Results</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Mon, 31 Jan 2022 12:35:26 +0000</pubDate>
      <link>https://dev.to/caiocesar/clean-code-in-c-part-9-rules-for-results-1l5p</link>
      <guid>https://dev.to/caiocesar/clean-code-in-c-part-9-rules-for-results-1l5p</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Following a couple of simple rules when writing software could be a decision that helps teams write code that applies principles such as the Single Responsibility and Dependency Inversion Principle.&lt;/p&gt;

&lt;p&gt;According to Kent Beck a project is &lt;em&gt;Simple&lt;/em&gt; if it follows these rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create all tests&lt;/li&gt;
&lt;li&gt;No code duplicity&lt;/li&gt;
&lt;li&gt;Express the purpose&lt;/li&gt;
&lt;li&gt;Minimize the number of methods and classes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These rules are in order of reverence and will be reviewed in order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1: Create all tests
&lt;/h2&gt;

&lt;p&gt;A software must execute as expected, validation of expected results in software is crucial. Software that can be tested and that passes all test cases can be validated, software that cannot be tested and cannot be validated needs to be refactored to comply with rule 1.&lt;/p&gt;

&lt;p&gt;When creating unit tests it is wise to apply the Single Responsibility Principle (SRP), to simplify testing. Therefore, clean tests implies in cleaner code, that results in better systems.&lt;/p&gt;

&lt;p&gt;Avoiding abstractions in most cases makes it difficult to create tests. When code is tested it should be refactored to make testing simple and efficient. Having well tested software makes for better projects with loose coupling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 2: No code duplicity
&lt;/h2&gt;

&lt;p&gt;Code repetition represents unnecessary code that implies in more complexity. In the next &lt;a href="https://dotnetcoretutorials.com/2020/05/10/basic-sorting-algorithms-in-c/"&gt;example&lt;/a&gt; there are code duplication when values are swapped. &lt;/p&gt;

&lt;p&gt;Example 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;SelectionSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;lowerValue&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
            &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
            &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lowerValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;BubbleSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;itemMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;itemMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;lowerValue&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
                &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
                &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;lowerValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="n"&gt;itemMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itemMoved&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The refactored code eliminates code duplicity and now change to this code is structure to one Swap method:&lt;/p&gt;

&lt;p&gt;Example 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;SelectionSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;Swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;min&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;BubbleSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;itemMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;itemMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nf"&gt;Swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;itemMoved&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;itemMoved&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Swap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;firstPosition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secondPosition&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;swapValue&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;firstPosition&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;firstPosition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;secondPosition&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;secondPosition&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;swapValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rule 3: Expressiveness
&lt;/h2&gt;

&lt;p&gt;Writing code that compiles is trivial, but developing software that other humans comprehends can be challenging. High costs in software development are usually a result of software maintenance. To minimize time it takes for others to understand code, a software project must express its purpose clearly.&lt;/p&gt;

&lt;p&gt;There are a couple of ways to better express purpose through code as displayed in the following list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Good naming conventions for method and classes.&lt;/li&gt;
&lt;li&gt;Small classes and methods that follows SRP.&lt;/li&gt;
&lt;li&gt;Unit tests that express what is being tested and expected result.&lt;/li&gt;
&lt;li&gt;Design patterns naming that one can easily understand its purpose like UnitOfWork instead of UOW.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;According to uncle bob the most important rule to follow when writing expressive code is to try. Sometimes software developers want to deliver code fast, but spending a little more time thinking about simple naming convention can make for cleaner code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 4: Classes and methods
&lt;/h2&gt;

&lt;p&gt;When following the other 3 rules for testing, duplicity and expressiveness, one might think that a new class is necessary for everything. &lt;/p&gt;

&lt;p&gt;Creating classes and methods should be something moderated and well planned. The goal of this rule is to create a small overall system while having minimal number of classes and methods. Too many classes and methods can lead to unnecessary complexity depending on the nature of the application.&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Clean Code: A Handbook of Agile Software Craftsmanship by Robert&lt;/li&gt;
&lt;li&gt;Extreme Programming Explained: Embrace Change by Kent Beck&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dotnetcoretutorials.com/2020/05/10/basic-sorting-algorithms-in-c/"&gt;https://dotnetcoretutorials.com/2020/05/10/basic-sorting-algorithms-in-c/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cleancode</category>
      <category>csharp</category>
      <category>dotnet</category>
      <category>design</category>
    </item>
    <item>
      <title>Clean Code in C# Part 8 Classes</title>
      <dc:creator>Caio Cesar</dc:creator>
      <pubDate>Wed, 19 Jan 2022 12:21:22 +0000</pubDate>
      <link>https://dev.to/caiocesar/clean-code-in-c-part-8-classes-1h7f</link>
      <guid>https://dev.to/caiocesar/clean-code-in-c-part-8-classes-1h7f</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;A class in C# is considered a referenced type, within classes one can create Properties, Methods, Constructors, and other components available within the programing language. Developers can create several methods in a class however, a concrete class cannot be created within a method in C#. Therefore, classes are a level higher than methods and of extreme importance to clean code.&lt;/p&gt;

&lt;h1&gt;
  
  
  Class Organization
&lt;/h1&gt;

&lt;p&gt;It is recommended to maintain minimal class organization when it comes to ordering the elements that composes a class. This consistency should be applied throughout all projects within an organization. When ordering elements in a class one could consider the order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Constants &lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Properties&lt;/li&gt;
&lt;li&gt;Constructor&lt;/li&gt;
&lt;li&gt;Methods

&lt;ul&gt;
&lt;li&gt;5-1. Public Methods&lt;/li&gt;
&lt;li&gt;5-2. Protected Methods&lt;/li&gt;
&lt;li&gt;5-3. Private Methods&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have not found any official rules or recommendations for ordering elements in C# code, but keeping a consistent order between classes in a project or solution is wise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Class Size
&lt;/h2&gt;

&lt;p&gt;Classes should be small, however to measure the size of a class, lines of code is not the only concern, the responsibilities should also be considered. Giving meaningful names to classes helps one to describe the responsibilities it has. Some names makes classes seem like it has generic or too much responsibility, as described in the following example:&lt;/p&gt;

&lt;p&gt;Example 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PageManager&lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MasterTab&lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SuperAlgorithm&lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SRP is part of the 'S' in the SOLID principles that composes of good practices in object oriented programing. It states that modules including classes should have single responsibility and only one reason to change. However it is common to see this principle violated. Uncle Bob states that &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;writing code that executes is not the same as developing clean code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Dependency Inversion Principle (DIP)
&lt;/h1&gt;

&lt;p&gt;In Object Oriented Programing (OOP), concrete classes contains implementation details and interfaces that includes the definitions  of the services within a group.&lt;/p&gt;

&lt;p&gt;Checkout the following code taken from the &lt;a href="https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-2"&gt;NLOG&lt;/a&gt; library, it has an example of a concrete implementation of the logging:&lt;/p&gt;

&lt;p&gt;Example 2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;NLog.Web&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Extensions.Logging&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// NLog: setup the logger first to catch all errors&lt;/span&gt;
    &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NLog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LogManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Setup&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;RegisterNLogWeb&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;GetCurrentClassLogger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Debug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"init main"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;CreateWebHostBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;Build&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;//NLog: catch setup errors&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Stopped program because of exception"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;finally&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)&lt;/span&gt;
        &lt;span class="n"&gt;NLog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LogManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Shutdown&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As displayed in Example 2, to depend on concrete implementations  one would could setup a new instance of a logger every time it needs to be used. However NLog provides abstractions where Dependency injection can be configured as seen in the following code:&lt;/p&gt;

&lt;p&gt;Example 3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;IWebHostBuilder&lt;/span&gt; &lt;span class="nf"&gt;CreateWebHostBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="n"&gt;WebHost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;CreateDefaultBuilder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UseStartup&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;Startup&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;()&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ConfigureLogging&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;logging&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ClearProviders&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="n"&gt;logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SetMinimumLevel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Extensions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LogLevel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Trace&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseNLog&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// NLog: setup NLog for Dependency injection&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.Extensions.Logging&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HomeController&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;HomeController&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;_logger&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;HomeController&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;HomeController&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;_logger&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;IActionResult&lt;/span&gt; &lt;span class="nf"&gt;Index&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;_logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Index page says hello"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;View&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Example 3 the Microsoft extension logging library injects the NLOG implementations. The power of this implementation is that it is easy to change logging technologies and its loosely coupled because the implementation does not depend on concrete implementation in this case NLOG it uses a generic logging interface.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;When creating classes think about the impacts the class you are creating can have on the overall system. Creating abstractions such as interfaces is a good idea if the implementation details may change in the future. It also provides better testing functionalities where one could mock the abstractions.&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-2"&gt;https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-2&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>oop</category>
      <category>cleancode</category>
      <category>csharp</category>
      <category>dotnet</category>
    </item>
  </channel>
</rss>
