<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Taylan Can Hardal on Medium]]></title>
        <description><![CDATA[Stories by Taylan Can Hardal on Medium]]></description>
        <link>https://medium.com/@taylancanh?source=rss-a1c390db5f8e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o2FEwLMbQI6GmwMfGWG8iQ@2x.jpeg</url>
            <title>Stories by Taylan Can Hardal on Medium</title>
            <link>https://medium.com/@taylancanh?source=rss-a1c390db5f8e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:57:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@taylancanh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hash’in tuzu biberi]]></title>
            <link>https://taylancanh.medium.com/hashin-tuzu-biberi-7540c179ca9b?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7540c179ca9b</guid>
            <category><![CDATA[sha-256]]></category>
            <category><![CDATA[hash-function]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[hash]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 03:26:56 GMT</pubDate>
            <atom:updated>2024-12-06T03:26:56.548Z</atom:updated>
            <content:encoded><![CDATA[<p>Şifreyi herkes Hash’ler, biz içine tuz biber ekmeye geldik. Türkçe deyimlere bu kadar güzel uyan bir algoritmik yapı daha yoktur büyük ihtimalle. Ben de Türkçe anlatabileceğim bu denli güzel bir konu bulmuşken ayrıca Medium yazılarıma da artık Türkçe devam etmek istiyorken bu pası kaçıramazdım. Uzuuun bir aradan sonra Yine, Yeni, Yeniden…</p><p>Önce biraz Hash’ten bahsedelim.</p><h4>Hash</h4><blockquote>Hash, bir veri kümesinin belirli bir algoritma aracılığıyla sabit uzunlukta bir değere dönüştürülmesidir.</blockquote><p>Yani GitHub şifrenizin yada bir Cem Yılmaz filminin yada Milena’ya yazılmış mektupların belli büyüklükte bir string çıktısı.</p><p>Peki bu çıktının özelliği ne? Bu çıktı öncelikle benzersiz. Bu çıktıdan bir tane daha yok. Örneğin, SHA-256 algoritması ile GORA filminin 2 saat 7 dakika 33 saniye süren versiyonunun dosyasını Hash’lediğiniz, ardından filmin sonundan bir saniye kırpıp 2 saat 7 dakika 32 saniyelik bir versiyonunu oluşturup o dosyayı Hash’lediniz, çıkan iki Hash değeri farklı olacaktır. Dosyanın içeriğindeki en ufak değişiklik bile birbirinden tamamen alakasız başka bir Hash değeri almanıza sebep olacaktır. Aslında bu muazzam bir güvenlik yöntemi ancak o kısma birazdan geleceğiz.</p><p>Bu çıktının bir diğer önemli özelliği ise veriye dair bir bilgi içermiyor olması. Mesela bir sanatçının bir albümünü Hash’ledik diyelim. Çıkan çıktıdan sanatçının kim olduğuna dair şarkılarına ve o şarkıların sözlerine dair en ufak bir bilgi edinemeyiz. Bu da günün sonunda Hash çıktısının veri bütünüyle bir alakası olmadığını ve sadece o veri bütününü temsil ettiği sonucuna ulaştırır bizleri.</p><p>İşin yukarıda bahsettiğim güvenlik boyutuna gelecek olursak. Hash’in benzersiz olması nasıl bu kadar büyük bir güvenlik yöntemi olabilir? Bir örnekle hemen açıklayayım. Bir banka bütün para transferlerini bir tabloda “Ali Veli’ye 100TL yolladı” şeklinde tutuyor olsun. Aynı zamanda da bunları Hash’leyerek farklı bir tabloda tutuyor olsun. Bu verinin hash çıktısı şu şekilde olacaktır : “63a0c77f7650b56fcd843777aab3f9a1380c187825ec788a4096334accb67594” bu değer. Kötü niyetli bir kişi bu veritabanını ele geçirmiş olsun. Tabloları inceleyip “Ali Veli’ye 100TL yolladı” datasını “Ali Veli’ye 100.000TL yolladı” olarak değiştirsin. Eğer banka bu verileri Hash’lemeden tutarsa Ali’nin Veli’ye ne kadar yolladığını bilemeyeceği için Veli’ye 100.000TL ödemek zorunda ancak bankamız verilerini Hash’leyerek tuttuğu için “Ali Veli’ye 100.000TL yolladı” datasının Hash’inin “b86ace14d9c3b6e9f6772355d281263f7bd643622d5d42296224e937462a9480” olduğunu görecek ve 100.000TL’yi vermek zorunda kalmayacak. <strong>Temelde, Bitcoin güvenliğini bu şekilde sağlar.</strong></p><p>Hash’i tuzlamaya geçmeden güvenlik konusundan ve Hash çıktısının bazen içerdiği veriye dair bilgi verebileceğinden bahseden muazzam bir video iliştiriyorum buraya.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FF2SvLDImGM4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DF2SvLDImGM4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FF2SvLDImGM4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d91a02f273af3824922d41b4ba60cde/href">https://medium.com/media/1d91a02f273af3824922d41b4ba60cde/href</a></iframe><p><a href="https://www.youtube.com/@hafifprogramming">hafif programming</a> kanalını ve hafif üsluplarıyla (kendi deyimleri) <a href="https://ozgurakgun.github.io/">Özgür</a> ve <a href="https://gorkempacaci.com/">Görkem</a> beyleri dinlemenizi, izlemenizi ve beğenmenizi şiddetle tavsiye ediyorum.</p><p>Dönelim konumuza, biz bu Hash’i neden tuzlarız?</p><h4>Salting</h4><p>Madem veritabanı kaptırmaktan yola çıktık oradan da gidelim. Diyelim ki 100&#39;lerce kullanıcısı olan bi veritabanınız var. Bu veritabanının da 3–4 ortamı var. Bunlar prod, pre-prod, test ve dev. Siz de düzenli aralıklarla prod veritabanı ile diğer veritabanlarını eziyorsunuz. Bu durumda diğer veritabanlarını prod ortamı koruduğunuz gibi korumuyorsanız zaten büyük bir güvenlik zafiyeti.</p><p>Örnek o ya bir güvenlik zafiyeti de bizden olsun dev ve test ortamları geliştiriciler ve analistler için kolaylaştırılmış bir yapıda ve bütün kullanıcıların şifreleri aynı. Artık bu şifreler veritabanında Hash’li bile olsa büyük bir güvenlik zafiyeti. Çünkü bir kişinin bile şifresi öğrenilirse bütün şifreler ve dolayısı ile bütün Hash’ler aynı olacağını için veritabanına giren kişi bütün kullanıcıların tek bir şifre ile yönetildiğini anlar.</p><p>İşte tam bu anda için işine <strong>Salted Hash</strong> giriyor. Biz bu dataları en başta veritabanına yazarken önce tuzlayıp sonra Hash’leyeceğiz.</p><p>Peki nasıl yapacağız?</p><p>Bunun birçok yolu var bunlardan biri, her bir kullanıcı için belli uzunlukta rastgele bir kelime oluşturmak. Oluşturulan kelimeyi şifrenin önüne, arkasına yada ortasına ekleyip şifreyi öyle Hash’lemek. Artık bütün şifreler aynı bile olsa veritabanında hepsinin Hash’li hali farklı şekilde tutulacak. Buradaki kritik olay oluşturulan rastgele kelimeyi de farklı bir tabloda saklamak. Veritabanını çalan kişi bu kelimeyi bulsa bile tuzlama algoritmasına sahip olmayacağız için şifreyi güvende tutma işini büyük ölçüde artırmış oluruz.</p><p>Peki ya biberleme?</p><h4>Peppering</h4><p>Örneğimizle devam edelim. Dedik ya tuzlama yöntemi ile güvenliği büyük ölçüde artırıyoruz. Peki nasıl daha fazla artırabiliriz güvenliği?,</p><p>Kaynak koda sabit bir değer ekleyerek. Yani Hash’e biber ekerek. Şu şekilde açıklayayım.</p><p>Kaynak kodumuzu veritabanımızla aynı yerde tutmadığımız senaryoda veritabanı kaptırılırsa sadece veriler gider. Biz bu şifrelere önce rastgele bir kelime ekliyoruz. Sonra Hash’liyoruz. Ancak şifrelediğimiz kelimeyi de aynı veritabanında saklıyoruz. Ancak şifre veritabanına gitmeden önce kaynak kodda sabit bir kelime eklesek ve bu sabit kelimeyi hiçbir zaman veritabanına kaydetmezsek eğer, şifre biberlenmiş ve Hash’lenmiş oluyor.</p><p>Hem tuzlayıp hem biberlediğimiz Hash tadından yenmez :d</p><p>Kısaca Hash’in tuzu ve biberi böyle. O kadar tuz biber dedik madem yazıyı tuz biber olmadan bitirmeyelim. Sevgiyle…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeXiLVY8tzxM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FeXiLVY8tzxM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeXiLVY8tzxM%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cbc68460da71496624e228cba15c9bd/href">https://medium.com/media/6cbc68460da71496624e228cba15c9bd/href</a></iframe><h3>Referanslar :</h3><p><a href="https://www.42kraft.com/post/hashing-salt-ve-pepper-nedir">42kraft | Büyüme Odaklı Dijital Ajans</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7540c179ca9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empowering New Beginners: Essential Tips for Starting Your Software Development Journey]]></title>
            <link>https://taylancanh.medium.com/empowering-new-beginners-essential-tips-for-starting-your-software-development-journey-a282b19cdd58?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a282b19cdd58</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[building-project]]></category>
            <category><![CDATA[developer-community]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[beginner-coding]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Fri, 09 Jun 2023 20:45:35 GMT</pubDate>
            <atom:updated>2023-06-09T20:45:35.575Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong></p><p>Embarking on a software development journey can be both exciting and overwhelming for beginners. With numerous programming languages, frameworks, and tools to choose from, it’s important to have a clear roadmap to navigate this vast and ever-evolving field. In this article, we will explore ten essential steps that will empower new beginners and set them on the path to success in their software development journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*dDF5yOGIrYU2zI28muP9HQ.png" /></figure><p><strong>Define Your Goals:<br></strong>Start by defining your goals and aspirations in software development. Determine the specific areas you want to specialize in, such as web development, mobile app development, or data science. Having a clear vision will guide your learning process and keep you motivated.</p><p><strong>Choose a Programming Language:</strong><br>Research and choose a programming language that aligns with your goals. Popular choices include .Net, Python, JavaScript and Java. Consider factors like community support, job opportunities, and learning resources when making your decision.</p><p><strong>Learn the Fundamentals:</strong><br>Master the fundamental concepts of programming, including variables, data types, control structures, and algorithms. Online tutorials, coding bootcamps, and interactive platforms like Udemy can provide a structured learning experience.</p><p><strong>Practice Regularly:</strong><br>Consistency is key in software development. Dedicate regular time to coding and solving programming challenges. Building a strong foundation through consistent practice will accelerate your learning curve.</p><p><strong>Join Developer Communities:</strong><br>Engage with developer communities online and offline. Participate in forums, attend meetups, and join social media groups dedicated to your chosen programming language. Networking with experienced developers can provide valuable insights and opportunities.</p><p><strong>Build Projects:</strong><br>Put your knowledge into practice by building real-world projects. Start with small, manageable projects and gradually increase their complexity. This hands-on experience will solidify your understanding and showcase your skills to potential employers or clients.</p><p><strong>Version Control with Git:</strong><br>Learn the basics of version control using Git. Version control systems like Git allow you to track changes, collaborate with others, and revert to previous versions of your code. Platforms like GitHub provide a platform to showcase your projects and collaborate with other developers.</p><p><strong>Embrace Continuous Learning:</strong><br>Software development is a rapidly evolving field. Stay updated with the latest industry trends, new technologies, and best practices. Follow influential blogs, subscribe to developer newsletters, and explore online learning platforms like Udemy or Coursera for continuous learning.</p><p><strong>Collaborate on Open Source Projects:</strong><br>Contribute to open source projects to enhance your skills and gain exposure to collaborative development workflows. Open source projects offer opportunities to work with experienced developers and make a meaningful impact on real-world software.</p><p><strong>Build a Portfolio and Seek Feedback:</strong><br>Create an impressive portfolio showcasing your projects, code samples, and contributions. Share your portfolio with peers, mentors, and potential employers to seek constructive feedback. Continuous improvement based on feedback will help you refine your skills and stand out in the competitive job market.</p><p><strong>Conclusion:</strong></p><p>Starting a software development journey can be challenging, but by following these ten essential steps, new beginners can empower themselves and accelerate their growth in the field. Remember to set clear goals, practice consistently, engage with the developer community, and never stop learning. Embrace the journey, overcome obstacles, and unleash your full potential as a software developer. The world is waiting for your innovative solutions and contributions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a282b19cdd58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create and Use a Database with SQL Commands 2]]></title>
            <link>https://taylancanh.medium.com/create-and-use-a-database-with-sql-commands-2-4c95ee9cf953?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c95ee9cf953</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[mssql]]></category>
            <category><![CDATA[sql-command]]></category>
            <category><![CDATA[sql-queries]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 18:48:25 GMT</pubDate>
            <atom:updated>2022-09-30T18:48:25.257Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone. We continue with my second article on SQL commands. If you haven’t read my first article, you can find it here:</p><p><a href="https://taylancanh.medium.com/create-and-use-a-database-with-sql-commands-d0467c18e1f0">Create and Use a Database with SQL Commands</a></p><p>Let’s continue where we left off. We will continue with ready-made functions in this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*iIkBjRfg8P34Gn0EIEAT5w.png" /></figure><h4>Count</h4><p>The ‘Count()’ function returns the total number of records in the specified field or table.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Count(*) From Student</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*SKLd4GGULl6efzu1qeL_IQ.png" /></figure><p>We have 4 students. By the way, as you can see, since count is a special function, SQL showed the result in its own table. In such cases, we need to name the table title.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Count(*) as ‘Total Student’ From Student</blockquote><p>We used the “as” keyword for naming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*Joql_4bU8vdiAnlyhmr0Pg.png" /></figure><h4>Sum</h4><p>The sum of the values in the specified field is obtained with the ‘Sum()’ function.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Sum(Exam1) as ‘Total Point’ From ResultsOfExam</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/172/1*GMDPD8jdARC6SOw5c1QJ5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*0ISXtUNIvXPPBtPSonAERg.png" /></figure><p>It adds up all the values in that column.</p><h4>Avg</h4><p>The average of all values in that column is obtained with the ‘Avg()’ function.<br><strong>It can only be used in numeric fields.</strong></p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Avg(Exam1) as ‘Avg Point’ From ResultsOfExam</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/167/1*qIhTY11Msh2PTTBoMO_uCA.png" /></figure><h4>Max</h4><p>The ‘Max()’ function returns the biggest value in the specified field.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Max(Exam1) as ‘Max Point’ From ResultsOfExam</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/175/1*7MQnEerD-rXPlbqmFDnDWw.png" /></figure><h4>Min</h4><p>The ‘Min()’ function returns the smallest value in the specified field.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Min(Exam1) as ‘Min Point’ From ResultsOfExam</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/165/1*43Qg5ayNWgvBOklXt7T5ng.png" /></figure><h4>Group By</h4><p>The ‘Group By’ statement groups rows that have the same values into summary rows.</p><p>To better understand the ‘Group By’ command, let’s add a few more records to our database first.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>INSERT INTO student (First_Name,Last_Name,Phone,School_Number)</blockquote><blockquote>VALUES</blockquote><blockquote>(‘Kerem’,’Üzer’,’+905354773417&#39;,212120023),</blockquote><blockquote>(‘Asiye’,’Ekici’,’+905432241694&#39;,212120025),</blockquote><blockquote>(‘Beyza Nur’,’Ekici’,’+905558030023&#39;,212120027),</blockquote><blockquote>(‘Ali’,’Nalcı’,’+905442167812&#39;,212120029);</blockquote><p>Now let’s find out how many of our students have the same last name.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Last_Name,count(*) as ‘Total’ from Student group by Last_Name</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*k61jwOMWIcGaNS2rnH_bAQ.png" /></figure><p>As you can see, two people have the same last name, while the others have different surnames.</p><p>Finally, let’s compare the first names of the students.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select First_Name as ‘First Name’,count(*) as ‘Total’ from Student group by First_Name</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*Ut5kyUegqxa6scgFoDd0qQ.png" /></figure><h4>Having</h4><p>If a condition needs to be used, the ‘Having’ command is used after using the ‘Group By’ command.</p><p>The ‘where’ condition is not used after the ‘Group By’ command.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select First_Name as ‘First Name’,count(*) as ‘Total’ from Student group by First_Name Having count(*)=1</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*_j3HrKKCUvMi2feNQqusLg.png" /></figure><h4>Like</h4><p>The ‘like’ command checks if an expression contains only the value we want.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select * from Student where First_Name Like ‘%a%’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*PAMK56jngX05uxw63D5tIQ.png" /></figure><h4>Distinct</h4><p>The ‘distinct’ statement is used to return only distinct (different) values.</p><p>Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*a3mHHuQ4RZsf037bg7Q31g.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select First_Name From Student</blockquote><p>As you can see, there are 2 names of Ali.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*h3g8CvWPzaSRAZ-J1j1XuA.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select distinct First_Name From Student</blockquote><p>When using the Distinct command, it brings up only one.</p><p>In the meantime, we can also learn how many different names there are in total with the Distinct command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*rjazsxhrLk5O9yNTvDx7Ew.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select Count(Distinct(First_Name)) From Student</blockquote><h4>Order By</h4><p>The ‘Order By’ command is used to sort the result-set in ascending or descending order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*jPc0NBJ0iCzvkONgm-EQ4Q.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select * from Student order by First_Name</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*nXXnWjRUufLjOQI_OZxPCw.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select * from Student order by First_Name desc</blockquote><h4>Top</h4><p>The ‘Top’ command is used to specify the number of records to return.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*MYoGUL60S-qD-mZARvFU9w.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select top 4 * From Student</blockquote><h4>In</h4><p>The ‘In’ command allows you to specify multiple values in a ‘where’ clause.</p><p>The ‘In’ command is a shorthand for multiple ‘Or’ conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*qzgONcMUCcb1RaFVbbGJ_w.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select * From Student where First_Name in (‘Mesut’,’Hakan’,’Asiye’)</blockquote><h4>Between</h4><p>The ‘Between’ command selects values within a given range. The values can be numbers, text, or dates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*EMGpXxkQEJQSgFz9wbMTCw.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Select * From Student where First_Name between ‘A’ and ‘K’</blockquote><p>I will write a few more articles about SQL and go step by step.</p><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c95ee9cf953" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create and Use a Database with SQL Commands]]></title>
            <link>https://taylancanh.medium.com/create-and-use-a-database-with-sql-commands-d0467c18e1f0?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0467c18e1f0</guid>
            <category><![CDATA[sql-server]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[sql-command]]></category>
            <category><![CDATA[sql-queries]]></category>
            <category><![CDATA[mssql]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Sun, 31 Jul 2022 17:03:17 GMT</pubDate>
            <atom:updated>2022-07-31T17:03:17.661Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey everyone. In this article we are going to learn how to create and use a database with SQL commands. I am going to do this processes with MSSQL. Let’s start.</p><p>First of all, SQL Server and Management Studio must be installed on your computer. After open the SSMS, you will be greeted with a screen like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmmNe8FhDPeVj-bVg8V2dA.png" /></figure><p>In this part, we connect to SQL Server. We will connect to the SQL Server you downloaded on your own computer. After connecting to SQL Server, we first open a new query from the option in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*L6ifHQFTxQfFhHnbF9iNDQ.png" /></figure><p>After this point, we can write and run our queries on the white page that appears.</p><h4>Create Database</h4><blockquote>CREATE DATABASE School;</blockquote><p>First, let’s create a database. We will examine our example through the school database.</p><h4>Create Tables</h4><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>CREATE TABLE Student(</blockquote><blockquote>Id INT PRIMARY KEY IDENTITY (1, 1),</blockquote><blockquote>First_Name VARCHAR (50) NOT NULL,</blockquote><blockquote>Last_Name VARCHAR (50) NOT NULL,</blockquote><blockquote>School_Number INT,</blockquote><blockquote>Phone VARCHAR(20)</blockquote><blockquote>);</blockquote><blockquote>CREATE TABLE Lesson(</blockquote><blockquote>Id INT PRIMARY KEY IDENTITY (1, 1),</blockquote><blockquote>Lesson_Name VARCHAR(20)</blockquote><blockquote>);</blockquote><blockquote>CREATE TABLE ResultsOfExam(</blockquote><blockquote>Id INT PRIMARY KEY IDENTITY (1, 1),</blockquote><blockquote>Student_Id INT NOT NULL,</blockquote><blockquote>Lesson_Id INT NOT NULL,</blockquote><blockquote>Exam1 INT NOT NULL,</blockquote><blockquote>Exam2 INT NOT NULL,</blockquote><blockquote>Exam3 INT NOT NULL,</blockquote><blockquote>Average INT NOT NULL,</blockquote><blockquote>Statu VARCHAR(20)</blockquote><blockquote>);</blockquote><p>After created the database, we create the tables. At this stage, we use the <strong>Use [db.Name]</strong> and <strong>Go </strong>commands to create the tables in the correct database, and we can also choose the correct database from the “Avaible Databases” Combobox in the upper left.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*6hkIAWYagHD_cOwmeaEoFg.png" /></figure><p>Now that we have created the tables, we can start data entry.</p><h4><strong>Insert Into Values</strong></h4><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>INSERT INTO student (First_Name,Last_Name,Phone,School_Number)</blockquote><blockquote>VALUES</blockquote><blockquote>(‘Ali’,’Yunus’,’+905435411421&#39;,212120015),</blockquote><blockquote>(‘Mesut’,’Tufan’,’+905318548914&#39;,212120019),</blockquote><blockquote>(‘Hami’,’Takoz’,’+905179653711&#39;,212120011),</blockquote><blockquote>(‘Hakan’,’Demirel’,’+905466635443&#39;,212120021);</blockquote><p>We create the above query by using the <strong>INSERT INTO</strong> and <strong>VALUES </strong>commands together to add data to our tables.</p><h4>Alter table</h4><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Alter Table Lesson</blockquote><blockquote>add limit smallint</blockquote><p>Let’s assume that there is a missing column in our table. In this case, this is the query we will use to add the column.</p><p>By the way, we noticed that we wrote the column name wrong. Let’s fix it now.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>EXEC SP_RENAME ‘Lesson.limit’ , ‘Limit’, ‘COLUMN’</blockquote><p>If we want to delete the Limit column, we use the Drop command.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Alter Table Lesson</blockquote><blockquote>Drop Column Limit</blockquote><h4>Commands</h4><p>Now that we have created the database and tables, we can come to our commands.</p><p>DDL or Data Definition Language actually consists of the SQL commands that can be used to define the database schema.</p><p>The SQL commands that deals with the manipulation of data present in the database belong to DML or Data Manipulation Language and this includes most of the SQL statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*ufspC_YEW9I3wqm17Kz1fA.png" /></figure><p>We talked about all of the DDL commands except the truncate command. Let’s talk about Truncate and move on to DML commands.</p><h4>Truncate</h4><p>Truncate command deletes all data in the table.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Truncate Table Lesson</blockquote><h3>DML Commands</h3><h4>Select</h4><p>The SELECT command is used to get the desired row values from one or more tables in a database.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>SELECT * FROM Student</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*BTsuFbT2YnJS3AdZ4XwCsg.png" /></figure><p>If you put <strong>*</strong> after the select, you call the whole table. <strong>From</strong> is a keyword we use to specify the table we will use.</p><p>If we specify the name of the columns we want instead of <strong>*</strong>, it will create a result grid according to the columns we want and present it to us.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>SELECT First_Name,Last_Name FROM Student</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*c-sp8OCWCzhVAwN2-ONX0g.png" /></figure><p>Another use of select is its conditional use.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>SELECT * FROM Student where First_Name=’ali’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*MEdVWSZ68qgdpPmvFKJE-w.png" /></figure><h4>Insert Into</h4><p>We already used the Insert Into command above to insert data into the tables when we first created the database. Let’s use Insert Into again to test other commands.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>INSERT INTO lesson (Lesson_Name)</blockquote><blockquote>VALUES</blockquote><blockquote>(‘Math’),</blockquote><blockquote>(‘Literature’),</blockquote><blockquote>(‘Physics’),</blockquote><blockquote>(‘Geometry’);</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*-RjFxPMQwzrINiQGaZmMVQ.png" /></figure><h4>Delete</h4><p>We use the DELETE command to delete the data in the table.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Delete From lesson</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*mY2PTN9qj3048JvLzROlTg.png" /></figure><p>If you do not use the Delete command with the Where condition, you will delete the entire table. Now let’s create the table again and delete the records one by one.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>INSERT INTO lesson (Lesson_Name)</blockquote><blockquote>VALUES</blockquote><blockquote>(‘Math’),</blockquote><blockquote>(‘Literature’),</blockquote><blockquote>(‘Physics’),</blockquote><blockquote>(‘Geometry’);</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*zWbh5MlkVouYa1DzfjkqiA.png" /></figure><p>As you can see the id information has been reassigned.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Delete From Lesson where id=12</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*yc8Gz2HFqfLAcgr-yOpqsw.png" /></figure><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Delete From Lesson where Lesson_Name=’Physics’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*GV0INnjgtqvHghifYWXVhg.png" /></figure><h4>Update</h4><p>We use the UPDATE command to update the data in the table. The most important thing about the update command is that you should never use it without a where condition.</p><p>Now let’s check what happens if we don’t use where command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*5KQsYsIA2ZWWuf-IyYDb0w.png" /></figure><p>Let’s update Mesut Tufan’s surname as Turan.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Update Student Set Last_Name = ‘Turan’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*GiAsn0gkEw3IRXSj8ibBgQ.png" /></figure><p>It updated the whole table because we didn’t add the where condition to our command. If you don’t have a backup, it can be a big disaster for you. Never do this.</p><p>We’re updating them one by one to fix it.</p><blockquote>USE [School]</blockquote><blockquote>GO</blockquote><blockquote>Update Student Set Last_Name = ‘Yunus’ where First_Name=’Ali’</blockquote><blockquote>Update Student Set Last_Name = ‘Takoz’ where id=3</blockquote><blockquote>Update Student Set Last_Name = ‘Demirel’ where First_Name=’Hakan’</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*zyp_JD-Dixgep6AmBl0-ug.png" /></figure><p>As you can see, if the where condition is not used during the update process, the whole table is affected and it is very difficult to return.</p><p>I will write a few more articles about SQL and go step by step.</p><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0467c18e1f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object Relational Mapping]]></title>
            <link>https://taylancanh.medium.com/object-relational-mapping-2cee3ef493e?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cee3ef493e</guid>
            <category><![CDATA[dapper]]></category>
            <category><![CDATA[entity-framework]]></category>
            <category><![CDATA[orm]]></category>
            <category><![CDATA[object-relational-mapping]]></category>
            <category><![CDATA[adonet]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Sat, 11 Jun 2022 18:59:04 GMT</pubDate>
            <atom:updated>2022-06-11T18:59:04.590Z</atom:updated>
            <content:encoded><![CDATA[<p>When developing a project, there are many ways to manage the project’s database connections and processes. However, many of these methods are new and slower than the old ones. Therefore, these methods should be learned well and the appropriate one should be used.</p><p>First of all, if newer ones are slower, why do we use them? Because they are more readable and away from clutter. Now let’s briefly look at new and old technologies and compare them.</p><blockquote>Legacy technology : Ado.Net<br>New technology : ORM</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*lW-1gC1fSEY9PLkY7n1BmA.png" /></figure><h4>Ado.Net</h4><p>Ado.Net, which stands for “ActiveX Data Objects.NET”, was made by Microsoft to act as a bridge between the applications and databases. Adding, deleting, updating and listing operations can be done in the database by writing SQL queries and commands to the application.</p><h4>ORM</h4><p>ORM is a technique that can access the database, make changes to the data and make queries using object-oriented programming languages. The ORM technique, which is a layer between the database and the project, actually serves the SOLID principles by separating the two jobs.</p><p>Another advantage of using the ORM technique is to make the database independent. Of course, this may vary depending on the ORM technique to be used, but you can easily switch between databases according to the ORM technique you will use.</p><p>Another important point for ORM technique is libraries. When using Ado.Net, the library is not used, but ORM techniques must be used with libraries. These libraries may vary depending on the language you use and the ORM technique.</p><p>There are many ORM techniques by language:</p><blockquote>C#: Entity Framework, Dapper, ECO, XPO, Norm</blockquote><blockquote>Java: Hibernate, Ebean, Torque, JPA, MyBattis</blockquote><blockquote>Php: CakePHP, Codelgniter, RedBean, Doctrine, Propel, PdoMap</blockquote><blockquote>Python: Django, South, Stor</blockquote><blockquote>NodeJs : Sequelize</blockquote><p>Now examine two of these techniques.</p><h4>Dapper</h4><p>Actually, Dapper is not directly an ORM technique. Dapper is a micro ORM technique. This is because Dapper does not do any mapping or configuration settings in the background. For this reason, it has passed as a lightweight micro ORM technique. It was developed by the StackOverflow team and is published as open source on Github.</p><h4>Entity Framework</h4><p>Entity Framework (EF) uses Ado.Net infrastructure. It contains the UnitOfWork design pattern. UnitOfWork ensures that these transactions are performed collectively through a single channel, instead of instantaneously reflecting every change made to the database.</p><p>With Entity Framework, you can develop projects using 4 different methods.<br>These methods are;<br>• Model First (Creating a New Database with Visual Studio)<br>• Database First (Using Existing Database)<br>• Code First (By Writing New Database Code)<br>• Code First(Using Existing Database</p><h4>Entity Framework vs Dapper</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*GeUJMkJ85J1MzPwu0ZAAvQ.png" /><figcaption>Famous image comparing ORMs and Ado.Net</figcaption></figure><p>First of all, when compared to the performance difference in this classic image, Dapper is much faster than Entity Framework. This speed is close to Ado.Net but should not be compared only in terms of performance.</p><p>From another point of view, code readability and developability. In this part, Entity Framework reveals the difference. Entity Framework, which completely abstracts us from SQL commands, closes the performance gap here.</p><blockquote>Dapper Codes :</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfab15c80d03cce91cecd61005708b56/href">https://medium.com/media/cfab15c80d03cce91cecd61005708b56/href</a></iframe><blockquote>Entity Framework Codes :</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/636a2b236591ad0458b06edcea01d688/href">https://medium.com/media/636a2b236591ad0458b06edcea01d688/href</a></iframe><p>These are the main differences between these two ORM methods, which can be compared in many ways. <strong>Performance and Readability.</strong></p><p>Referances :</p><ul><li><a href="https://caylakyazilimci.com/post/object-relational-mapping-orm-nedir">Object Relational Mapping (ORM) Nedir?</a></li><li><a href="http://www.sercangulgeze.com.tr/ado.net-nedir-nasil-kullanilir.html">Ado.Net Nedir?</a></li><li><a href="https://www.borakasmer.com/dapper-nedir/">Dapper Nedir?</a></li><li><a href="https://medium.com/kariyertech/dapper-vs-entity-framework-bb1570f6573b">Dapper vs. Entity Framework</a></li></ul><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cee3ef493e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scoped, Transient and Singleton]]></title>
            <link>https://medium.com/turkcell/scoped-transient-and-singleton-e6c4f8811b52?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6c4f8811b52</guid>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[dependency-inversion]]></category>
            <category><![CDATA[singleton]]></category>
            <category><![CDATA[scoped]]></category>
            <category><![CDATA[transient]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Sat, 30 Apr 2022 16:53:21 GMT</pubDate>
            <atom:updated>2022-09-08T06:43:48.444Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*sw-qD7KejceFttN7logN-w.png" /></figure><p>Hey everyone. In this article, I am going to talk about Scoped, Transient and Singleton. Let me first talk about what they are. These are three different lifetime options of the Dependency Injection technique that comes with ASP .NET Core. Now let’s examine each one one by one. Then let’s develop a project to learn better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*eQjyva0NPFrFajInkZDfqQ.png" /></figure><h4>Scoped</h4><p>It creates an instance in the first request created and that instance is used until a new request arrives. For example, it created an instance while creating the page you are viewing. Then you refreshed that page. Now creates a new instance.</p><h4>Transient</h4><p>I want to start with a common phrase for transient services, “If in doubt, make it transient”. Transient services create a new instance on each request. In this way, they are the least binding service. It is almost similar to creating an instance of the same type using “new” keyword and using it.</p><h4>Singleton</h4><p>An instance is created as soon as the application is launched and the same instance is used until the application is closed. One can think of a Singleton service as a kind of “static” types which are instantiated only once and are reused for all times. In web terms, it means that after the initial request of the service, every subsequent request will use the same instance.</p><h4>Example Project</h4><p>Now let’s create our project.</p><p>First, we created the services and wrote our guid functions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/273bc1199c8e511c76b76b5048f29ad1/href">https://medium.com/media/273bc1199c8e511c76b76b5048f29ad1/href</a></iframe><p>Then we defined them in HomeController and created our instances.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/716816ce7710dbe5b016bff032dd980e/href">https://medium.com/media/716816ce7710dbe5b016bff032dd980e/href</a></iframe><p>Lastly View</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77bca6bd1c97aabf7c3a758aaf8c926d/href">https://medium.com/media/77bca6bd1c97aabf7c3a758aaf8c926d/href</a></iframe><p>Let’s run the project and see the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*9wTsfLVxrPJAdUy35t30kA.png" /><figcaption>Run</figcaption></figure><p>As we saw in our first output, Transient produced 2 different Guids. Singleton and Scoped projected the same Guids to the screen. If we refresh our page at this point, we can understand how the Scoped service works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*A0URdQWHnRzpwNY6gskWCg.png" /><figcaption>Refresh</figcaption></figure><p>Yes, as you can see, Scope has created new Guids. Singleton stored the same Guids in memory and gave them back to us. Transient, on the other hand, created new Guids each time.</p><p>I tried to tell you about Scoped, Transient and Singleton, I hope it was useful.</p><h4>References</h4><ul><li><a href="https://dotnetcoretutorials.com/2017/03/25/net-core-dependency-injection-lifetimes-explained/">.NET Core Dependency Injection Lifetimes Explained - .NET Core Tutorials</a></li><li><a href="https://referbruv.com/blog/posts/exploring-aspnet-core-fundamentals-understanding-singleton-transient-and-scoped-service-lifetimes">Service Lifetimes in ASP.NET Core DI Explained</a></li></ul><h4>Contact</h4><p><a href="https://www.linkedin.com/in/taylancan/">Taylan Can H. - Software Engineer - Atmosware | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6c4f8811b52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/turkcell/scoped-transient-and-singleton-e6c4f8811b52">Scoped, Transient and Singleton</a> was originally published in <a href="https://medium.com/turkcell">turkcell</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Factory Pattern]]></title>
            <link>https://taylancanh.medium.com/factory-pattern-7e66151377e7?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e66151377e7</guid>
            <category><![CDATA[singleton-pattern]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[factory-design-pattern]]></category>
            <category><![CDATA[factory-pattern]]></category>
            <category><![CDATA[factory]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Thu, 14 Apr 2022 10:31:32 GMT</pubDate>
            <atom:updated>2022-04-14T10:31:32.347Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*EbmFHEa6uLf9KCy9TQIIBg.jpeg" /></figure><p>Hey everyone. In this article, I am going to talk about Factory Patterns. Firstly, we know that patterns are created for a problem. <strong>So why was the Factory Pattern created?</strong> Where do we use it? Here we go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*m1t0lIgxMsUptg0FaC0WnQ.gif" /><figcaption><strong>Education factory from Pink Floyd</strong></figcaption></figure><p>The Factory Pattern is in the Creational Patterns Group. It is currently one of the preferred Design Patterns in the industry. The best way to explain the purpose of Factory Pattern is to give an example.<strong> Each pattern is found for a problem, let’s know the problem first.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*o03rN4lfG2heaKMWOCBadw.jpeg" /></figure><p>Imagine you have an E-Commerce site. You are only selling computers here. That’s why your whole project runs on the computer class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c311009c547e84f2cbaa008e87e3bcf1/href">https://medium.com/media/c311009c547e84f2cbaa008e87e3bcf1/href</a></iframe><p>After that, your sales grew and Apple told you it wanted to sell their phones on your site. It’s a great news. So how do you make the class structure? You wrote the project just to sell computers. It’s the time to use Factory Pattern.</p><p>First we create an abstract sales class and implement computer and phone classes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/231a184d88f309c6feee81d5c9c4dd7c/href">https://medium.com/media/231a184d88f309c6feee81d5c9c4dd7c/href</a></iframe><p>Then, let’s create the Creator class, which will generate objects from these classes, and define our method that will perform the Factory operation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9d997f15de02a050e88986b08f54b0a/href">https://medium.com/media/e9d997f15de02a050e88986b08f54b0a/href</a></iframe><p>By the way, we create an Enum named Sales for the products we will sell.</p><p>Finally, we create the objects.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fcb984fff353599627d4d24c925201f8/href">https://medium.com/media/fcb984fff353599627d4d24c925201f8/href</a></iframe><p>Congrats. You fixed your project. You can sell anything, anymore.</p><h4><strong>In summary:</strong></h4><p>The program you are writing may also have more than one class similar to each other. They have designed such a pattern so that we do not use the new operator every time when creating such classes, or write code from those classes as if they are independent from each other.</p><blockquote>You can find my other Design Pattern articles here :</blockquote><ul><li><a href="https://taylancanh.medium.com/design-patterns-18a4a936a803">Design Patterns</a></li><li><a href="https://taylancanh.medium.com/singleton-pattern-f5e4c2e1842e">Singleton Pattern</a></li></ul><h4>Referanceses :</h4><ul><li><a href="https://www.turkayurkmez.com/abstract-factory-design-pattern/">Abstract Factory Design Pattern - Türkay Ürkmez</a></li><li><a href="https://kerteriz.net/factory-method-fabrika-tasarim-deseni/">Factory Method - Fabrika Tasarım Deseni</a></li></ul><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e66151377e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Singleton Pattern]]></title>
            <link>https://taylancanh.medium.com/singleton-pattern-f5e4c2e1842e?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5e4c2e1842e</guid>
            <category><![CDATA[singleton-design-pattern]]></category>
            <category><![CDATA[singleton-pattern]]></category>
            <category><![CDATA[singleton]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[patterns]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Thu, 31 Mar 2022 18:54:00 GMT</pubDate>
            <atom:updated>2022-03-31T18:57:24.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*2G5AUpeHwn1TnolsWHHsKw.jpeg" /></figure><p>Hey everybody I’ll explain the Singleton pattern, which is one of the most preferred design patterns in the industry. <strong>Singleton design pattern guarantees that only 1 object is created at runtime.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GwuL7GQG-jdhbx5495efRg.png" /></figure><p>All patterns are a solution to a problem. They were created for problems. So first we need to know what the problem is. The Singleton Pattern is needed when only one object is required for the entire application. <strong>Why do we need only one object in the whole application?</strong></p><p>If the operations of an object change only depending on the parameters, it is pointless to produce several of that object. Each produced object occupies a place in memory.</p><p>For these reasons, we need Singleton Pattern. Let’s look at the sample project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/97381f49e101971be872beefc2b5e1e0/href">https://medium.com/media/97381f49e101971be872beefc2b5e1e0/href</a></iframe><p>Firstly, we created a class called Singleton. The Singleton should always be a ‘sealed’ class to prevent class inheritance through external classes and also through nested classes. In addition, we create a private constructor and prevent the creation of new instances with new.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9911c578591bcb90d157511edee9c21e/href">https://medium.com/media/9911c578591bcb90d157511edee9c21e/href</a></iframe><p>In Program.cs, we can test whether our project works in accordance with the Singleton Pattern. If the Instances we have created are different from each other, it means that we have made a mistake somewhere. But if you try, you will find that they always turn out to be equal to each other.</p><h4>References</h4><p><a href="https://www.turkayurkmez.com/singleton-design-pattern/">Singleton Design Pattern - Türkay Ürkmez</a></p><h4>Contact me :</h4><p><a href="https://www.linkedin.com/in/taylancan/">Taylan Can H. - Software Engineer - Atmosware | LinkedIn</a></p><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5e4c2e1842e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns]]></title>
            <link>https://taylancanh.medium.com/design-patterns-18a4a936a803?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/18a4a936a803</guid>
            <category><![CDATA[creational-patterns]]></category>
            <category><![CDATA[patterns]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[structural-patterns]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Thu, 17 Mar 2022 12:29:27 GMT</pubDate>
            <atom:updated>2022-03-17T12:29:27.605Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*mYrmPsJdIlRrWUmCThLV7g.jpeg" /></figure><p>Firstly <strong>what are these patterns</strong>? These patterns are not algorithm or code blogs. <strong>Design patterns are solutions to common problems software developers face during software development. </strong>These patterns were found by trial and error after long processes. After that developers gave names to these problems.</p><p>The design pattern phrase originated almost 30 years ago. Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides, known as Gang of Four (GOF), published a book called Design Patterns — Elements of Reusable Object-Oriented Software and introduced the concept of design patterns in software for the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*IPlCK-TDHNRJm_f5UT91lA.jpeg" /></figure><p>There are only 23 design patterns in the book but now there are many more. Also everybody can create a new design pattern but another purpose about design patterns is to be unifying. So you need design patterns to speak the common language with other software developers.</p><blockquote>Patterns are divided into 3 in this book :</blockquote><h4>1) Creational Patterns</h4><p>This design pattern provides alternative solutions to creating objects from classes by hiding the object creation logic instead of creating objects directly using the new operator. This provides flexibility and convenience in creating whatever object is needed in the program flow.</p><ul><li>Singleton Pattern</li><li>Builder Pattern</li><li>Prototype Pattern</li><li>Factory Pattern</li><li>Abstract Factory Pattern</li></ul><h4>2) Structural Patterns</h4><p>This design pattern provides solutions for arranging the structure of the relationship between objects.</p><ul><li>Proxy Pattern</li><li>Adapter Pattern</li><li>Facade Pattern</li><li>Filter Pattern</li><li>Bridge Pattern</li><li>Flyweight Pattern</li><li>Composite Pattern</li><li>Decorator Pattern</li></ul><h4>3) Behavioral Patterns</h4><p>This design pattern provides solutions for behavior between objects at runtime.</p><ul><li>Chain of Responsibility Pattern</li><li>Command Pattern</li><li>Interpreter Pattern</li><li>Iterator Pattern</li><li>Mediator Pattern</li><li>Memento Pattern</li><li>Observer Pattern</li><li>Null Object Pattern</li><li>Strategy Pattern</li><li>State Pattern</li><li>Visitor Pattern</li></ul><p>Summerly the Design Patterns like that. See you again in my next story.</p><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18a4a936a803" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dependency Inversion Principle]]></title>
            <link>https://taylancanh.medium.com/dependency-inversion-principle-d12edf7a9279?source=rss-a1c390db5f8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d12edf7a9279</guid>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[principles]]></category>
            <category><![CDATA[dependency-inversion]]></category>
            <dc:creator><![CDATA[Taylan Can Hardal]]></dc:creator>
            <pubDate>Sun, 27 Feb 2022 15:30:23 GMT</pubDate>
            <atom:updated>2022-02-27T15:30:23.032Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NfrhBSqxz_EDFUWnwF5Urw.png" /></figure><p>Hey everybody it is fifth and last principle of SOLID Principles. This principle means that a high-level modules should not depend on low-level modules. Both should depend on abstractions. So abstractions should not depend on details. Details should depend on abstractions.</p><p>Let’s say you have a customer and he is a car mechanic. He can change the tires but that’s it. He cannot do anything else. It asks you for a program. You wrote a program and gave it to him. After that it came back to you. He’s making a deal with another auto mechanic. The other guy is an electrician. You have to rewrite the program.</p><h3>Example Project</h3><p>In order to learn in detail, the correct usage and the wrong usage should be examined together.</p><blockquote>Wrong Usage :</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d64cca14faed846cbd5c85f1109be66a/href">https://medium.com/media/d64cca14faed846cbd5c85f1109be66a/href</a></iframe><p>We wrote down the duties of both of our mechanics. We do not have any operational problems at the moment. Our project works without errors. But now, if only one new mechanic is added, we will have to intervene in 3–4 different places in the code. In other words, there are structural errors in our project. Let’s see how it should be.</p><blockquote>Correct Usage :</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93d2d453161103113e8f9b7ee5e4e648/href">https://medium.com/media/93d2d453161103113e8f9b7ee5e4e648/href</a></iframe><p>Now it will be enough to add it into the incoming interface.</p><p>It was the last principle. SOLID principles is over. Thanks for reading.</p><h4>References :</h4><p><a href="https://umayeras.medium.com/solid-prensipleri-dependency-inversion-principle-dip-efea6939e430">SOLID Prensipleri — Dependency Inversion Principle (DIP)</a></p><p>bolŞans…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d12edf7a9279" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>