<?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: Letícia Barreto</title>
    <description>The latest articles on DEV Community by Letícia Barreto (@lebarreto).</description>
    <link>https://dev.to/lebarreto</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%2F374908%2F57144bf8-420f-4443-965e-09268ba31379.JPG</url>
      <title>DEV Community: Letícia Barreto</title>
      <link>https://dev.to/lebarreto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lebarreto"/>
    <language>en</language>
    <item>
      <title>Services and SOLID</title>
      <dc:creator>Letícia Barreto</dc:creator>
      <pubDate>Tue, 28 Apr 2020 18:19:15 +0000</pubDate>
      <link>https://dev.to/lebarreto/services-and-solid-nb2</link>
      <guid>https://dev.to/lebarreto/services-and-solid-nb2</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Why do I need to use services?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Microservices are an architectural approach based on building an application as a collection of small services.&lt;br&gt;
The service will store the business rule of your application, that is, everything that is very specific within your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is SOLID?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;SOLID stand for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;S - Single responsibility principle&lt;/li&gt;
&lt;li&gt;O - Open closed principle&lt;/li&gt;
&lt;li&gt;L - Liskov substitution principle&lt;/li&gt;
&lt;li&gt;I - Interface segregation principle&lt;/li&gt;
&lt;li&gt;D - Dependency Inversion principle&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  🚀Single responsibility principle:
&lt;/h5&gt;

&lt;p&gt;Principle of Single Responsibility ⇒ A class must have one, and only one, reason for changing.&lt;/p&gt;

&lt;h5&gt;
  
  
  🚀Open/closed principle
&lt;/h5&gt;

&lt;p&gt;Open / Closed Principle ⇒ You must be able to extend a class's behavior without having to modify it.&lt;/p&gt;

&lt;h5&gt;
  
  
  🚀Liskov substitution principle
&lt;/h5&gt;

&lt;p&gt;Liskov substitution principle ⇒ Derived classes must be substitutable for their base classes.&lt;/p&gt;

&lt;h5&gt;
  
  
  🚀Interface segregation principle
&lt;/h5&gt;

&lt;p&gt;Principle of interface segregation ⇒ Many specific interfaces are better than a single general interface.&lt;/p&gt;

&lt;h5&gt;
  
  
  🚀Dependency inversion principle
&lt;/h5&gt;

&lt;p&gt;Dependency inversion principle ⇒ Depend on abstractions, not implementations.&lt;/p&gt;

&lt;h3&gt;
  
  
  By applying the principles we gain object-oriented benefits for our application, such as:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Easy maintenance, understanding and organization;&lt;/li&gt;
&lt;li&gt;Open architecture to receive updates, improvements and new features without collateral damage&lt;/li&gt;
&lt;li&gt;Application of tests in an easy and simple way&lt;/li&gt;
&lt;li&gt;Easy code reuse&lt;/li&gt;
&lt;li&gt;Easy adaptation to changes in the scope of the project&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Not using SOLID means exposing your application to problems such as:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Code repetition, that is, a simple change must be replicated in several different points of its application&lt;/li&gt;
&lt;li&gt;Code without cohesive or standardized structure&lt;/li&gt;
&lt;li&gt;Rigidity and fragility, that is, any change causes a cascade of operations or failures in various parts of the system&lt;/li&gt;
&lt;li&gt;Difficulty performing and creating tests&lt;/li&gt;
&lt;li&gt;No reuse, that is, no or almost no functionality can be reused for other systems&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>node</category>
      <category>solid</category>
      <category>services</category>
    </item>
  </channel>
</rss>
