<?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: Adhiraj Kinlekar</title>
    <description>The latest articles on DEV Community by Adhiraj Kinlekar (@adhirajk).</description>
    <link>https://dev.to/adhirajk</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%2F1207202%2F6e5ba43a-e517-4796-b7a0-3d04a5b54cf6.png</url>
      <title>DEV Community: Adhiraj Kinlekar</title>
      <link>https://dev.to/adhirajk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adhirajk"/>
    <language>en</language>
    <item>
      <title>Inheritance vs Composition vs Aggregation</title>
      <dc:creator>Adhiraj Kinlekar</dc:creator>
      <pubDate>Fri, 19 Jan 2024 14:03:50 +0000</pubDate>
      <link>https://dev.to/adhirajk/inheritance-vs-composition-vs-aggregation-432i</link>
      <guid>https://dev.to/adhirajk/inheritance-vs-composition-vs-aggregation-432i</guid>
      <description>&lt;p&gt;The process of forming relations among entities is a crucial aspect of system design, playing a pivotal role in shaping the overall structure and functionality of a system. In the context of system design, entities represent distinct objects or concepts within the domain of the system.&lt;/p&gt;

&lt;p&gt;To facilitate a deeper understanding of these relationships, let's explore the concept of association. Association is a technique for creating relationships between classes, where one class contains a reference to another class or object. This concept is fundamental to how entities interact, communicate, or collaborate within the system. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aggregation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Aggregation is a weak form of association, where the contained class can exist independently of the containing class. The containing class is said to have a "&lt;u&gt;has-a&lt;/u&gt;" relationship with the contained class.&lt;/p&gt;

&lt;p&gt;In the given example, the Engine object is not "owned" by the Car class; rather, it's passed to the Car class through its constructor. The Car class simply holds a reference to the Engine object. The Car class doesn't control the Engine object's lifecycle. If the Car is destroyed, the Engine can still exist independently.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; 
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="nc"&gt;Engine&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Car&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Engine&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;engine&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Move&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Start&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="n"&gt;engine&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;Stop&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;};&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Engine&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Start&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* code to start the engine */&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;Stop&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* code to stop the engine */&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Composition&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Composition, on the other hand, is a stronger form of association, where one class contains a reference to another class, and the contained class cannot exist independently of the containing class.&lt;/p&gt;

&lt;p&gt;The containing class is said to have a "&lt;u&gt;part-of&lt;/u&gt;" relationship with the contained class. For example, the Address class is associated with a particular user and cannot exist independently. &lt;/p&gt;

&lt;p&gt;In composition, the class object's life cycle is fully controlled by the containing class, meaning when the containing class is destroyed, so is the contained class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="nc"&gt;Address&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;houseNo&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 

            &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

            &lt;span class="n"&gt;address&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;houseNo&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;GetBasicUserInfo&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;};&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Address&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;houseNo&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Address&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;_houseNo&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_city&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_state&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;houseNo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_houseNo&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

            &lt;span class="n"&gt;city&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_city&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

            &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_state&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Inheritance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another related concept in forming relationships is inheritance. Inheritance is a fundamental concept in object-oriented programming (OOP) that allows a class (called a subclass or derived class) to acquire properties and behaviors (fields and methods) from another class (called a superclass or base class).&lt;/p&gt;

&lt;p&gt;Inheritance establishes an "&lt;u&gt;is-a&lt;/u&gt;" relationship between the base class and the derived class. For example, if you have a base class User and a derived class Employee, you can say that "an employee is a user".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;readonly&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;employeeId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

        &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;_employeeId&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;houseNo&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;houseNo&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;city&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;

            &lt;span class="n"&gt;employeeId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;_employeeId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In conclusion, the establishment of relationships among entities is at the core of effective system design. By defining connections and associations, we enable entities to interact, communicate, and collaborate within the system. It's crucial to recognize that the way entities are related has a profound impact on the system's efficiency, data integrity, and overall performance. &lt;/p&gt;

&lt;p&gt;Song of the day: The Dear Hunter - The Most Cursed of Hands / Who Am I&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/GZ-4fYqdxus"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>designpatterns</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
      <category>oop</category>
    </item>
    <item>
      <title>What makes a database ACID compliant?🧪</title>
      <dc:creator>Adhiraj Kinlekar</dc:creator>
      <pubDate>Mon, 20 Nov 2023 08:45:38 +0000</pubDate>
      <link>https://dev.to/adhirajk/acid-compliance-in-databases-oe0</link>
      <guid>https://dev.to/adhirajk/acid-compliance-in-databases-oe0</guid>
      <description>&lt;p&gt;Before diving into ACID, let's first establish a fundamental concept in database management: transactions. A database transaction is a logical unit of work that consists of one or more operations executed against a database. It's worth noting that, in most databases, a transaction is always initiated, with each individual database operation treated as a transaction. Users can explicitly start one, and if a transaction is not explicitly started, the database system will automatically start it and then promptly conclude the transaction.&lt;/p&gt;

&lt;p&gt;Now, turning our attention to ACID, which stands for Atomicity, Consistency, Isolation, and Durability, it represents a set of properties that ensure the reliability and integrity of data within a database system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Atomicity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Atomicity is a fundamental attribute of transactions, emphasizing their indivisible nature. Transactions, consisting of a set of operations, either successfully complete in entirety or undergo a complete rollback in the event of failures, such as power outages, exceptions, or crashes. This ensures that the database remains in a consistent state despite unforeseen challenges. &lt;/p&gt;

&lt;p&gt;Let's consider a simple example of an atomic transaction in a banking context:&lt;/p&gt;

&lt;p&gt;Suppose you want to transfer money from one account to another.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;u&gt;Debit:&lt;/u&gt;&lt;br&gt;
Deduct $100 from Account A.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Credit:&lt;/u&gt;&lt;br&gt;
Add $100 to Account B. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In an atomic transaction:&lt;/p&gt;

&lt;p&gt;Both the debit and credit operations must successfully complete, resulting in Account A being debited by $100 and Account B being credited by $100.&lt;/p&gt;

&lt;p&gt;Or, if any part of the transaction fails (e.g., Account B is inactive), the entire transaction is rolled back. In this case, no money is deducted from Account A. This ensures that the bank account system remains in a consistent state, and the money transfer is treated as an indivisible unit. If something goes wrong, the system won't end up in an inconsistent state where money is deducted from one account but not added to the other.&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%2F30658p6jmg60q4aw26by.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%2F30658p6jmg60q4aw26by.png" alt="Dwight meme" width="500" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Isolation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It refers to the ability to concurrently process multiple transactions in a way that one does not affect another. Changes occurring in a particular transaction will not be visible to any other transaction until that specific change in that transaction has been committed.&lt;/p&gt;

&lt;p&gt;Isolation levels define the degree to which a transaction must be isolated from the data modifications made by any other transaction in the database system. &lt;/p&gt;

&lt;p&gt;A transaction isolation level is defined by the following phenomena –&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Dirty read -&lt;/u&gt; A dirty read is a situation when a transaction reads data that has not yet been committed.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Non repeatable read -&lt;/u&gt; A non-repeatable read occurs when a transaction needs to read the same row twice, and there is a mismatch between the values in these rows.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Phantom read -&lt;/u&gt; A phantom read occurs when a transaction reads a set of rows satisfying a specific condition in a read query, and another transaction inserts new rows that would meet the condition specified in the aforementioned read query. As a result, upon subsequent reads, the result will include new rows that were not present in the initial read.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Lost update -&lt;/u&gt; It occurs when a same record is updated by two different transactions at the same time.&lt;/p&gt;




&lt;p&gt;Isolation levels in database transactions vary depending on these phenomena, and the following are some examples - &lt;/p&gt;

&lt;p&gt;&lt;u&gt;Read Uncommitted :&lt;/u&gt; &lt;br&gt;
Read Uncommitted is the lowest isolation level. In this level, a transaction can read changes made by other transactions, regardless of whether those changes have been committed or not. At this level, transactions are not isolated from each other. This isolation level does not prevent dirty reads, non-repeatable reads, or phantom reads and it is susceptible to lost updates.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Read Committed :&lt;/u&gt;&lt;br&gt;
This isolation level guarantees that any data that is being read in a transaction is committed. The transaction secures a read lock (for read-only operations) or a write lock (when updating or deleting the row) on the current row to block other transactions from modifying or deleting it. The read locks are released as the transaction moves away from the current row. It holds write locks until it is committed or rolled back.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Repeatable Read :&lt;/u&gt;&lt;br&gt;
This is one of the most restrictive isolation level. Beyond the assurance of encountering only committed data, any rows read by a transaction remains constant throughout subsequent reads within the same transaction. The transaction enforces read locks on all rows it accesses and write locks on any rows subject to insertion, updating, or deletion. The transaction releases its locks when it is committed or rolled back. This effectively prevents issues like dirty reads, non-repeatable reads, and helps mitigate the risk of lost updates. However, it's important to note that phantom reads remain a possibility. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;Serializable :&lt;/u&gt;&lt;br&gt;
It is the highest level of isolation. Serializable isolation ensures that transactions are executed in a manner that maintains serializability. This is the strongest of all the isolation levels and guarantees pure isolation. The transaction holds a read lock (if it only reads rows) or a write lock on the range of rows it affects. For example, if the transaction includes the SQL statement DELETE FROM Orders WHERE Status = 'PLACED,' the range is all rows with a Status of 'PLACED'; the transaction write-locks all rows in the Orders table with a Status of 'PLACED' and does not allow any rows to be inserted or updated that match this condition. Serializable isolation prevents dirty reads, non-repeatable reads, phantom reads, and prevents lost updates.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Snapshot :&lt;/u&gt;&lt;br&gt;
In Snapshot Isolation, each query in a transaction only sees changes that have been committed up to the start of the transaction. It is considered an optimistic form of concurrency control because it allows transactions to proceed with the optimistic assumption that conflicts are rare. The transaction itself will only succeed if none of the updates it has made conflict with any concurrent updates made since that snapshot. Snapshot isolation prevents dirty reads, non-repeatable reads, phantom reads, and prevents lost updates.&lt;/p&gt;

&lt;p&gt;It's worth noting that the implementation of the isolation levels can vary across different database management systems. The details mentioned here are tailored with Microsoft SQL Server in mind.&lt;/p&gt;



&lt;p&gt;Let's consider a scenario where isolation is not maintained, leading to a "dirty read" in a banking context:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;u&gt;Transaction 1 (Jane):&lt;/u&gt;&lt;br&gt;
Jane initiates a transaction to transfer $100 from her account to John's account.&lt;br&gt;
Transaction 1 has not been committed yet.&lt;/p&gt;

&lt;p&gt;&lt;u&gt; Transaction 2 (John):&lt;/u&gt;&lt;br&gt;
John initiates a transaction to check his account balance.&lt;br&gt;
John's transaction reads the account balance, which includes Jane's uncommitted transfer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, due to the lack of isolation:&lt;/p&gt;

&lt;p&gt;John sees an updated balance in his account, reflecting Jane's transfer, even though Jane's transaction has not been committed.&lt;br&gt;
The problem: John has read uncommitted data, leading to a "dirty read" where he observes changes made by Jane that are not finalized. In the event that transactions do not reach completion, it can result in significant confusion and potential discrepancies.&lt;br&gt;
This example illustrates the potential issues that can arise when transactions are not properly isolated, allowing one transaction to see uncommitted changes made by another transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Consistency&lt;/strong&gt; &lt;br&gt;
Consistency refers to the correctness and integrity of a database's data during and after a transaction. when transactions are being processed or executed within the database system the data should not be inconsistent and should always be in valid state. The “valid state” refers to the rules specified such as integrity, referential, not null, data types or other SQL constraints. To ensure consistency, database operations must be atomic, and transactions must be isolated from one another and if data at any stage goes against the specified rules or constraints, the whole transaction should fail.&lt;/p&gt;

&lt;p&gt;We should not mistake strong/eventual consistency with the consistency guarantee of ACID databases. Strong/eventual consistency refers to the degree of consistency across multiple nodes of a database system. However, when replications are performed asynchronously (changes are not applied to all nodes immediately, and the primary database commits transactions without waiting for acknowledgment from replicas), it can introduce a delay between the time a transaction is committed on one node and when it is replicated to other nodes. During this lag, there is a window of time when the data on the replicated nodes may not be consistent with the source node.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Durability&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Durability ensures that once a transaction is committed, its effects are permanent and survive any subsequent failures, such as power outages, system crashes, or errors. The changes made during a transaction are written to durable storage, such as a solid-state drive, ensuring permanence even in the case of failures.&lt;/p&gt;

&lt;p&gt;This durability is commonly achieved through mechanisms like transaction logging, where changes are initially recorded in a log stored on durable storage before being applied to the database. The transaction log serves as a record for recovery in case of failure. When the system is restarted or recovered, the committed changes are still present, and the DBMS uses it to recover the database to a consistent state by applying all committed changes. &lt;/p&gt;

&lt;p&gt;Song of the day: Dream Theater - Pull Me Under&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/SGRgAULYgWE"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>database</category>
      <category>sqlserver</category>
      <category>sql</category>
      <category>programming</category>
    </item>
    <item>
      <title>Git Essentials: A Pragmatic Approach to Version Control 🌿</title>
      <dc:creator>Adhiraj Kinlekar</dc:creator>
      <pubDate>Sun, 12 Nov 2023 19:24:50 +0000</pubDate>
      <link>https://dev.to/adhirajk/git-essentials-a-pragmatic-approach-to-version-control-27an</link>
      <guid>https://dev.to/adhirajk/git-essentials-a-pragmatic-approach-to-version-control-27an</guid>
      <description>&lt;h2&gt;
  
  
  Introduction to Version Control
&lt;/h2&gt;

&lt;p&gt;👋 To understand Git, having a foundational understanding of version control is essential. Version control, also known as source control, is the practice of tracking and managing changes to files over time. Version control systems are software tools that help software developers work in a team by enabling efficient collaboration and effectively managing changes to files in projects. By far, Git is the most widely used version control system in the world today.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Introduction to Git&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Git is an open-source distributed version control software originally developed in 2005 by Linus Torvalds. To get started with Git, download and install it from &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;git-scm.com&lt;/a&gt;. During installation, use the recommended settings and optionally select a default editor of your choice. Once installed, the next step is to create a Git repository.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Git Repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Git repository is a directory whose contents are tracked by Git.  As a good practice, always execute &lt;code&gt;git status&lt;/code&gt; to confirm you are not currently within an existing repository before initializing one.  Utilize the &lt;code&gt;git init&lt;/code&gt; command to create a new Git repository or convert an untracked project into one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Working with remote Repositories&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Git repositories can be either local or remote. When collaborating on an existing project hosted on a remote server, you can duplicate the repository in your local directory. The process of creating this local copy is known as cloning. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/facebook/react.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Staging and Committing changes
&lt;/h2&gt;

&lt;p&gt;Once your repository is cloned or initialized, add a file or make some changes to existing files to understand some of the most important concepts in Git, staging and committing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Committing: Saving a Snapshot of Your Codebase&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Staging is a step that comes before committing, but before diving into it, it's helpful to first understand what committing entails and what problems it addresses.&lt;/p&gt;

&lt;p&gt;Imagine investing considerable time and effort into developing a feature, only to encounter an unexpected event just before completion, potentially resulting in the loss of your code changes. While periodic file-saving provides some protection, it may not be foolproof. This is where Git comes into play. Committing in Git serves as a mechanism to save and undo changes as well as offers the ability to restore previous code versions.&lt;/p&gt;

&lt;p&gt;Committing essentially acts like taking a snapshot of your codebase at a specific moment. By committing changes, you create a record of your codebase's state, providing a reference point for future use. This practice ensures the safety and recoverability of your work, allowing you to navigate through different versions of your codebase with confidence&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Staging: The Pre-commit Step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, where does staging fit into this? 🤔 Staging plays a crucial role in the Git workflow, enabling you to specify which local changes should be included in the next commit. When you stage changes, you effectively add modified files to the staging area, preparing them for inclusion in a commit.&lt;/p&gt;

&lt;p&gt;It's essential to understand that staging itself does not make any permanent changes to the repository—only committing records the changes permanently. &lt;u&gt;To maintain clear and organized commits, it's a good practice to group related changes together when committing.&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Here's an example of adding a file to the staging area and performing a commit with a message:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Add a file to the staging area
   git add &amp;lt;filename&amp;gt;

// To commit the changes to the repository with a message
   git commit -m "Added a new file to the project"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Branching in Git
&lt;/h2&gt;

&lt;p&gt;One of the most important features of a version control system is its capability to create branches, allowing developers to simultaneously work on different versions of the code. &lt;/p&gt;

&lt;p&gt;A branch represents a distinct version of the codebase derived from a specific point in the repository's history. This new version, essentially a snapshot of the code at the time of branching, enables developers to work on new features, experiment with code changes, or address bugs without impacting the main codebase until ready for integration.&lt;/p&gt;

&lt;p&gt;The master branch is the default branch created upon initializing a repository. Typically, it functions as the primary branch where all changes eventually merge from other branches. While the master branch is commonly employed for production code, its usage can vary based on the team's development workflow and practices.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git branch&lt;/code&gt; command offers various functionalities, including creating, listing, renaming, and deleting branches. To create a new branch based on the current working branch, simply execute the following command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch branch-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Navigating between branches
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;git checkout&lt;/code&gt; command provides a way to switch between branches. However, it's worth noting that this command has multiple uses, and hence it is a good practice to use the newer, safer and appropriately named &lt;code&gt;git switch&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
git checkout feature-branch

git switch feature-branch

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

&lt;/div&gt;


&lt;p&gt;Now let's see how we can navigate between branches without having to discard local changes…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stashing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stashing is used to record the current state of the working directory and go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the &lt;code&gt;HEAD&lt;/code&gt; commit.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick note - (In Git, the HEAD typically points to the latest commit on the currently checked-out branch. In a detached HEAD state, it directly references a specific commit rather than a branch. To reattach the HEAD, simply switch to a branch. To discard changes made in this state, checkout to an existing branch. Commits in a detached HEAD state won't impact the existing branch and are archived by Git. To retain changes, create a new branch, and the HEAD will no longer be detached)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Stashing is handy when you need to quickly switch between branches and work on something else, but you're mid-way through a code change and aren't quite ready to commit.&lt;u&gt; A commit is part of the public Git history, meaning that other collaborators can see your commits when they fetch or pull changes from the repository. In contrast, a stash is stored locally on your machine and is not automatically shared with others.&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The most common git stash options include:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git stash push // creates a new stash, rolling back file states.

git stash pop // restores stash files to the workspace and deletes the stash.

git stash apply // restores stash files to the workspace without deleting the stash.

git stash list // shows stash history chronologically.

git stash clear // removes all stash entries.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Undoing and managing history
&lt;/h2&gt;

&lt;p&gt;Git provides multiple ways to view and amend history. You might want to amend history in case something goes wrong or if you want to clean up unnecessary commits and have a clean history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git restore&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git restore&lt;/code&gt; command is used to unstage or discard uncommitted local changes. It can undo the effects of &lt;code&gt;git add&lt;/code&gt; with the &lt;code&gt;--staged&lt;/code&gt; argument, allowing you to unstage changes previously added to the Staging Area. Additionally, it can discard local changes in a file, reverting it to its last committed state."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git reset&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git reset&lt;/code&gt; command resets the repository back to the specified commit. Changes from commits since the specified commit will be preserved as unstaged changes, allowing you to take further action as needed. It also offers a more forceful option, &lt;code&gt;--hard commit-hash&lt;/code&gt;, which not only removes commit entries but also discards all changes made since the specified commit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git revert&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Another useful command related to undoing history is the &lt;code&gt;git revert&lt;/code&gt; command. It creates a brand new commit that reverses the changes from the provided commit. For this reason, git revert is commonly recommended for undoing changes on a public branch to avoid confusion and potential conflicts when pulling changes. On the other hand, &lt;code&gt;git reset&lt;/code&gt; should be reserved for undoing changes on a private branch. &lt;/p&gt;
&lt;h2&gt;
  
  
  Collaborating with other developers
&lt;/h2&gt;

&lt;p&gt;In a professional environment, your source code is likely to be stored in a remote repository that is connected to your local repository. Remote repositories are hosted on platforms like GitHub, GitLab etc. Developers work together by regularly pushing and pulling changes to and from the remote repository. This allows multiple people to work on the same codebase and share their contributions. The remote repository acts as a central location for the team to keep their code and collaborate efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git Push&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Pushing is the process of uploading the content of a local repository to a remote repository. It facilitates the transfer of commits from a local repository to a corresponding remote one, such as on GitHub. Git allows you to set the upstream of the branch being pushed, creating a linkage between the local branch and its counterpart on the remote repository. Once the upstream is established for a branch, you can conveniently use a shorthand command to push the current branch to its upstream, eliminating the need to specify the remote or branch explicitly.&lt;/p&gt;

&lt;p&gt;Quick note - (Upstream refers to the original repository or branch from which a clone or fork was created. For example, when you clone a repository from GitHub, the remote GitHub repository is considered the upstream for the local copy. Pushing changes to a branch that doesn't exist remotely creates a new branch on the upstream repository. The terms 'origin' and 'upstream' are interchangeable, representing the repository from which the project was cloned. Typically, 'origin' is set as the default remote name during cloning, but it's a convention and can be customized to any preferred name)&lt;/p&gt;

&lt;p&gt;Here is an example of how to push commits to a remote repository, set the upstream of the branch, and use the shorthand command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Push local commits to the remote repository
git push &amp;lt;remote&amp;gt; &amp;lt;branch&amp;gt;

# Set the upstream of the branch
git push -u &amp;lt;remote&amp;gt; &amp;lt;branch&amp;gt;

# Push to the upstream using shorthand
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Git Pull&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git pull&lt;/code&gt; command is used to download commits and other changes from a remote repository and immediately update the local repository to match that content. It's a common task in collaborative Git-based workflows, as it allows you to synchronize your local repository with the remote one.&lt;/p&gt;

&lt;p&gt;When you use &lt;code&gt;git pull&lt;/code&gt;, git will try to merge the changes automatically. But if there are conflicts between the local and remote changes, it will stop the process and ask you to resolve the conflicts before proceeding with the merge.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;It's considered a good practice to pull the changes from the remote repository before pushing your own changes&lt;/u&gt;. This way you'll avoid conflicts and ensure that your local repository is up-to-date with the remote one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git Fetch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git fetch&lt;/code&gt; command downloads commits, files, and references from a remote repository. However, these changes are not immediately integrated into the working files. To view the downloaded content, you must explicitly switch to the specific remote branch.&lt;/p&gt;

&lt;p&gt;Fetching provides a way to safely review commits without automatically merging them into your local repository, as opposed to the &lt;code&gt;git pull&lt;/code&gt; command, which combines &lt;code&gt;git fetch&lt;/code&gt; with &lt;code&gt;git merge&lt;/code&gt; to automatically integrate changes into your local branch.&lt;/p&gt;

&lt;p&gt;Here is an example of how to fetch commits from a remote repository and review the changes:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Fetch commits from the remote repository
git fetch origin feature

# Check out the fetched branch
git checkout origin/feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Merging and Rebasing branches
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Merging&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Merging serves as a method to combine branches and their respective histories, a common practice in Git, especially in workflows like the feature branch model. In this approach, developers create a new branch for each feature, enabling them to work on the feature independently of the main development line.&lt;/p&gt;

&lt;p&gt;Throughout development, updates from the primary branch, often named main or master, are regularly merged into the feature branch, ensuring it stays current with the latest changes.&lt;/p&gt;

&lt;p&gt;Upon completing the feature, the feature branch undergoes a merge back into the primary branch, integrating the changes into the main development line.&lt;/p&gt;

&lt;p&gt;Merge commits are distinctive, having two parent commits—one from the current branch and the other from the branch being merged. Git attempts to automatically merge the separate histories during a merge commit. However, if a merge conflict arises, indicating conflicting changes in both histories, Git requires user intervention to resolve the conflict.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rebasing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Rebasing, a specialized Git utility, enhances the integration of changes between branches, offering an alternative to merging.&lt;/p&gt;

&lt;p&gt;The process involves moving or "replaying" a sequence of commits from one branch onto the tip of another. By updating the target branch with the latest commits from the source, it effectively "replays" these commits on top of the target branch, facilitating the incorporation of new changes while maintaining a linear history.&lt;/p&gt;

&lt;p&gt;In the context of a feature branching workflow, git rebase is particularly valuable. It enables the integration of changes from the main branch into a feature branch, preserving a linear commit history. This choice over git merge aids in presenting a clearer development flow without generating additional merge commits.&lt;/p&gt;

&lt;p&gt;It's essential to note that rebasing alters commit history, making it advisable to avoid if the branch has been shared or if changes have been pushed to a public branch.&lt;/p&gt;

&lt;p&gt;Rebasing also provides the flexibility to add or drop commits before a specified commit hash. When executed in interactive mode, Git opens a text editor, displaying a list of commits within the specified range and a set of commands (pick, reword, edit, squash, and drop) for user selection.&lt;/p&gt;
&lt;h2&gt;
  
  
  GitHub and contributing to open source
&lt;/h2&gt;

&lt;p&gt;GitHub is a platform that hosts your repositories and aids in collaboration on software projects. GitHub provides you with a safe space to store your code so that even in a worst-case scenario such as a system failure, you will always have a backup of your code base.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pull Request&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A pull request is a feature provided by GitHub (and other web-based Git hosting services), it is not a native feature of Git. A pull request enables you to notify others about changes that you have pushed to a branch in a repository and request that they merge your changes into the main branch.&lt;/p&gt;

&lt;p&gt;Upon opening a pull request, you can include a description of the changes and the rationale behind them. Collaborators on the repository have the opportunity to review the proposed modifications, engage in discussions, and leave comments. While the pull request is active, you can continue making additional commits to the branch to address any feedback received.&lt;/p&gt;

&lt;p&gt;Pull request is a powerful feature that allows developers to collaborate and review code changes before they are merged into the main branch. It's often used in Git-based workflows to facilitate code review, testing and quality assurance processes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forking&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A fork is a copy of a repository that you have control over, it can be thought of as your own personal version of the original repository. Forks allow you to make changes to a project without affecting the original repository.&lt;/p&gt;

&lt;p&gt;In most cases, open-source projects do not allow contributors to push changes directly to the original repository. Instead, contributors are expected to fork the repository, make changes to their own copy, and then submit a pull request to the maintainers of the original repository.&lt;/p&gt;

&lt;p&gt;When you fork a repository on GitHub, it creates a copy of the repository under your own account, which you can then clone to your local machine. Once you've cloned the repository, you will need to add another remote to your local copy, this remote should point to the original repository that you cloned from. This is necessary so that you can fetch the latest commits from the original repository and keep your fork up-to-date.&lt;/p&gt;

&lt;p&gt;You can then make changes to your local copy of the repository, commit your changes, and push them to your fork on GitHub. Once you're ready to submit your changes, you can create a pull request to request that the maintainers of the original repository review and merge your changes.&lt;/p&gt;

&lt;p&gt;The following example demonstrates how to add a new remote named upstream that points to the original repository:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add upstream https://github.com/facebook/react.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;PS - The cover image features a dog playing fetch with a branch (twig). Get it?&lt;/p&gt;

&lt;p&gt;Resources :&lt;br&gt;
&lt;a href="https://git-scm.com/book/en/v2" rel="noopener noreferrer"&gt;https://git-scm.com/book/en/v2&lt;/a&gt;&lt;br&gt;
&lt;a href="https://nvie.com/posts/a-successful-git-branching-model/" rel="noopener noreferrer"&gt;https://nvie.com/posts/a-successful-git-branching-model/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.atlassian.com/git/tutorials/comparing-workflows" rel="noopener noreferrer"&gt;https://www.atlassian.com/git/tutorials/comparing-workflows&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Song of the day : Saturnus - I long&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.youtube.com/watch?si=QrBpuPFU7l3RFyiG&amp;amp;v=NlXENjvDsqc&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;
      youtube.com
    &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding Keys in Relational Databases 🔑</title>
      <dc:creator>Adhiraj Kinlekar</dc:creator>
      <pubDate>Sun, 12 Nov 2023 04:45:14 +0000</pubDate>
      <link>https://dev.to/adhirajk/understanding-keys-in-relational-databases-1ecl</link>
      <guid>https://dev.to/adhirajk/understanding-keys-in-relational-databases-1ecl</guid>
      <description>&lt;p&gt;Keys are used to uniquely identify records or rows of data in a table or to establish and identify relationships between tables. Mainly, there are eight different keys in relational databases.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Super key&lt;/strong&gt; : A Super key is any combination of columns that can be used to uniquely identify a row.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Candidate key&lt;/strong&gt; : A Candidate Key is the minimal amount of columns that can be used to uniquely identify a row. All super keys can’t be candidate keys but any candidate key can be a super key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Primary key&lt;/strong&gt; : A Primary key is a key which uniquely identifies a row. Out of all the Candidate keys that are possible for a table, there can be only one key that can be used as a Primary Key. In other words, a Primary key is the Candidate key selected by the database administrator to uniquely identify rows in a table. A primary key cannot have null or duplicate values.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Alternate key&lt;/strong&gt; : A candidate key which is not selected as a primary key is called an alternate or a secondary key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Surrogate key&lt;/strong&gt; : A surrogate key is a key which is a primary key but the column on which the key is applied is unrelated to the data present in the table. An example of a surrogate key would an auto incrementing Id column which is marked as a primary key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Composite key&lt;/strong&gt; : A table can have only one primary key, which may consist of single or multiple fields. When multiple fields are used as a primary key, it is called a composite key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Foreign key&lt;/strong&gt; : A foreign key is a column in the table that is the primary key in another table. It is useful for drawing relations between the tables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compound key&lt;/strong&gt; : A compound key is similar to a composite key in that two or more fields are used  to uniquely identify a row. However, a compound key is formed when a foreign key is involved in the distinctive identification.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Out of all the keys, three play a significant role in designing a well-organized and robust database system: the primary key, which uniquely identifies records; the foreign key, which establishes relationships between tables; and, while not always chosen as the primary key, candidate keys are vital because they represent the minimal set of columns that can uniquely identify a row. &lt;/p&gt;

&lt;p&gt;Song of the day : Cynic - How could I&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/z7IPg8lklB4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Understanding the four Pillars of Object-Oriented Programming using JavaScript 💊</title>
      <dc:creator>Adhiraj Kinlekar</dc:creator>
      <pubDate>Sat, 11 Nov 2023 08:49:07 +0000</pubDate>
      <link>https://dev.to/adhirajk/understanding-the-four-pillars-of-object-oriented-programming-using-javascript-3a71</link>
      <guid>https://dev.to/adhirajk/understanding-the-four-pillars-of-object-oriented-programming-using-javascript-3a71</guid>
      <description>&lt;h2&gt;
  
  
  Object Oriented Programming
&lt;/h2&gt;

&lt;p&gt;Object-Oriented Programming is a programming paradigm that enables you to model and structure your code using objects and classes. JavaScript is not a full-fledged OOP language, but you can still leverage OOP's core principles to write cleaner and more maintainable code. There are four main pillars of Object-Oriented Programming:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstraction&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Abstraction means hiding the complex implementation details and exposing only what is necessary. Even though JavaScript lacks interfaces or abstract classes, we can still achieve abstraction through other means.&lt;/p&gt;

&lt;p&gt;One effective approach for implementing abstraction is to expose only the necessary methods and then, through this exposed method, invoke the private methods of the class. This strategy effectively conceals the underlying complexities, which is a fundamental aspect of abstraction.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Auth&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Private method&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;sendOnboardingEmail&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Private method&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Public method that calls private methods&lt;/span&gt;
    &lt;span class="nf"&gt;signUp&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="c1"&gt;// Execute signUp functionality&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;sendOnboardingEmail&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Auth&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Calls the public method, which, in turn, calls private methods&lt;/span&gt;
&lt;span class="nx"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;signUp&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Encapsulation&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;When you search the internet for information about Abstraction and Encapsulation, you will likely come across numerous articles that sometimes present conflicting ideas. In my understanding, although abstraction and encapsulation are different concepts, they often complement each other. In the code block above, private accessors are utilized, enabling controlled access to the class, aligning with the principles of Encapsulation. Encapsulation promotes the idea of bundling data and the functions that operate on that data into a single, self-contained package. This encapsulated entity can control how the data is accessed, modified, or interacted with.&lt;/p&gt;

&lt;p&gt;Even though Encapsulation is an OOP concept, it can be implemented without the use of classes and objects by utilizing Closures. A closure is a mechanism that enables an inner function to access the variables and parameters of its outer function, even after the outer function has completed its execution. Closures achieve encapsulation by packaging the actual code (the body of the function) along with the variables and parameters that the function can access during its execution. The exclusive method for accessing the encapsulated data is through the function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createCounter&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// This variable is encapsulated within the closure.&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// The inner function can access the 'count' variable.&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Return the inner function (closure).&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createCounter&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Inheritance&lt;/strong&gt;    &lt;/p&gt;

&lt;p&gt;When a class acquires the members and behaviors of its parent class, it is known as Inheritance. Inheritance provides code reusability and encourages modular design by breaking down a complex system into smaller, manageable components. When you need to make changes or updates to shared functionality, you can do so in the base class. These changes automatically apply to all derived classes, reducing maintenance efforts and ensuring consistency throughout your codebase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Hello, my name is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, and I am &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; years old.`&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="c1"&gt;// Create a derived class Student that inherits from Person&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Student&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;studentId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Call the parent class constructor using super&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;studentId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;studentId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;study&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; with student ID &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;studentId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; is studying &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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="c1"&gt;// Create instances of Person and Student&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;person1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Alice&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;student1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Student&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Bob&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;12345&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Use the inherited methods&lt;/span&gt;
&lt;span class="nx"&gt;person1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;student1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;student1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;study&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Math&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Polymorphism&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;The term 'polymorphism' means having many forms. The concept of polymorphism enables us to perform different operations in various scenarios. In object-oriented programming languages such as C#, polymorphism is achieved through the use of interfaces and abstract classes, as well as through the use of virtual methods and overriding in inheritance. While JavaScript does not provide comprehensive support for polymorphism, we can still achieve it. &lt;/p&gt;

&lt;p&gt;Polymorphism can be attained by using inheritance and by overriding the base class. You do not need to explicitly indicate that a method is being overridden since JavaScript uses a prototype-based inheritance model, and method overriding is accomplished simply by defining a method with the same name in a subclass. The new method in the subclass effectively replaces the method with the same name in the base class, allowing you to perform different actions in different scenarios, which aligns with the concept of polymorphism&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Transport&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

  &lt;span class="nf"&gt;drive&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Driving...&lt;/span&gt;&lt;span class="dl"&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;fly&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Flying...&lt;/span&gt;&lt;span class="dl"&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="c1"&gt;// Create a derived class Car that inherits from Transport&lt;/span&gt;
&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Transport&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Overrides it's base implementation&lt;/span&gt;
  &lt;span class="nf"&gt;fly&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I am a car, I cannot fly&lt;/span&gt;&lt;span class="dl"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;audi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;audi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fly&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Song of the day : Agalloch - Hawthorne Passage&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6n0va4524fI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
