<?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 Aysena Özcan on Medium]]></title>
        <description><![CDATA[Stories by Aysena Özcan on Medium]]></description>
        <link>https://medium.com/@aysenaozcann?source=rss-53c10e8882cc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XcCwGMEt7aOUsvppmVkXEw.jpeg</url>
            <title>Stories by Aysena Özcan on Medium</title>
            <link>https://medium.com/@aysenaozcann?source=rss-53c10e8882cc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:47:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aysenaozcann/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[Python String Metotları: Kapsamlı Rehber]]></title>
            <link>https://medium.com/@aysenaozcann/python-string-metotlar%C4%B1-kapsaml%C4%B1-rehber-d12facc84a19?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d12facc84a19</guid>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 20:02:52 GMT</pubDate>
            <atom:updated>2025-12-15T20:02:52.862Z</atom:updated>
            <content:encoded><![CDATA[<p>Python’da string (metin) işlemleri, programlamanın temel taşlarından biridir. Python, string’lerle çalışmayı kolaylaştıran 40&#39;tan fazla yerleşik metot sunar. Bu makalede, tüm Python string metotlarını kategorilere ayırarak detaylı bir şekilde inceleyeceğiz.</p><h3>Büyük/Küçük Harf Dönüşüm Metotları</h3><h3>capitalize()</h3><p>String’in sadece ilk karakterini büyük harfe çevirir, geri kalanını küçük harfe dönüştürür.</p><p>python</p><pre>metin = &quot;merhaba DÜNYA&quot;<br>print(metin.capitalize())  # Merhaba dünya</pre><h3>upper() ve lower()</h3><p>upper() tüm harfleri büyük harfe, lower() ise tüm harfleri küçük harfe çevirir.</p><p>python</p><pre>metin = &quot;Python Programlama&quot;<br>print(metin.upper())  # PYTHON PROGRAMLAMA<br>print(metin.lower())  # python programlama</pre><h3>casefold()</h3><p>lower() metoduna benzer ancak daha agresif bir küçük harf dönüşümü yapar. Özellikle uluslararası karakterler için kullanışlıdır.</p><p>python</p><pre>alman = &quot;straße&quot;<br>print(alman.lower())     # straße<br>print(alman.casefold())  # strasse</pre><h3>swapcase()</h3><p>Büyük harfleri küçük, küçük harfleri büyük harfe çevirir.</p><p>python</p><pre>metin = &quot;Python 3.11&quot;<br>print(metin.swapcase())  # pYTHON 3.11</pre><h3>title()</h3><p>Her kelimenin ilk harfini büyük harfe çevirir.</p><p>python</p><pre>metin = &quot;python programlama dili&quot;<br>print(metin.title())  # Python Programlama Dili</pre><h3>Hizalama ve Biçimlendirme Metotları</h3><h3>center()</h3><p>String’i belirtilen genişlikte ortalar.</p><p>python</p><pre>metin = &quot;Python&quot;<br>print(metin.center(20, &quot;-&quot;))  # -------Python-------</pre><h3>ljust() ve rjust()</h3><p>ljust() sola yaslar, rjust() sağa yaslar.</p><p>python</p><pre>metin = &quot;Python&quot;<br>print(metin.ljust(10, &quot;.&quot;))   # Python....<br>print(metin.rjust(10, &quot;.&quot;))   # ....Python</pre><h3>zfill()</h3><p>String’in başına sıfırlar ekleyerek belirtilen genişliğe ulaştırır.</p><p>python</p><pre>sayi = &quot;42&quot;<br>print(sayi.zfill(5))  # 00042</pre><h3>expandtabs()</h3><p>Tab karakterlerinin boyutunu ayarlar.</p><p>python</p><pre>metin = &quot;Python\tDili&quot;<br>print(metin.expandtabs(4))   # Python  Dili<br>print(metin.expandtabs(16))  # Python          Dili</pre><h3>Arama ve Konum Bulma Metotları</h3><h3>find()</h3><p>Belirtilen değeri arar ve bulunduğu ilk konumu döndürür. Bulamazsa -1 döner.</p><p>python</p><pre>metin = &quot;Python programlama dili&quot;<br>print(metin.find(&quot;program&quot;))  # 7<br>print(metin.find(&quot;java&quot;))     # -1</pre><h3>rfind()</h3><p>find() gibi çalışır ancak aramayı sondan başa doğru yapar.</p><p>python</p><pre>metin = &quot;Python programlama Python&quot;<br>print(metin.find(&quot;Python&quot;))   # 0<br>print(metin.rfind(&quot;Python&quot;))  # 19</pre><h3>index() ve rindex()</h3><p>find() ve rfind() ile aynı işlevi görür ancak değer bulunamazsa ValueError hatası verir.</p><p>python</p><pre>metin = &quot;Python programlama&quot;<br>print(metin.index(&quot;program&quot;))  # 7<br># print(metin.index(&quot;java&quot;))   # ValueError hatası</pre><h3>count()</h3><p>Belirtilen değerin string içinde kaç kez geçtiğini sayar.</p><p>python</p><pre>metin = &quot;Python programlama Python dili Python&quot;<br>print(metin.count(&quot;Python&quot;))  # 3</pre><h3>Kontrol ve Doğrulama Metotları</h3><h3>startswith() ve endswith()</h3><p>String’in belirli bir değerle başlayıp başlamadığını veya bitip bitmediğini kontrol eder.</p><p>python</p><pre>dosya = &quot;rapor.pdf&quot;<br>print(dosya.endswith(&quot;.pdf&quot;))      # True<br>print(dosya.startswith(&quot;rapor&quot;))   # True</pre><h3>isalpha()</h3><p>Tüm karakterlerin alfabetik olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;Python&quot;.isalpha())   # True<br>print(&quot;Python3&quot;.isalpha())  # False</pre><h3>isdigit() ve isnumeric()</h3><p>isdigit() sadece rakamları, isnumeric() ise tüm sayısal karakterleri kontrol eder.</p><p>python</p><pre>print(&quot;123&quot;.isdigit())      # True<br>print(&quot;½&quot;.isdigit())        # False<br>print(&quot;½&quot;.isnumeric())      # True</pre><h3>isalnum()</h3><p>Tüm karakterlerin alfanumerik (harf veya rakam) olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;Python3&quot;.isalnum())  # True<br>print(&quot;Python 3&quot;.isalnum()) # False (boşluk var)</pre><h3>isdecimal()</h3><p>Tüm karakterlerin ondalık sayı olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;123&quot;.isdecimal())   # True<br>print(&quot;12.3&quot;.isdecimal())  # False</pre><h3>isspace()</h3><p>Tüm karakterlerin boşluk karakteri olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;   &quot;.isspace())    # True<br>print(&quot; a &quot;.isspace())    # False</pre><h3>islower() ve isupper()</h3><p>Harflerin küçük veya büyük harf olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;python&quot;.islower())  # True<br>print(&quot;PYTHON&quot;.isupper())  # True</pre><h3>istitle()</h3><p>String’in title case formatında olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;Python Programlama&quot;.istitle())  # True<br>print(&quot;Python programlama&quot;.istitle())  # False</pre><h3>isidentifier()</h3><p>String’in geçerli bir Python değişken adı olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;degisken1&quot;.isidentifier())  # True<br>print(&quot;1degisken&quot;.isidentifier())  # False<br>print(&quot;for&quot;.isidentifier())        # True (anahtar kelime olsa da)</pre><h3>isascii()</h3><p>Tüm karakterlerin ASCII karakteri olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;Python&quot;.isascii())  # True<br>print(&quot;Pythön&quot;.isascii())  # False</pre><h3>isprintable()</h3><p>Tüm karakterlerin yazdırılabilir olup olmadığını kontrol eder.</p><p>python</p><pre>print(&quot;Python&quot;.isprintable())    # True<br>print(&quot;Python\n&quot;.isprintable())  # False</pre><h3>Bölme ve Birleştirme Metotları</h3><h3>split()</h3><p>String’i belirtilen ayırıcıya göre böler ve liste döndürür.</p><p>python</p><pre>metin = &quot;Python,Java,JavaScript&quot;<br>print(metin.split(&quot;,&quot;))  # [&#39;Python&#39;, &#39;Java&#39;, &#39;JavaScript&#39;]</pre><h3>rsplit()</h3><p>split() gibi çalışır ancak bölmeyi sondan başa doğru yapar.</p><p>python</p><pre>metin = &quot;a-b-c-d&quot;<br>print(metin.split(&quot;-&quot;, 2))   # [&#39;a&#39;, &#39;b&#39;, &#39;c-d&#39;]<br>print(metin.rsplit(&quot;-&quot;, 2))  # [&#39;a-b&#39;, &#39;c&#39;, &#39;d&#39;]</pre><h3>splitlines()</h3><p>String’i satır sonlarına göre böler.</p><p>python</p><pre>metin = &quot;Birinci satır\nİkinci satır\nÜçüncü satır&quot;<br>print(metin.splitlines())  # [&#39;Birinci satır&#39;, &#39;İkinci satır&#39;, &#39;Üçüncü satır&#39;]</pre><h3>join()</h3><p>Bir iterabl’ın (liste, tuple vb.) elemanlarını birleştirip tek bir string oluşturur.</p><p>python</p><pre>kelimeler = [&quot;Python&quot;, &quot;çok&quot;, &quot;güzel&quot;]<br>print(&quot; &quot;.join(kelimeler))  # Python çok güzel<br>print(&quot;-&quot;.join(kelimeler))  # Python-çok-güzel</pre><h3>partition() ve rpartition()</h3><p>String’i belirtilen ayırıcıya göre üç parçaya böler: öncesi, ayırıcı, sonrası.</p><p>python</p><pre>metin = &quot;Python-3-11&quot;<br>print(metin.partition(&quot;-&quot;))   # (&#39;Python&#39;, &#39;-&#39;, &#39;3-11&#39;)<br>print(metin.rpartition(&quot;-&quot;))  # (&#39;Python-3&#39;, &#39;-&#39;, &#39;11&#39;)</pre><h3>Temizleme ve Değiştirme Metotları</h3><h3>strip(), lstrip(), rstrip()</h3><p>String’in başındaki ve/veya sonundaki boşlukları veya belirtilen karakterleri kaldırır.</p><p>python</p><pre>metin = &quot;   Python   &quot;<br>print(metin.strip())   # &quot;Python&quot;<br>print(metin.lstrip())  # &quot;Python   &quot;<br>print(metin.rstrip())  # &quot;   Python&quot;</pre><pre>url = &quot;https://example.com/&quot;<br>print(url.rstrip(&quot;/&quot;))  # <a href="https://example.com/">https://example.com</a></pre><h3>replace()</h3><p>String içindeki belirtilen değeri yeni bir değerle değiştirir.</p><p>python</p><pre>metin = &quot;Python 2 kullanıyorum&quot;<br>print(metin.replace(&quot;2&quot;, &quot;3&quot;))  # Python 3 kullanıyorum</pre><pre># Değişim sayısını sınırlayabilirsiniz<br>metin = &quot;a-a-a-a&quot;<br>print(metin.replace(&quot;a&quot;, &quot;b&quot;, 2))  # b-b-a-a</pre><h3>Kodlama ve Çeviri Metotları</h3><h3>encode()</h3><p>String’i belirtilen kodlama ile byte’a dönüştürür.</p><p>python</p><pre>metin = &quot;Python&quot;<br>print(metin.encode())           # b&#39;Python&#39;<br>print(metin.encode(&quot;utf-8&quot;))    # b&#39;Python&#39;</pre><h3>maketrans() ve translate()</h3><p>Karakter çeviri tablosu oluşturur ve uygular.</p><p>python</p><pre># Sesli harfleri sayılara çevir<br>ceviri = str.maketrans(&quot;aeiou&quot;, &quot;12345&quot;)<br>metin = &quot;python programlama&quot;<br>print(metin.translate(ceviri))  # pyth3n pr3gr1ml1m1</pre><h3>Format Metotları</h3><h3>format()</h3><p>String içine değişken değerlerini yerleştirir.</p><p>python</p><pre>isim = &quot;Ahmet&quot;<br>yas = 25<br>metin = &quot;Benim adım {} ve {} yaşındayım&quot;.format(isim, yas)<br>print(metin)  # Benim adım Ahmet ve 25 yaşındayım</pre><pre># İndeksle<br>metin = &quot;{0} {1} {0}&quot;.format(&quot;Python&quot;, &quot;Java&quot;)<br>print(metin)  # Python Java Python</pre><pre># İsimle<br>metin = &quot;{dil} öğreniyorum&quot;.format(dil=&quot;Python&quot;)<br>print(metin)  # Python öğreniyorum</pre><h3>format_map()</h3><p>format() gibi çalışır ancak mapping (sözlük) alır.</p><p>python</p><pre>veriler = {&quot;isim&quot;: &quot;Ayşe&quot;, &quot;sehir&quot;: &quot;İstanbul&quot;}<br>metin = &quot;{isim} {sehir}&#39;da yaşıyor&quot;.format_map(veriler)<br>print(metin)  # Ayşe İstanbul&#39;da yaşıyor</pre><h3>Pratik Kullanım Örnekleri</h3><h3>E-posta Doğrulama</h3><p>python</p><pre>email = &quot;kullanici@example.com&quot;<br>if &quot;@&quot; in email and email.endswith((&quot;.com&quot;, &quot;.net&quot;, &quot;.org&quot;)):<br>    print(&quot;Geçerli e-posta formatı&quot;)</pre><h3>Dosya Adı Temizleme</h3><p>python</p><pre>dosya_adi = &quot;  Rapor 2024.pdf  &quot;<br>temiz_dosya = dosya_adi.strip().replace(&quot; &quot;, &quot;_&quot;).lower()<br>print(temiz_dosya)  # rapor_2024.pdf</pre><h3>Şifre Güvenlik Kontrolü</h3><p>python</p><pre>sifre = &quot;Python123&quot;<br>guclu = (<br>    len(sifre) &gt;= 8 and<br>    any(c.isupper() for c in sifre) and<br>    any(c.islower() for c in sifre) and<br>    any(c.isdigit() for c in sifre)<br>)<br>print(&quot;Güçlü şifre&quot; if guclu else &quot;Zayıf şifre&quot;)</pre><h3>Metin Hizalama</h3><p>python</p><pre>baslik = &quot;RAPOR&quot;<br>print(baslik.center(50, &quot;=&quot;))<br>print(&quot;İçerik buraya gelecek&quot;.center(50))<br>print(&quot;=&quot;*50)</pre><h3>Sonuç</h3><p>Python string metotları, metin işleme görevlerini kolaylaştıran güçlü araçlardır. Bu metotları etkili kullanarak daha temiz ve okunabilir kod yazabilirsiniz. Her metodun kendine özgü kullanım alanı vardır ve doğru senaryoda kullanıldığında büyük verimlilik sağlar.</p><p>Unutmayın: String’ler Python’da değiştirilemez (immutable) objelerdir. Bu nedenle tüm bu metotlar orijinal string’i değiştirmez, yeni bir string döndürür.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d12facc84a19" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackerRank itertools.product Sorusu — Adım Adım Mantık ve Çözüm]]></title>
            <link>https://medium.com/@aysenaozcann/hackerrank-itertools-product-sorusu-ad%C4%B1m-ad%C4%B1m-mant%C4%B1k-ve-%C3%A7%C3%B6z%C3%BCm-7c23e4b8bc0d?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c23e4b8bc0d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[itertools]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Sat, 13 Dec 2025 22:34:33 GMT</pubDate>
            <atom:updated>2025-12-13T22:34:33.121Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackerRank itertools.product Sorusu — Adım Adım Mantık ve Çözüm</h3><p>Bu yazıda HackerRank üzerinde sıkça karşılaşılan ve <strong>itertools.product</strong> kullanımını öğretmeyi amaçlayan bir soruyu, <strong>mantığını anlayarak</strong> nasıl çözdüğümü anlatıyorum. Bu soru özellikle Python’a yeni başlayanların zorlandığı ama çözüldüğünde çok şey öğreten güzel bir örnek.</p><h3>📌 Soru Ne İstiyor?</h3><p>Bize:</p><ul><li><strong>K tane liste</strong> veriliyor</li><li>Her listeden <strong>tam olarak 1 eleman</strong> seçmemiz isteniyor</li><li>Seçtiğimiz elemanların:</li></ul><ol><li>Karelerini alıyoruz</li><li>Topluyoruz</li><li>Sonucu <strong>M</strong> sayısına göre <strong>mod</strong> alıyoruz</li></ol><p>Ama burada kritik nokta şu:</p><blockquote><strong><em>Rastgele seçim yapmıyoruz.</em></strong><em><br></em><strong><em>Tüm olası seçimleri deniyoruz ve en büyük sonucu buluyoruz.</em></strong></blockquote><h3>🧠 Input Formatını Anlamak (En Çok Karıştırılan Kısım)</h3><p>Örnek input:</p><pre>3 1000<br>2 5 4<br>3 7 8 9<br>5 5 7 8 9 10</pre><ul><li>3 → kaç liste olduğunu söyler (K)</li><li>1000 → mod alınacak sayı (M)</li></ul><p>Sonraki her satır:</p><ul><li>İlk sayı → <strong>o listedeki eleman sayısı</strong> (format bilgisi)</li><li>Geri kalanlar → <strong>gerçek liste elemanları</strong></li></ul><p>👉 Python’da liste uzunluğu zaten bilindiği için <strong>ilk sayıyı kullanmamıza gerek yok</strong>. Bu yüzden her satırda ilk elemanı atıyoruz.</p><h3>📦 Listeler Nasıl Oluşturuluyor?</h3><p>Input’tan sonra elimizde şu yapı oluşuyor:</p><pre>[[5, 4], [7, 8, 9], [5, 7, 8, 9, 10]]</pre><p>Yani:</p><ul><li>Liste içinde listeler</li><li>Her alt listeden <strong>1 eleman seçilecek</strong></li></ul><h3>❌ Neden Rastgele Seçim Yanlış?</h3><p>İlk denemelerde çoğu kişi (ben de dahil) random.choice kullanarak her listeden bir eleman seçiyor. Ama bu yaklaşım:</p><ul><li>Her çalıştırmada farklı sonuç üretir</li><li>HackerRank’ın beklediği <strong>tek ve kesin maksimum sonucu</strong> vermez</li></ul><p>Bu yüzden <strong>Wrong Answer</strong> alınır.</p><h3>✅ Doğru Yaklaşım: Tüm Kombinasyonları Denemek</h3><p>İşte burada <strong>itertools.product</strong> devreye giriyor.</p><h3>product(*lists) ne yapar?</h3><ul><li>Her listeden bir eleman alır</li><li>Tüm olası kombinasyonları üretir</li></ul><p>Örneğin:</p><pre>product([5, 4], [7, 8])</pre><p>şu kombinasyonları üretir:</p><pre>(5, 7), (5, 8), (4, 7), (4, 8)</pre><p>Bu sayede:</p><ul><li>Hiçbir olasılığı kaçırmayız</li><li>Gerçek maksimum değeri buluruz</li></ul><h3>🧮 Hesaplama Mantığı</h3><p>Her kombinasyon için:</p><ol><li>Elemanların kareleri alınır</li><li>Kareler toplanır</li><li>Toplamın % M değeri hesaplanır</li><li>En büyük değer saklanır</li></ol><p>Bu işlemler tüm kombinasyonlar için tekrarlanır.</p><h3>✅ HackerRank Tarafından Kabul Edilen Çözüm Kodu</h3><pre>from itertools import product</pre><pre>K, M = map(int, input().split())</pre><pre>lists = []</pre><pre>for _ in range(K):<br>    row = list(map(int, input().split()))<br>    lists.append(row[1:])</pre><pre>max_value = 0</pre><pre>for combo in product(*lists):<br>    total = 0<br>    for x in combo:<br>        total += x * x<br>    value = total % M</pre><pre>    if value &gt; max_value:<br>        max_value = value</pre><pre>print(max_value)</pre><h3>🎯 Bu Sorudan Ne Öğrendim?</h3><ul><li>Input formatını doğru okumak çözümün yarısıdır</li><li>Rastgele çözüm = yanlış çözüm</li><li>*lists kullanımı Python’da çok güçlü bir tekniktir</li><li>`itertools.prod</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c23e4b8bc0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Python Eğitimimin İlk Günü: Değişkenler, Veri Tipleri ve Temel Operasyonlar]]></title>
            <link>https://medium.com/@aysenaozcann/python-e%C4%9Fitimimin-i%CC%87lk-g%C3%BCn%C3%BC-de%C4%9Fi%C5%9Fkenler-veri-tipleri-ve-temel-operasyonlar-598e34a4656a?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/598e34a4656a</guid>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 20:31:25 GMT</pubDate>
            <atom:updated>2025-12-10T20:31:25.180Z</atom:updated>
            <content:encoded><![CDATA[<p>Bugün katıldığım Python eğitiminde, programlamaya yeni başlayan herkesin bilmesi gereken temel kavramları ele aldık. Eğitim boyunca basit örnekler üzerinden ilerledik ve Python’un ne kadar anlaşılır bir dil olduğunu bir kez daha görmüş oldum. Bu yazıda, eğitim sırasında yazdığımız kodları ve öğrendiğim temel başlıkları özetlemek istiyorum.</p><h3>Python ile İlk Adımlar: print() Fonksiyonu</h3><p>Python’un en temel yapı taşlarından biri print() fonksiyonudur. Terminale veya ekrana bir şeyler yazdırmak için kullanılır. Eğitimin ilk dakikalarında klasik bir örnek ile başladık:</p><pre>print(55*55)</pre><p>Ekrana direkt olarak matematiksel işlemin sonucunu bastı:</p><pre>3025</pre><p>Metin yazdırmak da bir o kadar kolay:</p><pre>print(&quot;Merhaba bu Python eğitiminin ilk günü.&quot;)</pre><p>Python, tırnak içine aldığımız her şeyi bir <strong>string</strong> (metin) olarak kabul edip yazdırır.</p><h3>Kod Blokları ve Yorum Satırları</h3><p>Arka arkaya birden fazla satır yazdırmak mümkündür:</p><pre>print(&#39;1. kod bloğu&#39;)<br>print(&#39;2. kod bloğu&#39;)<br>print(&#39;3. kod bloğu&#39;)</pre><p>Ayrıca, Python’da yorum satırları # işareti ile yazılır:</p><pre># bu bir yorum satırıdır</pre><p>Kod çalışırken yorum satırları dikkate alınmaz. Bu yüzden açıklama eklemek için oldukça önemlidir.</p><h3>Değişkenlerin Gücü</h3><p>Eğitimde sık sık değişkenlerin ne kadar hayat kurtarıcı olduğunu gördük. Aynı veriyi tekrar yazmak yerine, bir ismin altına tanımlayarak kullanabiliyoruz:</p><pre>sayi = 25<br>print(sayi)</pre><p>Ya da kullanıcıdan bilgi almak için:</p><pre>email = input(&quot;Lütfen email adresinizi giriniz: &quot;)<br>parola = input(&quot;Lütfen parolanızı giriniz:&quot;)</pre><h3>Python Veri Tiplerine Giriş</h3><p>Python’da temel veri tiplerini öğrendik:</p><h3>✔️ str — Metinsel Veri Tipi</h3><pre>a = &#39;selam&#39;<br>print(type(a))   # &lt;class &#39;str&#39;&gt;</pre><h3>✔️ int — Tam Sayı</h3><pre>b = 23<br>print(type(b))</pre><h3>✔️ float — Ondalıklı Sayı</h3><pre>c = 25.43<br>print(type(c))</pre><h3>✔️ list — Birden Fazla Eleman İçeren Liste</h3><pre>meyveler = [&#39;Kayısı&#39;,&#39;Elma&#39;,&#39;Armut&#39;,&#39;Üzüm&#39;]<br>print(meyveler)</pre><h3>✔️ bool — Doğru/Yanlış Değeri</h3><pre>dogru = True<br>yanlis = False</pre><h3>Karşılaştırma Operatörleri ile Mantıksal Sonuçlar</h3><p>Python’da karşılaştırma yapmak oldukça sezgiseldir:</p><pre>print(3 &lt; 5)       # True<br>print(33 &lt;= 25)    # False<br>print(25 != 35)    # True<br>print(&#39;Ömer&#39; == &#39;ömer&#39;)  # False</pre><p>Hatta Python, harfleri bile alfabetik sıraya göre karşılaştırır:</p><pre>print(&#39;A&#39; &lt; &#39;B&#39;)   # True</pre><h3>🔴 Aritmetik Operatörler</h3><p>Temel matematik işlemleri için Python adeta bir hesap makinesi gibidir:</p><pre>print(25 / 85)<br>print(10 % 3)   # mod alma<br>print(3**4)     # üslü sayı</pre><p>Metinler üzerinde bile işlem mümkün:</p><pre>ad = &#39;Ömer Faruk &#39;<br>print(ad * 3)</pre><h3>🟣 Üyelik Operatörleri (in / not in)</h3><p>Bir listenin içinde bir eleman olup olmadığını çok kolay bir şekilde kontrol ettik:</p><pre>cities = [&#39;İstanbul&#39;,&#39;Ankara&#39;,&#39;Adana&#39;,&#39;Nevşehir&#39;]</pre><pre>print(&#39;Hatay&#39; in cities)      # False<br>print(&#39;İstanbul&#39; in cities)   # True</pre><h3>🎉 Sonuç: Temeller Oturdu, Yolculuk Yeni Başlıyor</h3><p>Bugünkü eğitim, Python’a giriş yapmak isteyen herkes için mükemmel bir başlangıç niteliğindeydi. Değişkenler, veri tipleri, operatörler ve temel fonksiyonlar gibi Python’un omurgasını oluşturan konulara sağlam bir giriş yaptık.</p><p>Her satır yeni bir şey öğretti, her örnek Python’un ne kadar esnek bir dil olduğunu gösterdi. Bir sonraki derste koşullar, döngüler ve fonksiyonlar ile çok daha güçlü ve dinamik programlar yazmaya başlayacağız.</p><p>Eğer sen de Python öğrenmeye başlamak istiyorsan: <strong>hiç korkma, Python seni yormaz; aksine öğretir.</strong> 💡🐍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=598e34a4656a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IoT Destekli Akıllı Kapı Erişim Sisteminin Genel Analiz Dökümanı]]></title>
            <link>https://medium.com/@aysenaozcann/iot-destekli-ak%C4%B1ll%C4%B1-kap%C4%B1-eri%C5%9Fim-sisteminin-genel-analiz-d%C3%B6k%C3%BCman%C4%B1-0a2374c3dcaa?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a2374c3dcaa</guid>
            <category><![CDATA[business-analysis]]></category>
            <category><![CDATA[access-control]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[tech-documentation]]></category>
            <category><![CDATA[system-analysis]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 18:56:16 GMT</pubDate>
            <atom:updated>2025-06-22T12:19:08.827Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Neden Bu Projeyi Seçtim?</strong></p><p>Binalarda erişim kontrolü alanında yaşanan dönüşüm, teknolojiyle birlikte hız kazanıyor. IoT destekli akıllı kapı sistemleri, hem güvenliği artırmak hem de kullanıcı deneyimini iyileştirmek adına büyük potansiyele sahip. Ben de bu alanda, gerçek bir projede yer alarak sistemin analiz ve tasarım süreçlerinde aktif rol aldım. Bu deneyim, bana hem teknik detayları derinlemesine öğrenme hem de kullanıcı odaklı çözümler geliştirme fırsatı sundu. Bu yazıda, o deneyimlerden yola çıkarak, projenin işleyişini ve teknik gereksinimlerini detaylandırıyorum.</p><p><strong>Proje Adı: Akıllı Kapı Erişim Sistemi (IoT)</strong></p><p><strong>1. Giriş</strong> Bu proje, binalarda bulunan kapıların mobil cihazlarla uzaktan kontrol edilebildiği, kullanıcıya özel erişim imkânı sağlayan bir IoT tabanlı erişim sistemini amaçlamaktadır. Kullanıcılar mobil uygulama aracılığıyla kapıları açabilir, QR kodla geçiş yapabilir ya da kart okuyucu kullanarak kimlik doğrulaması gerçekleştirebilir. Bu sistem, güvenlik ve kullanıcı deneyimi açısından optimize edilmiş modern bir çözümdür.</p><p><strong>2. Kapsam</strong> Bu doküman, sistemin genel işleyişini, kullanıcı senaryolarını, teknik ve fonksiyonel gereksinimlerini, veri akış diyagramlarını, test senaryolarını ve potansiyel riskleri detaylandırmaktadır.</p><p><strong>3. Activity Diagram</strong> (Kullanıcı Giriş Süreci)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*JGjxCS0HBxhfDFgD6vjEUQ.png" /><figcaption>Kullanıcı giriş sürecini gösteren activity diagram</figcaption></figure><p><strong>4. Fonksiyonel Gereksinimler</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*-TMmKzvJAE68wrXq-eB6tQ.png" /></figure><p><strong>5. Non-Fonksiyonel Gereksinimler</strong></p><ul><li>Uygulama 1 saniyeden kısa sürede yanıt vermelidir.</li><li>API iletişimi TLS 1.2 ve üstü güvenlik protokolü ile yapılmalıdır.</li><li>Sistem %99.9 erişilebilirlik sağlamalıdır.</li><li>Log kayıtları en az 1 yıl süreyle saklanmalıdır.</li></ul><p><strong>6. Sequence Diagram</strong> (Kapı Açma Süreci)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0q_NkG6w7uBHHA4a_t_iAQ.png" /><figcaption>Kapı Açma sürecini gösteren sequence diagaram</figcaption></figure><p><strong>7. Test Senaryoları</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*1vg7NgQAzW3MfP6USTnrSA.png" /></figure><p><strong>8. Risk Analizi</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*Wi9DYaiHacNyy-KZshK9RA.png" /></figure><p><strong>9. Sonuç</strong> Bu analiz dokümanı, akıllı kapı erişim sistemine yönelik tüm işlevsel ve teknik bileşenleri kapsamlı şekilde ele almaktadır. Sistem; kullanıcı deneyimi, güvenlik ve entegrasyon verimliliği göz önünde bulundurularak yapılandırılmıştır. Bu doküman, geliştirici ve paydaş ekiplerin proje sürecinde ortak referans noktası olarak kullanılabilir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a2374c3dcaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOADING RELATED DATA — LAZY LOADING]]></title>
            <link>https://medium.com/@aysenaozcann/loading-related-data-lazy-loading-57e5c5711af2?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/57e5c5711af2</guid>
            <category><![CDATA[ef-core]]></category>
            <category><![CDATA[lazy-loading]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 20:05:04 GMT</pubDate>
            <atom:updated>2025-01-12T20:05:04.142Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>LOADING RELATED DATA — LAZY LOADING</strong></p><p><strong>Lazy Loading Nedir?</strong></p><p>Navigation Property’ler üzerinde bir işlem yapılmaya çalışıldığı takdirde ilgili property’nin temsil ettiği veya property’e karşılık gelen tabloya özel bir sorgu oluşturulup execute edilmesini ve verilerin yüklenmesini sağlayan bir yaklaşımdır.</p><p><strong>Proxy’lerle Lazy Loading</strong></p><p>Microsoft.EntityFrameworkCore.Proxies kütüphanesi yüklenmelidir. İki şekilde çağırılabilir;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*mkvDQiOYCmtlgz-_bQvN8Q.png" /><figcaption><strong>Proxy’lerle Lazy Loading</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*3TVhGV0HtCJfcQdMIuXoEw.png" /><figcaption><strong>Proxy’lerle Lazy Loading</strong></figcaption></figure><p>Proxy üzerinden lazy loading yapılmak istenirse navigation property’lerin virtual ile işaretlenmiş olması beklenir. Aksi takdirde kod uyarı verecektir. Örneğin Order Entity’sinde navigation property virtual ile işaretlenir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*59NGm4bAVuvmHM62lLifyw.png" /><figcaption><strong>Order Entity’sinde navigation property virtual ile işaretlenir</strong></figcaption></figure><p><strong>Proxy Olmadan Lazy Loading</strong></p><p>Proxy’ler tüm platformlarda desteklenmeyebilir. Böyle bir durumda manuel bir şekilde lazy loading’i uygulamak mecburiyetinde kalınabilir. Manuel yapılan lazy loading operasyonlarında navigation property virtual ile işaretlenmesi gerekmektedir.</p><p><strong>ILazyLoader Interface’i İle Lazy Loading</strong></p><p>Microsoft.EntityFrameworkCore.Abstractions kütüphanesinden ILazyLoader Interface’ini elde edebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*7prmXJWb-SBXaHIFfHsKbA.png" /><figcaption><strong>Microsoft.EntityFrameworkCore.Abstractions kütüphanesinden ILazyLoader Interface’ini elde edebiliriz</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*YmBvGS4mr73OKcGndBDCSg.png" /><figcaption><strong>Proxy bazlı lazy loading’i devreden çıkarmak için false’a çekeriz</strong></figcaption></figure><p>Proxy bazlı lazy loading’i devreden çıkarmak için false’a çekeriz.</p><p><strong>Delegate İle Lazy Loading</strong></p><p>ILazy Loader yerine delegate tanımlanır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*_8b6t0atIDpMy5Xfrl4Pvw.png" /><figcaption><strong>ILazy Loader yerine delegate tanımlanır</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*LPBHoCV533VrZICAwy1cOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*OmGyudgMWO8DjeJVqWYrpA.png" /></figure><p><strong>N+1 Problemi</strong></p><p>Lazy Loading, kullanım açısından oldukça maliyetli ve performans düşürücü etkiye sahip bir yöntemdir. O yüzden kullanırken olabildiğince dikkatli olmalı ve özellikle property’lerin döngüsel tetiklenme durumlarında lazy loading’i tercih etmemeye odaklanılmalıdır. Aksi takdirde her bir tetiklemeye karşılık aynı sorguları üretip execute edecektir. Bu durumu N+1 problemi olarak nitelendirmelteyiz. İlişkisel veriler yüklenirken olabildiğince lazy loading kullanılmamalıdır.</p><p>Proxy üzerinden lazy loading yapılacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*HmT71_5K5KIQ1p3m7ix-BQ.png" /><figcaption><strong>Proxy üzerinden lazy loading yapılacaktır</strong></figcaption></figure><p>Döngü her tetiklendiğinde yeni bir sorgu oluşturulur bu da kodu maliyetli hale getirir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*G8hNiwNkskFOoSBiRIpPDA.png" /><figcaption><strong>Sorgu görülmektedir</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57e5c5711af2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOADING RELATED DATA — EXPLICIT LOADING]]></title>
            <link>https://medium.com/@aysenaozcann/loading-related-data-explicit-loading-08a721f23b7c?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/08a721f23b7c</guid>
            <category><![CDATA[explicit-loading]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 19:25:19 GMT</pubDate>
            <atom:updated>2025-01-12T19:25:19.712Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>LOADING RELATED DATA — EXPLICIT LOADING</strong></p><p><strong>Explicit Loading</strong></p><p>Oluşturulan sorguya eklenecek verilerin şartlara bağlı bir şekilde ihtiyaçlara istinaden yüklenmesini sağlayan bir yaklaşımdır.</p><p><strong>Reference</strong></p><p>Explicit Loading sürecinde ilişkisel olarak sorguya eklenmek istenen tablonun navigation property’si eğer ki tekil bir türse bu tablo Reference ile sorguya eklenebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*HhknLRb9u_iheRvu3zVnaQ.png" /><figcaption><strong>Tablo Reference ile sorguya eklenir.</strong></figcaption></figure><p><strong>Collection</strong></p><p>Explicit Loading sürecinde ilişkisel olarak sorguya eklenmek istenen tablonun navigation property’si eğer ki çoğul koleksiyonel bir türse bu tablo Collection ile sorguya eklenebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*gANGZFdeC9ciMIjSUaqTUQ.png" /><figcaption><strong>Tablo Reference ile sorguya eklenir</strong></figcaption></figure><p><strong>Collection’larda Aggregate Operatör Uygulamak</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*6obrsW6lc6QuKvWTrQzEDw.png" /><figcaption><strong>Collection’larda Aggregate Operatör Uygulamak</strong></figcaption></figure><p><strong>Collection’larda Filtreleme Gerçekleştirmek</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*LkXNJStzpSuUdmKtOrkKLg.png" /><figcaption><strong>Collection’larda Filtreleme Gerçekleştirmek</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08a721f23b7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOADING RELATED DATA — EAGER LOADING]]></title>
            <link>https://medium.com/@aysenaozcann/loading-related-data-eager-loading-21d854a25857?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/21d854a25857</guid>
            <category><![CDATA[loading-related]]></category>
            <category><![CDATA[data-eager-loading]]></category>
            <category><![CDATA[ef-core]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 18:35:24 GMT</pubDate>
            <atom:updated>2025-01-09T18:35:24.119Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>LOADING RELATED DATA — EAGER LOADING</strong></p><p><strong>Eager Loading</strong></p><p>Eager Loading, generate edilen bir sorguya ilişkisel verilerin parça parça eklenmesini kontrollü bir şekilde yapmayı sağlayan yöntemdir. Arka planda üretilen sorguya uygun Join’i uygular.</p><p><strong>Include</strong></p><p>Eager loading operasyonunu yapmamızı sağlayan bir fonksiyondur. Yani üretilen bir sorguya diğer ilişkisel tabloların dahil edilmesini sağlayan bir işleve sahiptir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*NyNZtLazhq2csMvWyt-TIA.png" /><figcaption><strong>Include</strong></figcaption></figure><p><strong>ThenInclude</strong></p><p>Üretilen sorguda Include edilen tabloların ilişkili olduğu diğer tabloları da sorguya ekleyebilmek için kullanılan bir fonksiyondur. Eğer üretilen sorguya include edilen navigation property koleksiyonel bir property’se işte o zaman bu property üzerinden diğer ilişkisel tabloya erişim gösterilememektedir. Böyle bir durumda koleksiyonel property’lerin türlerine erişip, o tür ile ilişkili diğer tabloları da sorguya eklememizi sağlayan fonksiyondur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*lV4-qDYTYrIIVUcNoXQiXQ.png" /><figcaption><strong>ThenInclude</strong></figcaption></figure><p><strong>FiteredInclude</strong></p><p>Sorgulama süreçlerinde Include yaparken sonuçlar üzerinde filtreleme ve sıralama gerçekleştirebilmemizi sağlayan bir özelliktir. Desteklenen fonksiyonlar; Where, OrderBy, OrderByDescending, ThenBy, ThenByDescending, Skip, Take.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*407eijbrQAHhY6KGunMdfw.png" /><figcaption><strong>FiteredInclude</strong></figcaption></figure><p>ChangeTracker’ın aktif olduğu durumlarda Include edilmiş sorgular üzerindeki filtreleme sonuçları beklenmeyen olabilir. Bu durum, daha önce sorgulanmış ve ChangeTracker tarafından takip edilmiş veriler arasında filtrenin şartı dışında kalan veriler için söz konusu olacaktır. Bundan dolayı sağlıklı bir filtered include operasyonu için ChangeTracker’ın kullanılmadığı sorguları tercih edilmelidir.</p><p><strong>EF Core, önceden üretilmiş ve execute edilerek verileri belleğe alınmış olan sorguların verileri, sonraki sorgularda kullanır.</strong></p><p>İlk sorguda Orders tablosu belleğe alınmıştır, ikinci sorguda include ile Orders tablosunu çağırmaya gerek yoktur ekstra maliyete sebep olur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*J3K4aZhIvQOfmcxH9ANGoQ.png" /><figcaption><strong>İkinci sorguda include ile Orders tablosunu çağırmaya gerek yoktur ekstra maliyete sebep olur.</strong></figcaption></figure><p><strong>AutoInclude — EF Core 6</strong></p><p>Uygulama seviyesinde bir entity’e karşılık yapılan tüm sorgulamalarda kesinlikle bir tabloya Include işlemi gerçekleştirilecekse eğer bunu her bir sorgu için tek tek yapmaktansa merkezi bir hale getirmemizi sağlayan özelliktir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*oRSr1aoJCGoUwyEMVc7JQA.png" /><figcaption><strong>AutoInclude</strong></figcaption></figure><p>Region’un geldiği görülür.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*ey_tRSPHcCbqXPO_RhHfug.png" /><figcaption><strong>Region’un geldiği görülür.</strong></figcaption></figure><p><strong>IgnoreAutoIncludes</strong></p><p>AutoInclude’u kullanılmak istenilmediği sorgularda IgnoreAutoIncludes’u kullanarak<strong> </strong>ihmal edebiliriz. AutoInclude’u sorgu seviyesinde pasifize edebilmek için kullanılan fonksiyondur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*vWYiIwifbXVAYaxvBdrTbg.png" /><figcaption><strong>IgnoreAutoIncludes</strong></figcaption></figure><p>Region’un null geldiği görülür.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*xGUsRhWX_Ub1k5ai3HNgoQ.png" /><figcaption><strong>Region’un null geldiği görülür.</strong></figcaption></figure><p><strong>Birbirinden Türetilmiş Entity’ler Arasında Include</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*pEdlrGwYVLuDhCvJab2hBg.png" /><figcaption><strong>Birbirinden Türetilmiş Entity’ler Arasında Include</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21d854a25857" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EF CORE’DA SEQUENCE]]></title>
            <link>https://medium.com/@aysenaozcann/ef-coreda-sequence-6b905d62d98d?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b905d62d98d</guid>
            <category><![CDATA[ef-core-sequence]]></category>
            <category><![CDATA[ef-core]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Wed, 08 Jan 2025 19:22:51 GMT</pubDate>
            <atom:updated>2025-01-08T19:22:51.124Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>EF CORE’DA SEQUENCE</strong></p><p><strong>Sequence Nedir?</strong></p><p>Veritabanında benzersiz ve ardışık sayısal değerler üreten veritabanı nesnesidir. Sequence herhangi bir tablonun özelliği değildir, veritabanı nesnesidir. Birden fazla tablo tarafında kullanılabilir</p><p><strong>Sequence Nasıl Tanımlanır?</strong></p><p>Sadece Fluent API üzerinden tanımlanır. Sequence’ler üzerinden değer oluşturuken veritabanına özgü çalışma yapılması mecburidir. Ms Sql Server’a özel yazılan Sequence tanımı Oracle için hata verebilir.</p><p>HasSequence: Sequence tanımlamak için kullanılır.</p><p>HasDefaultValueSql: Sequence’in hangi kolona karşılık kullanılacağını bildiren fonksiyondur.</p><p>Employee ve Customer tabloları için kullanılacak Sequence’i tanımlama;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*9tMszs5G69Xsgn91JgRMhA.png" /><figcaption><strong>Sequence’i tanımlama</strong></figcaption></figure><p>Tanımlanmış olan EC_Sequence üzerinden Id kolonu için bir sonraki değeri getirmesi istenir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*6b237emSQiLL07d7mVmKPA.png" /><figcaption><strong>Tanımlanmış olan EC_Sequence üzerinden Id kolonu için bir sonraki değeri getirmesi istenir.</strong></figcaption></figure><p>Id’nin artış üzelliği Identity’den gelmez, Sequence üzerinden gelir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*S1qyniwnh82y98c6TJFUMw.png" /><figcaption><strong>Sql’de Identity Specification</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*0KNklqZ1liRDU-JUFkiR2A.png" /><figcaption><strong>Sql’de sequence</strong></figcaption></figure><p>Context üzerinden Employee’e veri eklenir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*Kyu4EsJLMa1_K_D0vAjT7A.png" /><figcaption><strong>Employee’ veri eklenir</strong></figcaption></figure><p>Her iki tablo için tek bir sequence nesnesi kullanıldığından o nesne üzerinden artış gerçekleştiği görülür.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*UaVqtjTw-o83_FwVyzC00w.png" /><figcaption><strong>Nesne üzerinden artış gerçekleştiği görülür.</strong></figcaption></figure><p><strong>Sequence Yapılandrıması</strong></p><p>StartsAt: Sequence’in kaçtan başlayacağını ifade eder.</p><p>IncrementsBy: Sequence’in kaçar kaçar artacağını ifade eder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*bqiTZ4yCv2ZZWReyW1kHcQ.png" /><figcaption><strong>StartsAt, IncrementsBy</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*KdOpxNKwY96dHHUa5r6fDQ.png" /><figcaption><strong>Migration</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*xEjWqvXXurTAosiOi6p-dQ.png" /><figcaption><strong>StartsAt ve IncrementsBy ile yapılan ayarlamalar Sql’de görülür</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*6ON8xyR76u8IixDxBbUvPQ.png" /><figcaption><strong>Id kolonuhnda buluna sayıları 100&#39;den başladığı ve 5&#39;er 5&#39;er arttığı görülür</strong></figcaption></figure><p><strong>Sequence vs Indentity</strong></p><p>Sequence bir veritabanı nesnesiyken Indentity herhangi bir tablo içerisindeki özelliktir. Sequence veritabanı nesnesi olduğu için herhangi bir tabloya bağımlıdır, bir sequence istenilen kadar sayıda tablo ile kullanılabilir. Indentity’den farkı identity bir sonraki değeri diskten alırken sequence ise ramden alır. Bu yüzden Sequence Identity’e göre daha hızlı ve performanslıdır.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b905d62d98d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EF CORE’DA INDEX]]></title>
            <link>https://medium.com/@aysenaozcann/ef-coreda-index-3b7db8b29ce7?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b7db8b29ce7</guid>
            <category><![CDATA[index]]></category>
            <category><![CDATA[ef-core]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Tue, 07 Jan 2025 10:11:28 GMT</pubDate>
            <atom:updated>2025-01-07T10:11:28.842Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>EF CORE’DA INDEX</strong></p><p><strong>Index Nedir?</strong></p><p>Index, bir sütuna dayalı sorgulamaları daha verimli ve performanslı hale getirmek için kullanılan yapıdır. Tablolarda yoğun olarak sorgulama yapılacak kolonlar için index’leme yapılır. Her kolon için index’leme yazmak verimli değildir çünkü veritabanı maliyetini artırır.</p><p><strong>Index’leme Nasıl Yapılır?</strong></p><p>Primary Key, Foreign Key veya Alternate Key olan kolonlar otomatik olarak indexlenir. Indexleme, Data Annottations Attiributes ile veya Fluent API ile yapılır.</p><p><strong>Index Attiribute</strong></p><p>Index Attiribute’u sadece class’lar seviyesinde kullanılır metot veya property seviyesinde kullanılamaz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*BAmwDSU3u5FGr0eKB6tEWQ.png" /><figcaption><strong>İndekslenmiş olan “Name” için sorgu yazılır</strong></figcaption></figure><p>İndekslenmiş olan “Name” için yazılan sorgulamalar daha az maliyetli ve daha performanslıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*1I37dRlHneX3OPFeqve9UQ.png" /><figcaption><strong>Index Attiribute</strong></figcaption></figure><p><strong>HasIndex Metodu</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*FgoEH3QRXJsvITAJDkxF2w.png" /><figcaption><strong>HasIndex Metodu</strong></figcaption></figure><p><strong>Composite Index</strong></p><p>Name ve Surname composite olarak index’lenebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*cCRThHl93NaratB929u4Mg.png" /><figcaption><strong>Composite Index</strong></figcaption></figure><p>Index Attiribute’u ile Composite Index</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*_NREy4HsbQfcTSy7Uc_h2w.png" /><figcaption><strong>Index Attiribute’u ile Composite Index</strong></figcaption></figure><p>HasIndex Metodu ile Composite Index</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*Gs_A2oz8NiufNrsHV0ma3A.png" /><figcaption><strong>HasIndex Metodu</strong></figcaption></figure><p><strong>Birden Fazla Index Tanımlama</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*jsKUHvYcNziRI_q86rLzLA.png" /><figcaption><strong>Birden fazla index tanımlanır</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*9_jiwhue__VdsVk66L6YmA.png" /><figcaption><strong>Database’deki görünüm</strong></figcaption></figure><p>Composite olarak indexlenen property’ler sorgularda ayrı ayrı çağırıldığı durumlarda composite index işlevsizdir. Property’lerin kendi başlarına da index’lenmeleri gerekir. Örneğin Name ve Surname composite olarak index’lenmişse sorgu da sadece Name çağırılırsa composite index bir şey ifade etmez. Name’in tek başına index’lenmiş olması gerekir.</p><p><strong>Index Uniqueness</strong></p><p>Index’lenmiş property’leri unique hale getirir. Unique hale gelen property’lere tekrar eden kayıtlar girilemez.</p><p><strong>Data Annottations Attiribute</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*Htmy4kshBxkvd_At7iqWEg.png" /><figcaption><strong>IsUnique Data Annottations Attiribute</strong></figcaption></figure><p><strong>Fluent API</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*C6_XoKm6Fj9gh4X5YdmLww.png" /><figcaption><strong>Fluent Api’de IsUnique</strong></figcaption></figure><p><strong>Index Sort Order (Sıralama Düzeni EF Core 7)</strong></p><p>Index oluşturulduğunda sıralama davranışı default olarak ascending’tir. Descending hale getirebilmek için üç farklı davranış vardır;</p><p><strong>AllDescending (Attribute)</strong></p><p>Tüm indexlemelerde descending davranışının bütünsel olarak konfigürasyonunu sağlar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*HyqzWR0wdj2fX4wRvv3uIA.png" /><figcaption><strong>AllDescending (Attribute)</strong></figcaption></figure><p><strong>IsDescending (Attribute)</strong></p><p>Index’leme sürecindeki her bir kolona göre sıralama davranışını hususi ayarlanması isteniyorsa kullanılır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*mBqwbQoCTgZwBrdcJrtYbQ.png" /><figcaption><strong>IsDescending (Attribute)</strong></figcaption></figure><p><strong>IsDescending Metodu (Fluent API)</strong></p><p>Name descending olmuştur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*RDSdjYH4i2yW_av6VHEc7A.png" /><figcaption><strong>IsDescending Metodu (Fluent API)</strong></figcaption></figure><p>Name descending Surname ise ascending olarak sıralanmıştır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*CihCaGB4a2zwxA9EPixASw.png" /><figcaption><strong>Fluent API’da IsDescending Metodu ile Name azalan Surname ise artan olarak sırlanmıştır</strong></figcaption></figure><p><strong>Index Name</strong></p><p>Name Property’si;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*jpohD3dOzXf2LAgRgBP9nA.png" /><figcaption><strong>Index Name</strong></figcaption></figure><p><strong>HasDatabaseName Metodu</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*2YnBRCsmJzQGe0YB96tWpQ.png" /><figcaption><strong>HasDatabaseName Metodu</strong></figcaption></figure><p><strong>HasFiter Metodu</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*hLjTZ8Dodyql37ioRuQdVw.png" /><figcaption><strong>HasFiter Metodu</strong></figcaption></figure><p><strong>Included Columns | IncludeProperties Metodu</strong></p><p>Include özelliği sayesinde select sürecinde index’lenmemiş kolonlar da index tablosuna eklenebilir. Örneğin Salary kolonu index’lenmediği halde select sürecinde maliyetli bir kod oluşturmamak adına include ile index’lenmiş hale getirilebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*3nR3dhyt0cMbNf75nYx6HQ.png" /><figcaption><strong>Salary kolonu index’lenmediği halde select sürecinde maliyetli bir kod oluşturmamak adına include ile index’lenmiş hale getirilebilir</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*DdTxoGWfs9v2ingOotm57w.png" /><figcaption><strong>IncludeProperties Metodu</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b7db8b29ce7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EF CORE’DA CONSTRAINT]]></title>
            <link>https://medium.com/@aysenaozcann/ef-coreda-constraint-798aecd27d65?source=rss-53c10e8882cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/798aecd27d65</guid>
            <category><![CDATA[ef-core]]></category>
            <dc:creator><![CDATA[Aysena Özcan]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 18:57:07 GMT</pubDate>
            <atom:updated>2025-01-06T18:57:07.972Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>EF CORE’DA CONSTRAINT</strong></p><p><strong>Primary Key Constraint</strong></p><p>Bir kolonu Primary Key Constraint ile birincil anahtar yapmak istiyorsak bunun için name convention’dan istifade edebiliriz. Id, ID, EntityNameId, EntityNameID şeklinde tanımlanan tüm property’ler default olarak EF Core tarafında Primary Key Constraint olacak şekilde generate edilirler. Farklı bir property’e Primary Key özelliğini atamak isteniyorsa burada HasKey Fluent API’ı veya Key attribute’u ile bildirim yapılabilir.</p><p><strong>Alternate Keys- HasAlternate Keys</strong></p><p>Bir entity içerisinde Primary Key’e ek olarak her entiy instance’ı için alternatif bir benzersiz tanımlayıcı işlevine sahip olan bir key’dir. Alternate Keys yapılanması veritabanı seviyesinde unique bir yapılanmaya karşılık gelir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*T_VXEkGwKsswG7Y69FyVdA.png" /><figcaption><strong>HasAlternateKey</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*OoHeVuGDvDUhLMbQWYhvkw.png" /><figcaption><strong>Veritabanında yapılan değişiklik görülür</strong></figcaption></figure><p><strong>Composite Alternate Key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*AWbTe7LRlnX5NZzUsBIB0A.png" /><figcaption><strong>HasAlternateKey</strong></figcaption></figure><p>Url ve BlogName property’lerinin aynı anda unique olması bekleniyorsa Composite Alternate Key kullanılabilir. (Tıpkı Composite Primary Key gibi)</p><p><strong>Foreign Key Constraint</strong></p><p>Fluent API’da Foreign Key belirleme</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*EkTSWiInl4yUT_h-1SMt3w.png" /><figcaption>HasForeignKey</figcaption></figure><p><strong>Composite Foreign Key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*uqgQTIE6N4LqwqkNP1VdNw.png" /><figcaption><strong>HasForeignKey</strong></figcaption></figure><p><strong>Shadow Property Üzerinden Foreign Key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*W0fvqSy4y6IJIUig98uW9w.png" /><figcaption><strong>HasForeignKey</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*wtLxMdd0u34NNdlDdVGx1Q.png" /><figcaption><strong>Shadow Property Üzerinden Foreign Key</strong></figcaption></figure><p><strong>Unique Constraint</strong></p><p>Unique Constraint’in uygulandığı kolonu tekilleştirir, tekrarlayan kayıtları önler.</p><p><strong>Index, IsUnique (Data Attiributes) — HasIndex (Fluent API) Fonksiyonları</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*Pfg0n9p3j_39pku7IqZ1Pw.png" /><figcaption><strong>Index, IsUnique (Data Attiributes)</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*W4a-8ANkvBpxkGrfbXNkyw.png" /><figcaption><strong>HasIndex (Fluent API)</strong></figcaption></figure><p><strong>Alternate Key</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*nY2R3J0Ea6Gz5xTlkOlrXA.png" /><figcaption><strong>HasAlternateKey</strong></figcaption></figure><p><strong>Check Constraint</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*112cB_dvFA1Zffn1nl77ZA.png" /><figcaption><strong>HasCheckConstraint</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=798aecd27d65" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>