<?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 Mert Gültekin on Medium]]></title>
        <description><![CDATA[Stories by Mert Gültekin on Medium]]></description>
        <link>https://medium.com/@mertgltekin_58750?source=rss-b4a84fc484b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3qVowK6IuKTNWfOj0uegZQ.jpeg</url>
            <title>Stories by Mert Gültekin on Medium</title>
            <link>https://medium.com/@mertgltekin_58750?source=rss-b4a84fc484b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:17:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mertgltekin_58750/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[Kotlin Flow API]]></title>
            <link>https://medium.com/ibtech/kotlin-flow-api-7e0e455a22d9?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e0e455a22d9</guid>
            <category><![CDATA[kotlin-flow]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[coroutine]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Tue, 19 Apr 2022 11:12:41 GMT</pubDate>
            <atom:updated>2022-04-19T11:12:41.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*bhMPLBHQG2ybes_087tSDg.png" /><figcaption><a href="https://www.raywenderlich.com/">https://www.raywenderlich.com</a></figcaption></figure><p>Merhaba, bu blog yazımızda <strong><em>Kotlin Flow API </em></strong>konusunu kısaca sizlere anlatmaya çalışacağım.</p><p>Flow, Kotlin Coroutine konusu içinde değerlendirmemiz gerken bir yapıdır. Bir flow tipi sıralı olarak birden fazla değeri yayınlayabilen (emit/produce) ve birden fazla asenkron değer döndürebilen yapıdadır. Flow bir diğer deyişle asenkronize olarak hesaplanan “stream of data” yani veri akışıdır. Flow’u veritabanından veri almak veya network çağrıları oluşturmak ve bu verilerin tüketimini main thread’i bloke etmeden yapmak için kullanırız.</p><p>Flow, Iterator’e mantık olarak çok benzemekte ancak Flow yapısı suspend function kullanarak değerleri asenkron olarak üretir ve tüketir. Bunu da yorumlamak gerekirse, Flow ile main thread’i bloklamadan güvenli bir şekilde Coroutine yardımı ile worker thread’ler üzerinden veri akışı sağlamış oluruz.</p><p>Stream of data yapısında 3 tane bileşenden bahsetmemiz mümkün. Bunlar üreticiler (producer), aracılar (intermediaries (opsiyonel)) ve tüketiciler (consumer).</p><ul><li>Üreticiler streame veri eklerler. Flow coroutine’in bir yapısı olduğundan dolayı üretilen bu veriler asenkron olarak da üretilebilmektedir.</li><li>Aracılar ise stream içinde yayınlanan değerlerin her birini veya doğrudan streami değiştirebilir. Ancak opsiyoneldir.</li><li>Tüketici, streamdeki değerleri kullanır.</li></ul><p>Uygulama mimarimizin içinde diyelim ki veriyi göstereceğiz, repository veya data source UI verisinin üreticisi, View ise bu verinin tüketicisi olur. Tam tersi olarak da diyelim ki kullanıcının inputlarını kaydedeceğiz. Buradaki üretici View, Repository ise tüketici konumunda olur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lTU2uxFPaBupYYEKmkxuLQ.jpeg" /></figure><h3>Örnek Flow Mekanizması</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab64d4aa7e51809a066915c584893d90/href">https://medium.com/media/ab64d4aa7e51809a066915c584893d90/href</a></iframe><p>Değerler emit fonksiyonu ile yayınlanır, collect fonksiyonu ile bu yayılım başlar. Flow collect fonksiyonu çağırılmadan çalıştırılmaz.(Cold Stream).</p><p>Kodumuz her bir değeri yazdırmadan önce 100ms main thread’i bloklamadan bekler ve terminale “Bloklanmadım &lt;indis&gt;” yazar.</p><h3>Flow Soğuktur!</h3><p>Flow sequence’ler gibi soğuk akışlardır ve collect edilinceye kadar flow çalışmaz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/860e7d44daa1678ed5b922554eb5969f/href">https://medium.com/media/860e7d44daa1678ed5b922554eb5969f/href</a></iframe><p>Yukarıdaki kod bloğunda görüldüğü gibi flow collect edilmeden başlamadı. Ayrıca birden fazla kez collect edip benzer değerleri alabilmemizde mümkündür.</p><h3>Flow İptali</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25e7394063f573100fd7e91fc7294cd6/href">https://medium.com/media/25e7394063f573100fd7e91fc7294cd6/href</a></iframe><p>Flow’u iptal edebilmemiz de mümkün. Yukarıdaki örnekte flow 250 milisaniyede duracaktır ve yarıda kesilecektir. Dolayısı ile 3 ekrana yazdırılmayacaktır</p><h3>Flow Yaratımı</h3><p>Flowları yaratmak için ibrden fazla yol vardır.</p><p>· <strong>flowOf(…)</strong> fonksiyonu sabit sayıda değer olan flowlar yaratmak için kullanılır.</p><p>· <strong>asFlow()</strong> çeşitli veri tiplerini flowa çevirerek flow yaratır. ((1..3).asFlow().collect { value -&gt; println(value) } integer range’i flow olarak kullanır)</p><p>· <strong>flow {…}</strong> sıralı çağrılarla flowu yayınlamak amacıyla flow oluşturan yaratıcı fonksiyondur</p><ul><li><strong>channelFlow {…}</strong></li></ul><p>· <strong>MutableStateFlow</strong> and <strong>MutableSharedFlow</strong></p><h3>Ara Katman Flow Operatörleri</h3><p>Map, filter, take, zip gibi operatörlerdir. Flow içinde herhangi bir kod yürütmezler veya fonksiyonu askıya (suspend) almazlar. Gelecekteki işlemler için ve onların returnları için ayarlanırlar. Cold Flow Property (Soğuk Akış Özelliği) olarak da bilinir. Upstream flowlara uygulanırlar ve geriye downstream flow döner.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86771f3b6058d570a11ebc76ef7446e4/href">https://medium.com/media/86771f3b6058d570a11ebc76ef7446e4/href</a></iframe><h3>Terminal Flow Operators</h3><p><strong>toList</strong>, <strong>toSet</strong>, <strong>reduce</strong>, <strong>collect</strong>, <strong>fold</strong>, <strong>single</strong>, <strong>launchIn</strong> gibi fonksiyonlardır.Fonksiyonun kendisini askıya(suspend) alabilir. Upstream flowlara uygulanır ve bütün uygulamalar tetiklenir.</p><p>toList ve toSet fonksiyonları flowları collectionlara çevirmemizi sağlar.</p><p>reduce ve fold fonksiyonları flowdaki değerleri tek bir değere çevirir.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69f9f6532b6958015778c6774f562265/href">https://medium.com/media/69f9f6532b6958015778c6774f562265/href</a></iframe><h3>Beklenmedik Exceptionları Yakalamak</h3><p>Exceptionları yakalamak için bir ara katman flow operatörü olan catch kullanılır.</p><blockquote>catch { exception -&gt; notifyError(exception)}</blockquote><p>Exception yakalandıktan sonra flow suspend olur yani durur.</p><h3>Flow Tamamlama</h3><p>Flow normal olarak veya exception vererek bitirilebilir ancak bitirirken bir aksiyon alınması gerekir. Bu Imperative veya Declarative şekilde olabilir.</p><h4>Imperative Finally Block</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fa8a07c993bf84dcb6a249cc2bdbce2/href">https://medium.com/media/7fa8a07c993bf84dcb6a249cc2bdbce2/href</a></iframe><h4>Declarative Finally Block</h4><p>Declarative yaklaşımda, onCompletion ara katman operatörü kullanılır. Bu operatör, flow tamamen tamamlandığında aktifleşir. onCompletion’da flow’un normal bir şekilde mi yoksa exceptionlu bir şekilde mi bitirilebildiğini aşağıdaki örnekte olduğu gibi anlayabiliyoruz. Ancak hatayı bu yapı catch yapısında olduğu gibi fırlatmaz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ca0eab0f716d7f16398225279a001e3/href">https://medium.com/media/7ca0eab0f716d7f16398225279a001e3/href</a></iframe><h3>Referanslar</h3><p><a href="https://developer.android.com/kotlin/flow">https://developer.android.com/kotlin/flow</a></p><ul><li><a href="https://androidtopics.dipien.com/kotlin-flow-all-official-development-resources-32dd4d8132b6">Kotlin Flow [All official development resources]</a></li><li><a href="https://www.raywenderlich.com/9799571-kotlin-flow-for-android-getting-started">Kotlin Flow for Android: Getting Started</a></li><li><a href="https://kotlinlang.org/docs/flow.html">Asynchronous Flow | Kotlin</a></li><li><a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/">Flow</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e0e455a22d9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ibtech/kotlin-flow-api-7e0e455a22d9">Kotlin Flow API</a> was originally published in <a href="https://medium.com/ibtech">IBTech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JAVA 8–9–11]]></title>
            <link>https://medium.com/@mertgltekin_58750/java-8-9-11-1823ea86bc43?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1823ea86bc43</guid>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java11]]></category>
            <category><![CDATA[java-version]]></category>
            <category><![CDATA[java9]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Wed, 08 Sep 2021 18:31:15 GMT</pubDate>
            <atom:updated>2021-09-08T18:31:15.678Z</atom:updated>
            <content:encoded><![CDATA[<h4>Java 8–9–11 Arasındaki Farklar ve Bize Getirdikleri</h4><h4>Java 8 Bize Ne Getirdi</h4><p>Java 8 sürümü Mart 2014&#39;te yayınlanmıştır.</p><p>Java 8 ile birlikte gelen yeni özellikleri genel olarak aşağıdaki şekilde listeleyebiliriz;</p><ul><li><strong>Lambda expressions</strong></li><li><strong>Functional interfaces</strong></li><li><strong>Method references</strong></li><li><strong>Stream API</strong></li><li><strong>Optional class</strong></li><li><strong>Concurrency Enhancements</strong></li><li><strong>Tarih ve Saat API’si</strong></li></ul><p><strong><em>Lambda Expressions</em></strong></p><p>Lambda ifadeleri, herhangi bir class’a ait olmadan iş yapabilen fonksiyonlardır. Lambda ile birlikte Java, funtional programming dünyasına da girmiş bulunmaktadır. Lambda sayesinde hem daha kısa bir kod, hem daha okunabilir kod üretiyor, hem de kod tekrarından kurtuluyoruz. Bir lambda ifadesini tekrar tekrar kullanabilir, parametre olarak başka bir yere iletebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPGLA77iXOk8Rf1U9pzcQw.png" /></figure><p><strong><em>Functional Interfaces</em></strong></p><p>Tek bir abstract(soyut) methodu bulunan interface’ler için kullanılan tanımdır.</p><p>Fonksiyonel Interface’ler genellikle lambda ifadeleri ile birlikte kullanılırlar</p><p><strong><em>Runnable</em></strong>, <strong><em>ActionListener</em></strong>,<em> </em><strong><em>Comparable</em></strong> fonksiyonel Interface’lere örnek verilebilir ve bunlar ön tanımlı fonksiyonel interface’lerdir.</p><p>“@FunctionalInterface” anotasyonu metodun başına konulur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*MDiPUWGEtiCXHW1lzRf27g.png" /></figure><p><strong><em>Method references</em></strong></p><p>Method references da yine lambda ve functional interface özellikleri ile birlikte gelen ve bir arada kullanılabilen özelliklerden biridir.</p><p>Metodları, nesneler veya primitive değerlermiş gibi kullanabilmemizi ve bunları başka bir metoda parametre olarak gönderebilmemizi sağlıyor.</p><ol><li>Reference to a static method.</li><li>Reference to an instance method.</li><li>Reference to a constructor.</li></ol><p>References To Static Method Örneği</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lof8pxEznTrg-VciHgg3WQ.png" /></figure><p><strong>Stream API</strong></p><p>Collection’lar üzerinde filter, forEach, map, count, min/max gibi sık kullanılan çeşitli işlemleri yapmayı çok daha kolay hale getirir</p><p><strong>Optional class</strong></p><p>Null check’lerin daha okunabilir ve kontrol edilebilir olmasını sağlayan Optional yapısı gelmiştir. Objem,izi Optional ile sararak eğer null değilse kullan, null ise başka birşey yap diyebiliyorsunuz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BU4LFgXQ1TwE8v-r1ehfKw.png" /></figure><p><strong>Concurrency Enhancements</strong></p><p>Thread nesneleri oluşturmak ve yönetmek zorunda kalmadan eşzamanlı concurrent/multitasking işlemlerini daha anlaşılır ve kolay kullanılabilir hale getiriyor.</p><p><strong>Tarih ve Saat API’si</strong><br>Bu yeni API, geliştiricilerin tarih ve saati daha doğal, net ve anlaşılması kolay şekilde ele almasına izin vermektedir.</p><h4>Java 9 Bize Ne Getirdi</h4><p>Java 9 bir LTS sürümü değildir. Java 10 ile birlikte desteği sonlanmıştır.</p><p>Java 9 ile birlikte gelen yeni özellikleri genel olarak aşağıdaki şekilde listeleyebiliriz;</p><ul><li><strong>Platform Module System (Project Jigsaw)</strong></li><li><strong>JShell(Java Shell)</strong></li><li><strong>HTTP/2 Client</strong></li><li><strong>Process API</strong></li><li><strong>Interface Private Methods</strong></li><li><strong>Try-With Resources</strong></li></ul><p><strong>Jigsaw projesi</strong></p><p>Java Platform Module System spesifikasyonu ile javaya modul sistemi adapte edildi. Bundan önce maven veya gradel gibi ek araçlara ihtiyaç duyuluyordu.</p><p>Modülerliği sağlamak için 7 adet geliştirme spesifikasyonu oluşturuldu ve projenin adına jigsaw denildi.</p><ul><li>Modular JDK</li><li>Modular Source Code</li><li>Modular Run-Time Images</li><li>Encapsulate Most Internal APIs</li><li>Module System</li><li>jlink : The Java Linker</li><li>Java Platform Module System</li></ul><p><strong>JSHELL</strong></p><p>Komut satırında java kodu çalıştırmayı sağlayan interaktif shell tool. JavaScript ile birlikte sıklıkla kullanılır. Avantajı ise kodun tamamını çalıştırmadan sonucu görmemize yarıyor.</p><p><strong>HTTP/2 Client</strong></p><p>HttpURLConnection API yerine artık daha iyi şekilde bağlantı kurmayı sağlayan bu özellik ile <strong>HttpClient, HttpRequest, HttpResponse</strong> sınıfları java içerisine eklenerek daha kolay bir kullanım sağlandı.</p><p><strong>Process API</strong></p><p>İşletim sistemi processlerinin yönetilmesine ve kontrol edilmesine yönelik yeni iyileştirmeler gelmiştir.</p><p><strong>Interface Private Methods</strong></p><p>Bir arayüzün içerisine private metotlar eklemizi sağlayan yeni bir özellik gelmiştir.</p><p>Bu özellikten önce arayüz içerisinde private metotlar yaratmak compile time hatalarına sebep oluyordu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*Qqi28o4clYNCTXJLDqxuGg.png" /><figcaption><a href="https://blog.burakkutbay.com/java-9-dersleri-interface-icerisinde-private-method-kullanmak.html/">https://blog.burakkutbay.com/java-9-dersleri-interface-icerisinde-private-method-kullanmak.html/</a></figcaption></figure><p><strong>Try-With Resources</strong></p><p>Dosya, Bağlantı veya Network gibi kaynakları kullandıktan sonra otomatik olarak AutoClosable arayüzünü kullanarak kapatan bir özellik olarak Java 9 içinde gelmiştir.</p><h4>Java 11 Bize Ne Getirdi</h4><p>Java 11 sürümü Eylül 2018&#39;de yayınlanmıştır.</p><p>Java 11 ile birlikte gelen yeni özellikleri genel olarak aşağıdaki şekilde listeleyebiliriz;</p><ul><li><strong>Yeni String Metotları</strong></li><li><strong>Yeni Dosya Metotları</strong></li><li><strong>Performans ve Güvenlik İyileştirmeleri</strong></li><li><strong>Flight Recorder</strong></li><li><strong>HTTP/2 Client</strong></li><li><strong>Lisanslama</strong></li><li><strong>Local-Variable Syntax for Lambda Parameters</strong></li></ul><p><strong>Yeni String Metotları</strong></p><p>isBlank(), lines(), repeat(n), strip() gibi yeni string metotları gelmiştir</p><p><strong>Yeni Dosya Metotları</strong></p><p>JavaShell ile çalışan writeString(), readString(), isSameFile() gibi yeni metotlar gelmiştir.</p><p><strong>Performans ve Güvenlik İyileştirmeleri</strong></p><p>G1 Garbage Collector ile Java 11&#39;de , Java 8’e göre %60 daha iyi performans artışı gerçekleştirilmiştir. Ve deneysel olarak Epsilon GC ve Z GC adında iki yeni Garbage Collector eklenmiştir.</p><p>Güvenlik iyileştirmeleri olarak, TLS 1.3 desteği sağlanmış ve eski güvenliğini kaybetmiş kriptografik algoritmalar çıkarılmış ve yeni daha güvenli algoritmalar eklenmiş.</p><p><strong>Flight Recorder</strong></p><p>JVM üzerinde uygulama çalışırken uygulamayı en düşük seviyede izleyebilmek için bir araç olarak Java 11 ile birlikte gelmiştir. Avantajı ise memory leak durumunu daha kısada fark edilmesini sağlar.</p><p><strong>HTTP/2 Client</strong></p><p>Java 9 ile deneysel olarak kazandırılan özellik canlıya alınmıştır.</p><p><strong>Lisanslama</strong></p><p>Java 11 ile birlikte Oracle yeni lisans stratejisini uygulamaya geçirdi.Bunlar</p><ul><li>Oracle JDK — Oracle Binary Code License Aggrement</li><li>Open JDK — GPL2</li></ul><p>Oracle JDK geliştirme yapılırken ücretsiz olacak ancak üretim safhasında ücretli olacaktır.</p><p>Ayrıca en son LTS sürümü Java 8 idi. Java 11 ‘de yeni bir LTS sürümü olarak karşımıza çıkıyor.(LTS = Uzun süreli destek verilecek sürümler)</p><p><strong>Local-Variable Syntax for Lambda Parameters</strong></p><p><a href="https://www.yusufsezer.com.tr/java-10/">Java 10</a> ile gelen var ifadesinin kapsamı genişletilerek lambda expressions ile kullanma imkanı gelmiştir.</p><h3>REFERENCES</h3><p><a href="https://devnot.com/2017/java-8-hakkinda-bilmeniz-gerekenler/">https://devnot.com/2017/java-8-hakkinda-bilmeniz-gerekenler/</a>,</p><ul><li><a href="https://medium.com/huawei-developers-tr/java-versiyonlar%C4%B1-ve-gelen-yenilikler-8-16-1d024561b5b9">Java Versiyonları ve Gelen Yenilikler : 8–16</a></li><li><a href="https://www.yusufsezer.com.tr/java-8/">Java 8 - Yusuf SEZER</a></li><li><a href="https://www.javatpoint.com/java-8-optional">Java 8 Optional - javatpoint</a></li><li><a href="https://www.javatpoint.com/java-8-method-reference">Java 8 Method Reference - javatpoint</a></li></ul><p><a href="https://www.java.com/tr/download/help/java8_tr.html">https://www.java.com/tr/download/help/java8_tr.html</a></p><p><a href="https://www.javatpoint.com/java-9-features">Java 9 Features - javatpoint</a></p><p><a href="https://www.baeldung.com/new-java-9">https://www.baeldung.com/new-java-9</a>,</p><ul><li><a href="http://teknokafe.net/2017/09/27/java-9-kullaniciya-sunuldu-iste-yenilikleri/">Java 9 Kullanıcıya Sunuldu, İşte Yenilikleri...</a></li><li><a href="https://wmaraci.com/blog/java-11-yeni-ozellikleriyle-yayinlandi-1163">Java 11 Yeni Özellikleriyle Yayınlandı!</a></li><li><a href="https://www.journaldev.com/24601/java-11-features">Java 11 Features - JournalDev</a></li></ul><p><a href="https://www.baeldung.com/java-11-new-features">https://www.baeldung.com/java-11-new-features</a></p><ul><li><a href="https://www.yusufsezer.com.tr/java-11/">Java 11 - Yusuf SEZER</a></li><li><a href="https://www.sukrucakmak.com/java-11/">Java 11-12-13 ve ...</a></li><li><a href="https://medium.com/i%CC%87yi-programlama/jdk-8den-11-e-a8d9f2784d91">JDK 8&#39;den 11&#39;e</a></li><li><a href="https://medium.com/@abdullahn1091/java-11-de-yenilikler-art%C4%B1k-%C3%BCcretli-mi-oluyor-26b049a8778c">Java 11 de yenilikler — Artık ücretli mi oluyor?</a></li></ul><p><a href="https://www.geeksforgeeks.org/java-11-features-and-comparison/">https://www.geeksforgeeks.org/java-11-features-and-comparison/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1823ea86bc43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test-Driven Development]]></title>
            <link>https://medium.com/@mertgltekin_58750/test-driven-development-e06142872245?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e06142872245</guid>
            <category><![CDATA[test]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[agile-methodology]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 15:50:43 GMT</pubDate>
            <atom:updated>2021-09-05T15:50:43.828Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is TDD (Test Driven Development)</h4><p>Test-driven development is a software development approach that brings test-first development. Developers write tests first then they implement code changes until your code passes the test you already wrote.</p><p>Requirements being converted to test cases before the software is fully developed.</p><p>Test-driven development is related to the test-first programming concepts of extreme programming and Kent Beck rediscovers the test-driven development in 2003.</p><h4>Steps of test-driven development</h4><p>There are five steps of test-driven development based on the book Test-Driven Development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*0XiqNww9WWcQ56wR.png" /></figure><ol><li><strong>Add a test</strong></li></ol><p>Before adding new feature, developer should first write test.</p><p><strong>2. Run all tests. The new test <em>should fail</em> for expected reasons</strong></p><p>The new test should fail because developer may not have written any production code yet or they just wrote the function name. Because of that test should fail.</p><p><strong>3. Write the simplest code that passes the new test</strong></p><p>We just need to pass the test even we hard code. But hard code will be removed by refactoring in Step 5.</p><p><strong>4. All tests should now pass</strong></p><p>If any fail, the new code must be revised until they pass. This ensures the new code meets the test requirements and does not break existing features.</p><p><strong>5. Refactor</strong></p><p>Production code should be readable and maintainable.For example, if hard-coded test data exist, then it should be removed</p><p>The steps above are repeated for each new piece of new functionality.</p><h4>TDD and Traditional Testing</h4><p>In waterfall methodology, testing happened after production coding. And in general, the development process is like</p><ul><li>design</li><li>develop the production code</li><li>testing</li></ul><p>But TDD comes with the Agile methodology. According to this, the development process, in general, is like</p><ul><li>design</li><li>code tests</li><li>develop the production code</li><li>run tests</li></ul><p>The tests should be written before the functionality that is to be tested in<em> test-driven development</em>.</p><h4>Benefits of TDD</h4><p>It also ensures that tests for every feature get written. That is all the requirements are considered and deeply understood before fully developed.</p><p>It ensures the effectiveness of the test code,</p><p>Maintains a continual focus on software quality.</p><p>A significant advantage of TDD is that it enables you to take small steps when writing software. It is much easier to find and then fix the bugs. Finding and fixing bugs with written two new lines of code are much easier than two thousand.</p><p>As expected, most programmers don’t read the written documentation, instead, they prefer to investigate the code. Unit tests are written according to scenarios and well written unit tests are very useful to investigate the code. They provide the specification of your functional code.</p><p>Large numbers of tests help to limit the number of defects in the code. The early and frequent nature of the testing helps to catch defects early in the development cycle, and this avoids waste of time.</p><p>According to a study, programmers who wrote more tests tended to be more productive. And also they rarely felt the need to invoke a debugger.</p><h4>Acceptance Test-Driven Development (ATDD)</h4><p>ATDD is a development methodology based on communication between the business customers, the developers, and the testers. All these processes aid developers and testers in understanding the customer’s needs prior to implementation and allow customers to be able to communicate in their own domain language. The acceptance test will be written before functionality in this methodology</p><p>Acceptance tests represent the user’s point of view and act as a form of requirements to describe how the system will function.</p><p>ATDD may also be referred to as Story Test Driven Development (SDD).</p><h4>Behavior Driven Development (BDD)</h4><p>BDD combines practices from TDD and from ATDD.</p><p>It focuses on tests that describe behavior, rather than tests that test a unit of implementation.</p><p>References</p><ul><li><a href="https://en.wikipedia.org/wiki/Acceptance_test%E2%80%93driven_development">Acceptance test-driven development - Wikipedia</a></li><li><a href="https://medium.com/@acokgungordu/yaz%C4%B1l%C4%B1m-geli%C5%9Ftirme-s%C3%BCrecinde-test-tdd-atdd-ve-bdd-aras%C4%B1ndaki-farklar-8332c20aaec7">Yazılım Geliştirme Sürecinde Test: TDD, ATDD ve BDD Arasındaki Farklar</a></li><li><a href="https://www.agilealliance.org/glossary/atdd/">Acceptance Test Driven Development (ATDD) | Agile Alliance</a></li></ul><p><a href="https://en.wikipedia.org/wiki/Test-driven_development#TDD_and_ATDD">https://en.wikipedia.org/wiki/Test-driven_development#TDD_and_ATDD</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e06142872245" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Docker]]></title>
            <link>https://medium.com/@mertgltekin_58750/introduction-to-docker-34366a5b174?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/34366a5b174</guid>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[hypervisors]]></category>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-image]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Sun, 29 Aug 2021 16:42:05 GMT</pubDate>
            <atom:updated>2021-08-29T16:42:05.500Z</atom:updated>
            <content:encoded><![CDATA[<p>Before diving into docker, we need to clarify what are Virtual Machines, Hypervisor, and Containers.</p><p><strong>Virtual Machines (VM)</strong></p><p>A Virtual Machine is a compute resource that uses software instead of a physical computer to run programs apps. Each virtual machine runs its own operating system and functions separately from the other VMs, even when they are all running on the same host.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*ybm09Y6PTPirC84O.png" /></figure><p>A VM is essentially an emulation of a real computer.</p><p><strong>Hypervisor</strong></p><p>A <strong>hypervisor (virtual machine monitor) </strong>is a piece of software, firmware, or hardware that VMs run on top of.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrYlwsCF4vYtKtasstnaBw.jpeg" /></figure><p>The main mission of hypervisors is abstracting a computer’s software from its hardware. The hypervisors themselves run on physical computers and these computers provide to the VMs resources like RAM and CPU.</p><p>And there are two main types of hypervisors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*5jOTs63Dn9Hu35QREOiSuw.jpeg" /><figcaption>Hypervisor types</figcaption></figure><p>The <strong>Bare Metal Hypervisor </strong>acts as a lightweight operating system and runs directly on the host’s hardware. It does not need a host operating system to run on. So bare-metal hypervisor has its own device drivers and interacts with each component directly for any I/O, processing, or OS-specific tasks. This result causes better performance.</p><p>The <strong>Hosted hypervisor</strong> runs as a software layer on an operating system, like other computer programs. It runs on the operating system of the host machine. But Virtual Machines (Guest OSs) do not have direct access to hardware.</p><p><strong>Container</strong></p><p>A container packages up code and all its dependencies and libraries. Another saying that operating system-level virtualization. (Hypervisors are abstracting software from its hardware.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*dP-p132mQRaAuj3o.png" /></figure><p>This illustration shows that containers isolate just the user space, and not the kernel or virtual hardware like a VM does. In a single host machine, multiple containers can run.</p><p><strong>Containers vs Virtual Machines</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7Vly8M8_SutJBsHMBhPJQ.png" /></figure><p><strong>Containers</strong></p><ul><li>Containers are typically measured by the megabyte.</li><li>Containers are often used to package single functions that perform specific tasks (known as a <a href="https://www.redhat.com/en/topics/microservices">microservice</a>).</li><li>Shared operating system (OS)</li><li>Operating-system-level virtualization</li><li>More portable</li></ul><p><strong>Virtual Machines</strong></p><ul><li>VMs are measured by the gigabyte</li><li>They usually contain their own OS,</li><li>Monolithic workloads</li><li>Less portable</li></ul><h3>Docker</h3><p>Before docker, one web application needs one server system (best practice). But if we set more than one web application into one server, the dependency between applications increases and some security problems occur. But with docker, we can set web applications into containers. In one system, multiple web applications can be run thanks to docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TCqOkRds0UfQT9RTwjfo3w.png" /></figure><p>Docker is an open-source project based on Linux containers. It uses Linux Kernel features like namespaces and control groups to create containers on top of an operating system. Docker virtualized isolated containers, and those containers could be several in one operating system.</p><h4><strong>Docker Architecture</strong></h4><p>Docker uses client/server structure. The communication is provided from rest APIs or sockets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QqxpZx8nNRILZ__rQU-HZw.jpeg" /></figure><h4>Docker Engine</h4><p>Docker engine is the layer on which Docker runs. It manages containers, images, builds, and more. It runs natively on Linux systems</p><h4>Docker Client (CLI)</h4><p>The Docker client is the end-user of Docker and communicates with Docker Deamon.</p><h4>Docker Daemon</h4><p>The Docker daemon is building, running, and distributing your containers besides allocate resources. It refers to the hypervisor in Virtual Machines. The Docker Daemon runs on the host machine, but as a user, you never communicate directly with the Daemon. The Docker Client communicates with the Docker Daemon.</p><h4>Docker Image</h4><p>A Docker image is a file used to execute code in a Docker container. Docker images act as a set of instructions to build a Docker container, like a template.</p><p>The Docker image is built using a Dockerfile. Each instruction in the Dockerfile adds a new “layer” to the image.</p><h4>Volumes</h4><p>Volumes are the data part of a container, which is generated and used by Docker. It is initialized when a container is created. Volumes allow you to persist and share a container’s data.</p><h4>Docker Containers</h4><p>A Docker container wraps an application’s software into a package with everything the application needs to run. That includes the operating system, application code, runtime, system tools, system libraries, and etc.</p><p>Note that docker creates a network interface so that the container can talk to the localhost.</p><h4>Docker Registry</h4><p>Docker registry is a warehouse in which Docker images are stored. (hub.docker.com)</p><h3>Benefits of Using Docker</h3><ul><li><strong>Ease of use:</strong> Before Docker, one web application needs one server system (best practice). But with docker, you can build any application on your laptop. The motto is “build once, run anywhere”.</li><li><strong>Speed:</strong> Docker containers are very lightweight and fast compared to VMs which might take longer because they have to boot up a full virtual operating system every time.</li><li><strong>Docker Hub:</strong> Docker Hub is an ecosystem in which you can find thousands of public images.</li><li><strong>Modularity and Scalability:</strong> Each function can be loaded to a container and those containers are easily can be linked to create an application. With this, each component can be updated and scaled easily.</li></ul><h3>References</h3><p><a href="https://medium.com/free-code-camp/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b">A Beginner-Friendly Introduction to Containers, VMs and Docker</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FACr92yZF0bg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DACr92yZF0bg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FACr92yZF0bg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1993deac6e0ea89471a7014e669e242e/href">https://medium.com/media/1993deac6e0ea89471a7014e669e242e/href</a></iframe><ul><li><a href="https://www.redhat.com/en/topics/containers/containers-vs-vms">Containers vs VMs</a></li><li><a href="https://medium.com/batech/docker-nedir-docker-kavramlar%C4%B1-avantajlar%C4%B1-901b37742ee0">Docker Nedir, Docker Kavramları, Avantajları.</a></li><li><a href="https://keytorc.com/blog/docker-nedir-ve-ne-icin-kullanilir/">Docker Nedir ve Ne İçin Kullanılır? | Keytorc Yazılım Test Hizmetleri</a></li><li><a href="https://sistek.com.tr/tr/docker-nedir/">Docker Nedir? - Sistek</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34366a5b174" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serializable and Deserializable]]></title>
            <link>https://medium.com/@mertgltekin_58750/serializable-and-deserializable-fcd93ed609a1?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcd93ed609a1</guid>
            <category><![CDATA[serializable]]></category>
            <category><![CDATA[deserialization]]></category>
            <category><![CDATA[serialization]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Wed, 25 Aug 2021 20:35:58 GMT</pubDate>
            <atom:updated>2021-08-25T20:35:58.108Z</atom:updated>
            <content:encoded><![CDATA[<h3>Serializable</h3><p>Serialization in Java is a mechanism of <em>writing the state of an object into a byte-stream</em>.</p><p>The serialization and deserialization processes are platform-independent, which means you can serialize an object on one platform and deserialize it on a different platform.</p><p>For serializing the object, we call the <strong>writeObject()</strong> method of <em>ObjectOutputStream </em>class.</p><pre>public final void writeObject(object x) throws IOException</pre><p>We must have to implement the <em>Serializable</em> interface for serializing the object.</p><p>Notes:</p><ul><li>Static data members are not serialized.</li><li>When a class is serializable, all its sub-classes are serializable as well.</li><li>When an object has a reference to another object, these objects must implement the <em>Serializable</em> interface separately, or else a <em>NotSerializableException</em> will be thrown:</li></ul><pre>public class <strong>Car</strong> implements <strong>Serializable</strong> <br>{ <br>    private int year;     <br>    private int hp;     <br>    private Brand brand; // must be serializable too <br>}</pre><ul><li>If you do not want any field to be part of the object state then declare it either <strong>static or transient</strong> based on your need and it will not be included during java serialization process.</li></ul><h3>Deserializable</h3><p><em>Deserialization</em> is a mechanism of converting a byte stream into an object. This is the reverse operation of serialization</p><p>For deserialization we call the <strong>readObject()</strong> method of <em>ObjectInputStream</em> class.</p><pre>public final Object readObject() throws IOException,ClassNotFoundException</pre><h4>Advantages of Java Serialization and Deserialization</h4><ul><li>It is used to travel object’s state on the network</li><li>Saves the state of an object. (Maybe saved in a database)</li></ul><h4>Where To Use</h4><p>It is mainly used in Hibernate, RMI, JPA, EJB, and JMS technologies.</p><h4>Serial Version UID</h4><p>The JVM links a version number which is a long data type, static and final with each serializable class. It is used during Deserialization to verify that the saved and loaded objects have the same attributes and thus are compatible with serialization.</p><p>If UID’s are not compatible then an <em>InvalidClassException error occurs</em>.</p><p>If a serializable class doesn’t declare a <em>serialVersionUID</em>, the JVM will generate one automatically at run-time. However, it is highly recommended that each class declares its <em>serialVersionUID</em> as the generated one is compiler dependent and thus may result in unexpected <em>InvalidClassExceptions</em>.</p><p>It is also recommended to use a private modifier for UID since it is not useful as an inherited member.</p><h3>References</h3><p><a href="https://www.baeldung.com/java-serialization">https://www.baeldung.com/java-serialization</a></p><ul><li><a href="https://www.geeksforgeeks.org/serialization-in-java/">Serialization and Deserialization in Java with Example - GeeksforGeeks</a></li><li><a href="https://www.studytonight.com/java/serialization-and-deserialization.php">Java Serialization and Deserialization</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcd93ed609a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overloading and Overriding]]></title>
            <link>https://medium.com/@mertgltekin_58750/overloading-and-overriding-bc62f21e1cb6?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc62f21e1cb6</guid>
            <category><![CDATA[overriding]]></category>
            <category><![CDATA[overloading]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Wed, 25 Aug 2021 19:50:50 GMT</pubDate>
            <atom:updated>2021-08-25T19:50:50.059Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overloading</h3><p>When two or more methods in the same class have the same name but different parameters, it’s called Overloading. (Please have a look at Builder Design Pattern) Method Overloading is a <em>Compile time polymorphism. In other words, </em>methods must have the same name and different signature. Return types can be the same or not.</p><h3>Overriding</h3><p>When the method signature (name and parameters) are the same in the superclass and the child class, it’s called Overriding. (Inheritance) Method Overriding is a<em> Run time polymorphism. </em>The return type must be same. Also, methods must have the same name and same signature.</p><h3>References</h3><ul><li><a href="https://www.geeksforgeeks.org/difference-between-method-overloading-and-method-overriding-in-java/">Difference Between Method Overloading and Method Overriding in Java - GeeksforGeeks</a></li><li><a href="https://www.journaldev.com/32182/overriding-vs-overloading-in-java">Overriding vs Overloading in Java - JournalDev</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc62f21e1cb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parameter Passing Methods in Java]]></title>
            <link>https://medium.com/@mertgltekin_58750/parameter-passing-methods-in-java-aedb745d5462?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/aedb745d5462</guid>
            <category><![CDATA[pass-by-value]]></category>
            <category><![CDATA[non-primitive-datatypes]]></category>
            <category><![CDATA[primitive-data-types]]></category>
            <category><![CDATA[parameter-passing-methods]]></category>
            <category><![CDATA[pass-by-reference]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Wed, 25 Aug 2021 19:07:34 GMT</pubDate>
            <atom:updated>2021-08-25T19:07:34.443Z</atom:updated>
            <content:encoded><![CDATA[<p>Arguments in Java are always passed by value. During method invocation, a copy of each argument, whether it&#39;s a value or reference, is created in stack memory which is then passed to the method. Values of primitive and references of non-primitive are copied inside the stack memory, and the new reference is passed to the method.</p><h4><strong>Pass By Value</strong></h4><p>In Java methods, arguments are <em>passed by value</em>. When invoked, the method receives the value of the variable passed in. When the argument is of primitive type, pass-by-value means that the method cannot change its value. (Primitive types are <em>int</em>, <em>byte</em>, <em>short</em>, <em>long</em>, <em>float</em>, <em>double</em>, <em>boolean</em>, and <em>char in java</em>) This method is also called <strong><em>call by value</em></strong>.</p><h4>Pass By References</h4><p>When a parameter is pass-by-reference, the caller and the callee operate on the same object. In this method, <strong>the address of the object is sent to the method.</strong> Any changes to the parameter’s instance will affect the original value.</p><p><strong>Passing Non-Primitives</strong></p><p>Non-Primitives store the reference variables in java such as objects, strings, and arrays. In java, for Non-Primitives, the pass-by-value is the value of <em>the reference to the object</em>.</p><p>If we allocate a new object to the passed reference variable, then it won’t be reflected in the original object.</p><h3>References</h3><p><a href="https://www.baeldung.com/java-pass-by-value-or-pass-by-reference">https://www.baeldung.com/java-pass-by-value-or-pass-by-reference</a></p><p><a href="https://www.baeldung.com/java-primitives">https://www.baeldung.com/java-primitives</a></p><ul><li><a href="https://www.geeksforgeeks.org/parameter-passing-techniques-in-java-with-examples/">Parameter Passing Techniques in Java with Examples - GeeksforGeeks</a></li><li><a href="https://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value">Is Java &quot;pass-by-reference&quot; or &quot;pass-by-value&quot;?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aedb745d5462" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JVM-JRE-JDK]]></title>
            <link>https://medium.com/@mertgltekin_58750/jvm-jre-jdk-3fd70b4906f9?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fd70b4906f9</guid>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[garbage-collection]]></category>
            <category><![CDATA[jre]]></category>
            <category><![CDATA[heap]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Wed, 25 Aug 2021 18:17:26 GMT</pubDate>
            <atom:updated>2021-08-26T07:56:26.366Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is JVM-JRE-JDK</h3><h3><strong>1. JVM(Java Virtual Machine)</strong></h3><p>JVM is an abstract engine that provides a runtime environment to run the Java code by converting Java bytecode(.class) into machine language. It can also run programs that are written in other languages but compiled to Java bytecode. JVM is widely known as a runtime interpreter.</p><p>A java program is compiled with javac.exe then byte code has occurred. And this byte code is run by JVM and converted into machine language. The compiler does not create different byte codes for different platforms. Thanks to this feature Java is a platform-independent programming language. “<strong>Write once, run anywhere”.</strong></p><ul><li>JVM is platform-dependent because the configuration of each operating system is different.</li><li>Generally, the compiler produces machine code for a specific system. However, the Java compiler produces code for a virtual machine.</li><li>JVM comes with JIT(Just-in-Time) compiler that converts Java source code into low-level machine language. Hence, it runs faster than a regular application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*T_9fbhtQ_oXivMmc.jpg" /></figure><h3>The JVM Architecture</h3><p>The java virtual machine architecture is divided into three main subsystems:</p><ol><li><strong>ClassLoader Subsystem</strong>: It loads, links, and initializes the class file when it refers to a class for the first time at runtime, not compile time. Also, known as dynamic class loading.</li><li><strong>Runtime Data Area</strong>: Contain <em>method areas, heap areas, stack areas, native method stacks, and PC Registers.</em></li><li><strong>Execution Engine: </strong>The bytecode will be executed by the Execution Engine. The Execution Engine reads the bytecode and executes it piece by piece. Contains an interpreter, compiler, and garbage collection area.</li></ol><p>The JVM has two primary functions: to allow Java programs to run, and to manage-optimize program memory.</p><h3><strong>Memory management in the JVM</strong></h3><h4>Garbage collection</h4><p>Program memory was managed and optimized by a programmer in some languages but in Java JVM handles it. (For example in C malloc or free functions)</p><p>The JVM manages memory through a process called <em>garbage collection</em>, which continuously identifies and eliminates unused memory in Java programs.</p><p>Unreferenced objects are automatically removed from the heap memory by the garbage collector, and this makes Java memory-efficient.</p><p>Garbage collector works in two simple steps known as Mark and Sweep:</p><ul><li><strong>Mark: </strong>The garbage collector identifies which pieces of memory are in use and which are not</li><li><strong>Sweep: </strong>The garbage collector<strong> </strong>removes objects identified during the “mark” phase</li></ul><p><strong>Advantages</strong>:</p><p>Garbage collection gives freedom to the programmer by manually dealing with memory deallocation. Program bugs are eliminated or reduced by the garbage collector.</p><p>JVM must stop the application and execute the <em>garbage collector</em> to free up the memory. This process is called “<strong>stop-the-world</strong>.” Except for <em>garbage collector</em> threads, all the threads will stop executing until the <em>garbage collector</em> threads are executed. But modern <em>garbage collector</em> implementations try to minimize blocking “stop-the-world”.</p><p>Note that there is no way to predict when garbage collection will occur at run time. Even System.gc() or Runtime.gc() dos not guarantee that garbage collector will run.</p><p><strong>JVM Generations</strong></p><p>Object allocation-deallocation behavior can be used to optimize the performance of the JVM. Therefore, the heap is divided into generations (parts). The heap generations are: Young Generation, Old or Tenured Generation, and Permanent Generation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/0*JJsYUL3OHPDDBSWu.png" /></figure><p>The <strong>Young Generation</strong> is where all new objects are allocated and aged. When the young generation fills up, this causes a <strong><em>minor (incremental) garbage collection</em></strong>. Dead objects are removed. But surviving objects are moved to the old generation.</p><p>All minor garbage collections are “Stop the World” events.</p><p>The <strong>Old Generation</strong> is used to store long surviving objects. A threshold is set for the young generation object and when that age is met, the object gets moved to the old generation. The old generation also needs to be collected. This event is called a <strong><em>major garbage collection</em></strong>.</p><p>Major garbage collection is also Stop the World events</p><p>The <strong>Permanent generation</strong> contains metadata required by the JVM to describe the classes and methods used in the application.</p><p>The permanent generation is included in a<strong> full garbage collection</strong>.</p><p><strong>The JVM Garbage Collectors</strong></p><ul><li><strong>Serial</strong> <strong>Garbage Collector</strong>:</li></ul><p>It freezes all application threads when it runs. Just garbage collector thread runs.</p><ul><li><strong>Parallel Garbage Collector</strong></li></ul><p>Multiple minor threads are executed simultaneously for managing heap space.</p><ul><li><strong>Concurrent Mark Sweep (CMS) Garbage Collector</strong></li></ul><p>It uses multiple garbage collector threads but reduces the number of stop-the-world events.</p><ul><li><strong>G1 Garbage Collector</strong></li></ul><p>which is also run in parallel, incrementally, and concurrently but functions differently than those garbage collectors.</p><h3>JRE(Java Runtime Environment)</h3><p>The Java Runtime Environment is a set of software tools responsible for the execution of the Java program or application on your system. It contains the class libraries, loader class, and JVM. It does not contain any tool for Java development like a debugger, compiler, etc. You need to install JRE to run Java programs.</p><p>It uses important package classes like math, swingetc, util, lang, awt, and runtime libraries.</p><p>It is the subset of JDK.</p><h3><strong>JDK(Java Development Kit)</strong></h3><p>The JDK forms the subset of the SDK (software development kit) used for developing Java applications and applets. It provides packages of tools for developing Java-based software. It contains the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools needed in Java development.</p><p>Java can be developed on different platforms such as Windows, macOS, Solaris, and Linux thanks to JDK.</p><p>If you are a programmer, you need to install JDK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*s1JtdsZHHjsYBExs.png" /></figure><h3>References</h3><ul><li><a href="https://www.oracle.com/webfolder/technetwork/tutorials/obe/java/gc01/index.html">Java Garbage Collection Basics</a></li><li><a href="https://www.eginnovations.com/blog/what-is-garbage-collection-java/">What is Garbage Collection in Java - Why it is Required</a></li><li><a href="https://www.infoworld.com/article/3272244/what-is-the-jvm-introducing-the-java-virtual-machine.html">What is the JVM? Introducing the Java Virtual Machine</a></li><li><a href="https://www.geeksforgeeks.org/differences-jdk-jre-jvm/">Differences between JDK, JRE and JVM - GeeksforGeeks</a></li><li><a href="https://dzone.com/articles/jvm-architecture-explained">The JVM Architecture Explained - DZone Java</a></li><li><a href="https://www.guru99.com/difference-between-jdk-jre-jvm.html#2">JDK vs JRE vs JVM: Key Differences</a></li><li><a href="https://www.programiz.com/java-programming/jvm-jre-jdk">Java JDK, JRE and JVM</a></li><li><a href="https://www.ibm.com/cloud/blog/jvm-vs-jre-vs-jdk">JVM vs. JRE vs. JDK: What&#39;s the Difference?</a></li></ul><p><a href="https://www.baeldung.com/jvm-garbage-collectors">https://www.baeldung.com/jvm-garbage-collectors</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fd70b4906f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices and Microservice Architecture]]></title>
            <link>https://medium.com/@mertgltekin_58750/microservices-and-microservice-architecture-3fa69dba089b?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fa69dba089b</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Thu, 12 Aug 2021 21:32:29 GMT</pubDate>
            <atom:updated>2021-08-12T21:32:29.409Z</atom:updated>
            <content:encoded><![CDATA[<p>Microservice architecture is an architectural style in which a single application is composed of many loosely coupled and independently deployable small services. We call these services “microservices”. Each microservices are running in its own process.</p><p>These services have minimal centralized management, which may be coded in different programming languages (maybe different frameworks like spring, Integration, Messaging Queue, J2EE…) and different data storage technologies. Microservices can also be managed by different teams.</p><p>Microservices are communicating with an HTTP resource API mechanism.</p><h3><strong>Monolithic vs microservices</strong></h3><p>A monolithic application built as a single unit in which is a large and tightly coupled application. Generally, applications are often built in three main parts: a client-side user interface, a database, and a server-side application(Layered or n-tier).</p><p>A change made to a small part of the application requires the entire monolith to be rebuilt and deployed.</p><p>Monolithic applications put all their functionality into a single process.</p><p>A microservice architecture puts each element of functionality into separate services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*WxJpf1pQw5E38miWfZYVbQ.png" /></figure><h3>Characteristics Of Microservices</h3><p><strong>Componentization</strong></p><p>Microservices can be broken down into multiple component services. Why? So that each of these services can be deployed, fixed, and then redeployed independently without compromising the integrity of an application. Thanks to componentization, there is no need to redeploy entire applications.</p><p><strong>Organized around Business Capabilities</strong></p><p>The microservices style is usually organized around business capabilities and priorities. Unlike a traditional monolithic development approach, where different teams each have a specific focus on, say, UIs, databases, technology layers, or server-side logic.</p><p>But in microservices, the teams are cross-functional, including the full range of skills required for the development: user experience, database, and project management. So this brings new title requirements like Full Stack developer and DevOps</p><p><strong>Decentralized Governance — Decentralized Data Management</strong></p><p>We prefer using the right tool for the job. Teams building microservices prefer a different approach to standards too.</p><p>Monolithic systems use a single logical database across different applications. In a microservice application, each service usually manages its unique database.</p><p><strong>Products not Projects</strong></p><p>Microservice proponents tend to avoid the project model, instead, they prefer products which has a lifetime. Development teams take full responsibility for the software in production. Generally, maintenance is not considered in the project model.</p><p>This brings developers into day-to-day contact with how their software behaves in production and increases contact with their users, as they have to take on at least some of the support burden.</p><p><strong>Smart endpoints and dumb pipes</strong></p><p>Applications built from microservices aim to be as decoupled and as cohesive as possible.</p><p>The two protocols used most commonly are HTTP request-response with resource API’s and lightweight messaging. The best expression of the first is Be of the web, not behind the web</p><p><strong>Infrastructure Automation</strong></p><p>Many of the products or systems being built with microservices are being built by teams with extensive experience of <a href="https://martinfowler.com/bliki/ContinuousDelivery.html">Continuous Delivery</a> and it’s precursor, <a href="https://martinfowler.com/articles/continuousIntegration.html">Continuous Integration</a>. Teams building software this way make extensive use of infrastructure automation techniques.</p><ul><li><strong>automated tests</strong>. <strong>automate deployment</strong></li></ul><p><strong>Design for failure</strong></p><p>Microservices are designed to cope with failure. Since several unique and diverse services are communicating together, it’s quite possible that a service could fail, for one reason or another. However, monitoring microservices can help prevent the risk of failure. For obvious reasons, this requirement adds more complexity to microservices as compared to monolithic systems architecture.</p><p><strong>Evolutionary Design</strong></p><p>Microservices architecture is ideal for evolutionary. Technology is changing so fast. New versions of devices are updated every day. So microservices must be evolutionary.</p><h3>Benefits Of Using Microservice Architecture</h3><ul><li><em>Modularity</em>: This makes the application easier to understand, develop, test. That is architecture brings loose coupling.</li><li><em>Scalability</em>: Since microservices are implemented and deployed independently of each other. Thanks to this they can be scaled independently.</li><li><em>Distributed development</em>: It parallelizes development by enabling small autonomous teams to develop, deploy and scale their respective services independently.</li><li><em>Continuos integration- continuos delivery</em>: Microservice-based architectures facilitate continuos integration- continuos delivery and deployment.</li><li><em>Cost</em>: Deployment time is shortened and cost reduced thanks to independent deployment.</li><li><em>Error handling</em>: Errors, bugs are concerned by only one microservice and do not affect the whole project like monolithic architecture.</li><li><em>Platform Independence</em>: Teams may use a different platform to develop a project.</li></ul><h3><strong>Disadvantages</strong></h3><ul><li>Due to distributed deployment, testing can become complicated</li><li>When the number of services increases, integration and managing whole products can become complicated,</li><li>The mechanism of communication between the services may be complicated.</li></ul><h3>References</h3><ul><li><a href="https://martinfowler.com/articles/microservices.html">Microservices</a></li><li><a href="https://www.cozumpark.com/microservice-mimari-nedir-neden-onemlidir/">Microservice Mimari Nedir ? Neden Önemlidir ? - ÇözümPark</a></li><li><a href="https://gokhana.medium.com/microservice-mimarisi-nedir-microservice-mimarisine-giri%C5%9F-948e30cf65b1">Microservice Mimarisi Nedir ? Microservice Mimarisine Giriş</a></li><li><a href="https://www.ibm.com/cloud/learn/microservices">microservices</a></li><li><a href="https://smartbear.com/solutions/microservices/">What are Microservices? | API Basics | SmartBear</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fa69dba089b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Computing]]></title>
            <link>https://medium.com/@mertgltekin_58750/serverless-computing-f11c4610d8dd?source=rss-b4a84fc484b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f11c4610d8dd</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[serverless-computing]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Mert Gültekin]]></dc:creator>
            <pubDate>Tue, 10 Aug 2021 21:56:46 GMT</pubDate>
            <atom:updated>2021-08-10T21:56:46.079Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is serverless computing</h3><p>Serverless computing is a <a href="https://en.wikipedia.org/wiki/Cloud_computing">c</a>loud computing execution model in which the cloud provider allocates hardware skills depend on demand. Cloud Vendors have the responsibility of infrastructure like purchasing or selling servers, managing servers, network handling, maintaining, and so on. Developers can develop any project without a physical server. Here, developers focus on the business side of the system. In another word, Serverless computing is a method of providing backend services on an as-used basis. Serverless apps are deployed in containers that automatically launch on demand when called.</p><h4>NOTE:</h4><p>Physical servers are still used but developers do not need to manage them.</p><p>For example, a developer who wanted to build a web application had to own the physical hardware(like server or database), required to run a server</p><h3>When to Use</h3><p>In a distributed system, it may be useful.</p><p>Serverless code can be used with microservices.</p><h3>Advantages</h3><ul><li>Lower costs (pay as you go)(no need for physical hardware like a server)</li><li>Simplified scalability ( An organization is able to scale very quickly to thousands of machines.)</li><li>Simplified backend code (Using backend services makes the code simple)</li><li>Quicker return (cut time to market decreased)</li><li>Increased developer productivity (Just focus on the business side)</li></ul><h3>Disadvantages</h3><ul><li>Not running and controlling your own server.</li><li>Performance concerns (infrequently used serverless code may suffer from great response latency.)</li><li>Security (There are many components to the application and each component is an entry point to the serverless application. In these entry points can be security bugs)</li><li>Privacy (may have some privacy implications like shared resources)</li><li>Vendor lock-in (Migration may cause multiple issues)</li></ul><h3>Examples</h3><ul><li>AWS Lambda</li><li>Google Cloud Functions</li><li>Azure Functions</li><li>IBM OpenWhisk</li><li>Alibaba Function Compute</li><li>Iron Functions</li><li>Auth0 Webtask</li><li>Oracle Fn Project</li><li>Kubeless</li></ul><p><strong>Serverless databases</strong></p><ul><li>Amazon Aurora</li><li>Azure Data Lake</li><li>Google Firebase</li></ul><h3>Backend Models</h3><p>Cloud computing solutions are grouped in multiple categories depending on how the resources are exposed to final users.</p><h3>IaaS — Infrastructure as a Service</h3><p>Provides access to computing resources in a virtualized environment. Cloud vendors host all the infrastructure on behalf of their customers.</p><h3>PaaS — Platform as a Service</h3><p>Provides a platform (runtime) and environment to allow developers to build applications.</p><p>Developers essentially rent all the necessary tools to develop</p><p>Developers are focusing only on the application itself.</p><h3>BaaS — Backend as a Service</h3><p>Provides a backend for applications. They provide an API and tools for different computer languages to integrate with their backend.</p><p>They also provide additional services like storage, Analytics, Push notifications, dashboards, social integration.</p><h3>References</h3><ul><li><a href="https://medium.com/devopsturkiye/serverless-mimari-nedir-neden-serverless-kimler-serverless-kullanmal%C4%B1-a3027b3696bc">Serverless mimari nedir? Neden Serverless? Kimler serverless kullanmalı.</a></li><li><a href="https://en.wikipedia.org/wiki/Serverless_computing">Serverless computing - Wikipedia</a></li><li><a href="https://www.redhat.com/en/topics/cloud-native-apps/what-is-serverless">What is serverless?</a></li></ul><p><a href="https://www.cloudflare.com/learning/serverless/what-is-serverless/">https://www.cloudflare.com/learning/serverless/what-is-serverless/</a></p><p><a href="https://assist-software.net/blog/cloud-offering-comparison-between-iaas-paas-saas-baas">https://assist-software.net/blog/cloud-offering-comparison-between-iaas-paas-saas-baas</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f11c4610d8dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>