<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: selcuk yildirim</title>
    <description>The latest articles on DEV Community by selcuk yildirim (@selcukyildirim).</description>
    <link>https://dev.to/selcukyildirim</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2014472%2F1a27ad7f-2550-48a4-8d45-55eaa895c27a.png</url>
      <title>DEV Community: selcuk yildirim</title>
      <link>https://dev.to/selcukyildirim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/selcukyildirim"/>
    <language>en</language>
    <item>
      <title>A Fresh Perspective: Pragmatic and Adaptive Approaches to SOLID Principles</title>
      <dc:creator>selcuk yildirim</dc:creator>
      <pubDate>Fri, 06 Sep 2024 11:24:16 +0000</pubDate>
      <link>https://dev.to/selcukyildirim/a-fresh-perspective-pragmatic-and-adaptive-approaches-to-solid-principles-57d7</link>
      <guid>https://dev.to/selcukyildirim/a-fresh-perspective-pragmatic-and-adaptive-approaches-to-solid-principles-57d7</guid>
      <description>&lt;p&gt;Hey team! 🌍&lt;/p&gt;

&lt;p&gt;In software development, SOLID principles have long been considered a gold standard for creating clean, maintainable code. However, in practice, rigidly adhering to these principles can sometimes introduce unnecessary complexity and hinder flexibility. Here, we explore each SOLID principle from a different perspective, suggesting alternative approaches that can be more practical and adaptable in modern development contexts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Single Responsibility Principle (SRP) – Rethinking the “Single Responsibility”&lt;/strong&gt;&lt;br&gt;
The SRP states that every class should have only one responsibility. However, in contemporary software projects, it might not always be practical or efficient to adhere strictly to this rule. For instance, in a web application, a UserService class might need to handle multiple tasks like creating, updating, and deleting users. Sticking rigidly to SRP could lead to the creation of numerous tiny classes, which can increase unnecessary complexity and reduce code maintainability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Approach: ‘Contextual Responsibility’&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of insisting on a single responsibility for every class, it might be more effective for classes to carry multiple, related responsibilities within a specific domain. For example, a UserManager class could handle all tasks related to user management. This approach keeps the code more understandable and avoids the over-fragmentation of responsibilities while still adhering to the spirit of SRP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Open/Closed Principle (OCP) – The “Open to Extension, Closed to Modification” Paradox&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The OCP suggests that software entities should be open for extension but closed for modification. However, this principle can sometimes lead to overly abstract and complex codebases. Creating new classes for every new functionality instead of modifying existing code can make the software harder to understand and lead to unnecessary growth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Approach: ‘Evolutionary Development’&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Allowing the code to evolve organically as needs change may be more practical in certain cases. Instead of enforcing strict adherence to OCP, developers can modify existing code directly and optimize it when adding new features. This avoids unnecessary abstractions and complexities while keeping the code adaptable to change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Liskov Substitution Principle (LSP) – The “Strict Substitutability” Dilemma&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;LSP states that derived classes should be substitutable for their base classes. However, in modern software development, strict application of this principle might not always be meaningful. Forcing every subclass to support all the functionalities of its base class can lead to redundant code and unnecessary complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Approach: ‘Functional Compatibility’&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of enforcing complete substitutability, it can be more effective to ensure that subclasses are only compatible with the base class where it makes logical sense. For example, a Penguin subclass under an Animal base class might not need to support a fly method. By focusing on logical compatibility, the code remains more straightforward and easier to maintain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Interface Segregation Principle (ISP) – The “Minimal Interface” Misconception&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ISP encourages that classes should only depend on the interfaces they need. However, creating separate interfaces for every small function can make the software harder to read and manage. Excessively granular interfaces can lead to unnecessary fragmentation and complexity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Approach: ‘Context-Oriented Interfaces’&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of splitting interfaces too finely, a more flexible interpretation of ISP can be applied by grouping related functionalities within context-based interfaces. This reduces the number of interfaces, making the codebase more manageable and readable while maintaining modularity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Dependency Inversion Principle (DIP) – The “Everything Must Be Abstracted” Fallacy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DIP states that high-level modules should not depend on low-level modules, but both should depend on abstractions. However, over-abstracting every dependency can lead to an overly complex code structure, slowing down development and making the code harder to understand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alternative Approach: ‘Pragmatic Dependency Management’&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Abstractions should only be used where necessary. Instead of abstracting every single dependency, focus on abstracting only critical dependencies that impact the flexibility and sustainability of the software. This approach keeps the code lean and easier to understand by avoiding unnecessary abstractions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion: Embracing a New, Flexible Approach to SOLID&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While SOLID principles provide valuable guidelines, their rigid application can sometimes increase complexity and reduce flexibility. By adopting a context-aware, pragmatic approach to these principles, developers can create more maintainable and adaptive software. Rethinking SOLID principles in this way ensures that the code remains efficient, sustainable, and aligned with the real-world needs of the project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>“O Olmazcı” Yazılımcılar: Ürün Ekiplerinin Korkulu Rüyası</title>
      <dc:creator>selcuk yildirim</dc:creator>
      <pubDate>Tue, 03 Sep 2024 10:50:39 +0000</pubDate>
      <link>https://dev.to/selcukyildirim/o-olmazci-yazilimcilar-urun-ekiplerinin-korkulu-ruyasi-366l</link>
      <guid>https://dev.to/selcukyildirim/o-olmazci-yazilimcilar-urun-ekiplerinin-korkulu-ruyasi-366l</guid>
      <description>&lt;p&gt;Hey team! 🌍&lt;/p&gt;

&lt;p&gt;Ürün ekibinin müthiş bir fikirle toplantıya girdiği, gözlerinin heyecandan parladığı o anları hatırlıyor musunuz? “Yeni özellikler, kullanıcıyı daha da mutlu edecek geliştirmeler ve büyük bir lansman…” Ama sonra, o olur ya, toplantının köşesinde oturan bir yazılımcı derin bir nefes alır ve “Olmaz…” der. İşte, ürün ekiplerinin kabusu “o olmazcı” yazılımcılar sahnede!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;O Olmazcı Kimdir?&lt;/strong&gt;&lt;br&gt;
“O olmazcı” yazılımcı (derneği kurulsa başkanı olurum 🤪), her projede, her şirkette karşımıza çıkan o yazılımcıdır. Ürün ekibinin ortaya attığı yenilikçi ve heyecan verici her fikre bir “olmaz” diyerek cevap verir. Ama yanlış anlaşılmasın; bu, o yazılımcının huysuz, olumsuz veya tembel olduğundan değil. Aslında, tam tersi: Onlar, bir işin gerçekten yapılabilir olduğundan emin olmak için anında zihninde binlerce satır kodu çalıştıran, muhtemel hata senaryolarını ve performans problemlerini anında görebilen dahilerden biridir! (ben kıllığına yapıyorum 🤪)&lt;/p&gt;

&lt;p&gt;Ama maalesef, “olmaz” kelimesi ürün ekibinin moralini yerle bir eder.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ürün Ekiplerinin Kabusu&lt;/strong&gt;&lt;br&gt;
Ürün ekiplerinin bakış açısına göre, yazılımcıların “olmaz” demesi, onların heyecanlarını ve yenilikçi ruhlarını baltalayan bir darbe gibidir. “Olmaz” kelimesi, yaratıcı fikirlerin üstüne serilen soğuk bir buz gibi gelebilir. Peki ya bu aslında bir yardım çığlığıysa? Ya yazılımcılar sadece, projelerin son kullanıcıya mükemmel bir şekilde ulaşması için gerekli olan binlerce teknik ayrıntıyı düşünüyorsa?&lt;/p&gt;

&lt;p&gt;Bir ürün ekibinin en büyük hayali, fikirlerinin hızla hayata geçirilmesidir. Ancak yazılımcıların karşılaştığı teknik zorluklar, bu süreci yavaşlatabilir. Ürün ekibi “Kullanıcı profilini kişiselleştirelim!” diye önerdiğinde, yazılımcının aklında aniden güvenlik açıkları, performans düşüşleri ve beklenmedik hatalar canlanır.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yazılımcının Bakış Açısı&lt;/strong&gt;&lt;br&gt;
Yazılımcılar, hızla çözüm bulmaya ve teknik olarak her detayı düşünmeye odaklanmıştır. Çoğu zaman, çözüm odaklı bir yaklaşımla “olmaz” dediklerinde, aslında “Bu şekilde olmaz ama başka bir yolu olabilir” demek istemektedirler. Ancak, hızlı düşünmek bazen düşündüğün ile anlattığın arasında farklara sebep olabilir. Hızlı düşünme ve anlatma arasındaki bu kopukluk, yanlış anlaşılmalara neden olabilir.&lt;/p&gt;

&lt;p&gt;Yazılımcılar genellikle bir problemi hızla analiz eder ve mevcut teknoloji yığını, sistem mimarisi ve kullanıcı gereksinimlerine göre anında bir yargıya varır. Ancak, bu yargının arkasındaki mantığı ifade etmek bazen zor olabilir. “Olmaz” aslında “Bir dakika, bu sorunu en iyi şekilde çözmenin yolunu bulmalıyım” anlamına gelir.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Çözüm: Köprüleri Kurmak&lt;/strong&gt;&lt;br&gt;
Peki, bu iki ekip arasındaki bu anlaşmazlıkları nasıl çözebiliriz? İşte bazı öneriler:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Açık İletişim:&lt;/strong&gt; Ürün ekipleri ve yazılımcılar birbirlerini anlamak için daha fazla zaman ayırmalı. “Olmaz” kelimesinin ardındaki endişeleri anlamak ve bu endişeleri gidermek için açık bir diyalog kurulmalıdır.&lt;br&gt;
&lt;strong&gt;2.Prototipleme ve Hızlı Testler:&lt;/strong&gt; Bir fikrin uygulanabilir olup olmadığını görmek için küçük prototipler ve hızlı testler yapılabilir. Bu, hem ürün ekiplerinin hem de yazılımcıların fikirlerini görselleştirmesine yardımcı olabilir.&lt;br&gt;
3*&lt;em&gt;.Esprili Yaklaşımlar:&lt;/em&gt;* Ekiplerin birbirleriyle olan etkileşimlerini daha keyifli hale getirmek için mizahi bir dil kullanmak, gergin anları hafifletebilir. Örneğin, toplantı odasının duvarında “O olmazcı’nın Günlüğü” köşesi açılabilir ve yazılımcıların “olmaz” deme nedenleri esprili bir dille paylaşılabilir.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Velhasıl Kelam …&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yazılım ekipleri ve ürün ekipleri aslında aynı hedefe doğru ilerleyen iki farklı dünyadır.Kullanıcılara en iyi deneyimi sunmak. Ancak bu yolculukta, farklı düşünme şekilleri ve öncelikler bazen çatışmalara yol açabilir. “O olmazcı” yazılımcılar, aslında projelerin başarıya ulaşması için gerekli olan teknik bilginin ve analitik düşüncenin savunucularıdır. Ürün ekipleri ise kullanıcı odaklı düşünmenin ve yenilikçiliğin temsilcileridir.&lt;/p&gt;

&lt;p&gt;İletişim, mizah ve karşılıklı anlayış ile bu iki dünyayı bir araya getirmek mümkün. Unutulmamalıdır ki, “olmaz” her zaman son söz değildir; bazen sadece “biraz daha düşünelim” demektir. Her iki ekip de birbirlerinin perspektiflerini anlamaya çalıştıkça, bu zorlu süreçler daha az stresli, daha eğlenceli ve kesinlikle daha verimli hale gelecektir.&lt;/p&gt;

&lt;p&gt;Ve unutmayalım, bir sonraki toplantıda “olmaz” diyen yazılımcıya bir kahve ısmarlamak her zaman işe yarar!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>NET 8 and Microservices: New Tools and Techniques to Integrate</title>
      <dc:creator>selcuk yildirim</dc:creator>
      <pubDate>Mon, 02 Sep 2024 09:19:10 +0000</pubDate>
      <link>https://dev.to/selcukyildirim/net-8-and-microservices-new-tools-and-techniques-to-integrate-5g5d</link>
      <guid>https://dev.to/selcukyildirim/net-8-and-microservices-new-tools-and-techniques-to-integrate-5g5d</guid>
      <description>&lt;p&gt;Hey team! 🌍&lt;/p&gt;

&lt;p&gt;If you've been in the development world for a while, you've likely seen the increasing adoption of microservices architectures. They offer flexibility, scalability, and a more efficient way to build complex applications. Now, with NET 8 on the scene, there are some new tools and techniques that make working with microservices even better. Let's dive into what's new and how you can take advantage of these updates in your next project!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;Improved gRPC Support for Microservices Communication 📡&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest challenges with microservices is communication between different services. That’s where gRPC comes in. With NET 8, gRPC support has been significantly enhanced to provide a more reliable and efficient way for services to communicate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's New?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Better HTTP/3 Integration&lt;/strong&gt; : NET 8 offers improved integration with HTTP/3, which is optimized for faster and more secure connections. This makes your microservices more responsive and reduces latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streaming Support&lt;/strong&gt;: Now, gRPC in NET 8 has better support for real-time streaming, which is perfect for scenarios where services need to exchange data continuously, like real-time analytics or monitoring tools. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code Example&lt;/strong&gt; : &lt;strong&gt;Setting Up a Basic gRPC Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's a simple example to show you how to set up a basic gRPC service in&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Grpc.Core;
using Microsoft.Extensions.Hosting;

public class Program
{
    public static void Main(string[] args)
    {
        var host = Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =&amp;gt;
            {
                webBuilder.UseStartup&amp;lt;Startup&amp;gt;();
            })
            .Build();

        host.Run();
    }
}

public class GreeterService : Greeter.GreeterBase
{
    public override Task&amp;lt;HelloReply&amp;gt; SayHello(HelloRequest request, ServerCallContext context)
    {
        return Task.FromResult(new HelloReply
        {
            Message = "Hello " + request.Name
        });
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above code, we're setting up a basic gRPC server that listens for incoming requests and responds with a simple message. You can see how easy it is to get started with gRPC in .NET 8!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;. &lt;strong&gt;Enhanced Distributed Tracing and Observability&lt;/strong&gt; 🔍&lt;/p&gt;

&lt;p&gt;Monitoring and troubleshooting microservices can sometimes feel like finding a needle in a haystack. But NET 8 brings some new features to make this easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's New?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OpenTelemetry Integration&lt;/strong&gt; : NET 8 has better support for OpenTelemetry, a set of APIs and tools to help you collect and analyze telemetry data from your services. This makes it easier to understand what’s happening in your system in real-time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code Example : Setting Up OpenTelemetry in NET 8&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To enable OpenTelemetry for distributed tracing in your microservices, you can use the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddOpenTelemetryTracing(builder =&amp;gt; builder
            .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyMicroservice"))
            .AddAspNetCoreInstrumentation()
            .AddHttpClientInstrumentation()
            .AddJaegerExporter());
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        // Standard ASP.NET Core middleware setup...
    }
}

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

&lt;/div&gt;



&lt;p&gt;With just a few lines of code, you’ve set up OpenTelemetry in your .NET 8 microservices app, ready to export traces to a Jaeger backend for analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Simplified Deployment with Dapr Integration 🚀&lt;/strong&gt;&lt;br&gt;
Dapr (Distributed Application Runtime) is another tool that makes working with microservices easier. It helps handle state management, service discovery, pub/sub messaging, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What's New?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Improved Dapr Integration&lt;/strong&gt; : NET 8 offers tighter integration with Dapr, making it easier to add reliable communication patterns, state management, and more to your microservices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code Example : Using Dapr with .NET 8&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s a basic example of how to use Dapr in a .NET 8 microservice:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class WeatherService
{
    private readonly DaprClient _daprClient;

    public WeatherService(DaprClient daprClient)
    {
        _daprClient = daprClient;
    }

    public async Task&amp;lt;WeatherForecast&amp;gt; GetForecastAsync(string city)
    {
        var state = await _daprClient.GetStateAsync&amp;lt;WeatherForecast&amp;gt;("statestore", city);
        return state;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this setup, we’re using Dapr to handle state management for a weather forecasting service. It’s simple, efficient, and scales well with your app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion 🏁&lt;/strong&gt;&lt;br&gt;
 NET 8 is making microservices development more powerful and easier than ever before. With improved gRPC communication, enhanced observability tools like OpenTelemetry, and better Dapr integration, you’ve got a full toolbox to build reliable and scalable microservices.&lt;/p&gt;

&lt;p&gt;By the way, if you noticed any mistakes or if things weren’t clear in this first write-up, my bad! 😅 I’m still learning and always looking to improve. Appreciate your patience, and thanks for sticking with me! Sending love to you all! 💖 Keep coding and keep experimenting – the best is yet to come! 🚀&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
