<?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 Erdem Dirican on Medium]]></title>
        <description><![CDATA[Stories by Erdem Dirican on Medium]]></description>
        <link>https://medium.com/@erdemdirican?source=rss-c0dafba8c0c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6Um6bALyO7cdN7mKtl314g.jpeg</url>
            <title>Stories by Erdem Dirican on Medium</title>
            <link>https://medium.com/@erdemdirican?source=rss-c0dafba8c0c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:18:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erdemdirican/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[Domain-Driven Design]]></title>
            <link>https://medium.com/@erdemdirican/domain-driven-design-9f48ca37af5a?source=rss-c0dafba8c0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f48ca37af5a</guid>
            <dc:creator><![CDATA[Erdem Dirican]]></dc:creator>
            <pubDate>Mon, 10 Apr 2023 13:39:28 GMT</pubDate>
            <atom:updated>2023-04-10T13:39:28.474Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JCo7t_aIpbsKhifmPEDqpw.jpeg" /></figure><h4><strong>What is Domain Driven Design?</strong></h4><p>Domain Driven Design can be defined as an effort to fully understand the business problem before and during the coding process to solve a complex business problem. According to this understanding, all components of the software should be shaped around the domain objects contained within the application. The modeling of these objects influences the design of all components such as the database, user interface, business rules, and even data storage strategies.</p><p>DDD combines a set of concepts from many disciplines. These concepts include Aggregate, Entity, Value Object, Repository, Service, Bounded Context and Context Mapping. These concepts are used when modeling domain objects, and domain objects modeled affect all components used in application development.</p><h4><strong>Domain Driven Design Application Methods</strong></h4><p>DDD can be implemented using many different methods in the implementation process. Some of these are:</p><h4><strong>Strategic Phase</strong></h4><h4><strong>Ubiquitous Language</strong></h4><p>In DDD, it is important to establish a “pervasive language” among project stakeholders. This language should be one that all stakeholders can understand and should be used for all assets, processes and concepts in the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*fxdrsMRVIdxzijDD323CnQ.jpeg" /></figure><h4><strong>Context</strong> <strong>Mapping</strong></h4><p>Context mapping is a key concept in domain-driven design (DDD) that helps to manage the boundaries and interactions between different bounded contexts within a software system.</p><p>In DDD, a bounded context is a self-contained area of a software system that has a clear, well-defined purpose and set of responsibilities. Bounded contexts can be thought of as separate “worlds” within the larger system, with their own language, rules, and models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*oRHqPtypFgwSN9aGQ1Qyww.jpeg" /></figure><p>Context mapping is the process of identifying the relationships between different bounded contexts and defining how they interact with each other. This is typically done through a combination of documentation, communication, and shared understanding among stakeholders.</p><p>There are several types of context mapping techniques, including:</p><p><strong>Partnership:</strong> This involves two or more bounded contexts working closely together to achieve a common goal. The contexts have a high degree of interaction and need to coordinate closely.</p><p><strong>Customer/Supplier:</strong> This involves one bounded context providing services or information to another bounded context, which acts as a customer. The customer context has a clear set of requirements that the supplier context needs to meet.</p><p><strong>Conformist:</strong> This involves one bounded context conforming to the rules and models of another bounded context. The conformist context needs to adhere to the standards and practices of the other context.</p><p><strong>Anti-Corruption Layer:</strong> This involves creating an intermediary layer between two bounded contexts that have incompatible models or languages. The anti-corruption layer translates between the two contexts to ensure that they can interact seamlessly.</p><p>Context mapping is an important aspect of DDD because it helps to manage the complexity of large software systems by breaking them down into smaller, manageable parts. It also helps to ensure that different parts of the system are properly integrated and working together towards a common goal.</p><h4><strong>Bounded</strong> <strong>Context</strong></h4><p>Bounded context is a concept in DDD that refers to a specific area of the domain model where a particular set of concepts, language, and relationships exist. In other words, it defines the boundaries of a system and the subdomains within it.</p><p>A bounded context is defined by its ubiquitous language, which is the terminology and language that is commonly used within a specific context. Each bounded context has its own ubiquitous language that is used by the domain experts, developers, and other stakeholders to communicate and collaborate effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*CsXuM06UrvPTHfD-OGG0Bg.jpeg" /></figure><p>In DDD, it is important to define bounded contexts to ensure that the domain model accurately reflects the requirements and needs of the business. By defining bounded contexts, developers can focus on the specific subdomains they are working on, while ensuring that the larger system functions as a whole.</p><p>Bounded contexts help to simplify the domain model and reduce the complexity of the system by breaking it down into smaller, more manageable parts. They also help to identify the relationships between different parts of the system and ensure that each bounded context is isolated from the others.</p><p>Overall, bounded contexts play a critical role in creating a robust and flexible domain model that accurately represents the business requirements and needs.</p><h4><strong>Model</strong></h4><p>A model is an outline of terms and concepts within a domain. This is used to better understand and explain processes and data within a domain. A model is a structure that determines how data is managed within a domain, how business rules are enforced, and how user interactions are designed.</p><h4><strong>Tactical Phase</strong></h4><h4><strong>Entity</strong></h4><p>In DDD, it is important to identify the project’s entities and define the properties of these entities. Assets are the basic building blocks of the project and can be shared across different contexts of the project.</p><h4><strong>Value</strong> <strong>Object</strong></h4><p>In DDD, it is important to determine the value objects of the project and to define the properties of these objects. Value objects are used to describe properties of entities and generally cannot be changed.</p><h4><strong>Aggregate</strong></h4><p>In DDD, it is important to identify the aggregates of the project and manage these aggregates within limited contexts. An aggregate is formed by combining one or more entity and value objects.</p><h4><strong>Repository</strong></h4><p>In DDD, it is important that the project’s repositories are identified and that these repositories manage aggregates. Repositories are used as the data access layer and allow data sharing between different contexts of the project.</p><h4><strong>Service</strong></h4><p>These are the classes that contain the business logic in the domain layer. These classes facilitate the interaction of domain objects with each other and ensure that they obey domain rules.</p><h4><strong>Domain</strong> <strong>Events</strong></h4><p>A domain event is a significant occurrence or state change within the domain that has relevance to the business. These events can be raised by entities, value objects, or domain services, and are used to communicate and propagate changes to other parts of the system.</p><h4><strong>Factories</strong></h4><p>In DDD, factories are used to create complex objects or aggregates that require more than one step to be constructed properly. Factories are responsible for managing the creation process, including the validation of inputs, and ensuring that the object being created is in a valid state before returning it to the caller.</p><h4><strong>Advantages and Disadvantages of Domain–Driven Design</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LvbC6cbOFnuNS3NdZtVgQ.png" /></figure><p>DDD is a software development methodology that has several advantages, such as improving understanding of the business domain, software quality, maintainability, and flexibility, but also some disadvantages, such as increased complexity, time-consuming, skill requirements, and over-engineering.</p><h4><strong>Advantages of Using DDD</strong></h4><p><strong>1. Focuses</strong> <strong>on</strong> <strong>Business</strong> <strong>Problems</strong></p><p>DDD helps software developers and business professionals focus on business problems. DDD provides an accurate understanding of business needs and makes it easy to reflect those needs in application code.</p><p><strong>2. More Comprehensive Design</strong></p><p>DDD provides a more comprehensive design in the software development process. This design makes the application more scalable and more flexible.</p><p><strong>3. Long-Term View</strong></p><p>DDD supports a long-term perspective in the software development process. This approach is essential for understanding business problems and properly designing and developing software.</p><p><strong>4. Easy Maintenance and Modification</strong></p><p>DDD enables easier maintenance and modification of software. This approach allows software developers to understand why and how code works. Thus, when the code needs to be changed or updated, the effects of these changes can be better understood.</p><h4><strong>Disadvantages of Using DDD</strong></h4><p><strong>1. Complexity</strong></p><p>DDD creates a large number of class and interface definition needs for the project, and this can increase the overall complexity of the software.</p><p><strong>2. High</strong> <strong>learning</strong> <strong>curve</strong></p><p>DDD differs from traditional software design approaches and developers may need to learn new terms, concepts and models. This can make it harder to adopt DDD.</p><p><strong>3. Increased</strong> <strong>development</strong> <strong>time</strong></p><p>DDD may require writing more code and this can increase development time.</p><p><strong>4. In large</strong> <strong>projects</strong> <strong>it</strong> <strong>can</strong> <strong>get</strong> <strong>complicated</strong></p><p>DDD can become complex when used in larger projects due to the need to define a large number of classes and interfaces.</p><p><strong>5. Can</strong> <strong>be</strong> <strong>problematic</strong> <strong>if</strong> <strong>applied</strong> <strong>incorrectly</strong></p><p>DDD, if not implemented correctly, can result in code becoming more complex and project failure.</p><p>As a result, it is important to implement DDD correctly. DDD can be a useful approach in complex software projects, but its disadvantages should also be considered.</p><h4><strong>Layered Architecture</strong></h4><p>In Domain-Driven Design (DDD), layered architecture is a common pattern used to structure software systems. Layered architecture is an approach that separates an application into multiple layers, each with its own set of responsibilities and dependencies. This helps to keep the system modular and maintainable.</p><p>The three layers of a typical layered architecture in DDD are:</p><p><strong>Infrastructure layer:</strong> This layer is responsible for providing the technical infrastructure necessary to support the application and its services. It includes data storage, messaging, and communication mechanisms, as well as external APIs and services.</p><p><strong>Application Layer: </strong>This layer contains the business logic and orchestrates interactions between the Presentation Layer and the Domain Layer. It also interacts with infrastructure services, such as databases and external APIs.</p><p><strong>Domain</strong> <strong>Layer</strong>: This layer contains the domain model and business rules that define the behavior of the system. It is responsible for maintaining the integrity of the data and enforcing business rules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*794pM1sXCw0cVaxYCZy0Ng.png" /></figure><p>Each layer has its own set of responsibilities and dependencies, and should only interact with the layer immediately above or below it. This ensures that changes made to one layer do not have unintended consequences on other parts of the system.</p><p>The layered architecture is a widely used pattern in DDD, but it is not the only one. Other patterns, such as Hexagonal architecture or Clean architecture, can also be used depending on the needs of the system.</p><h4><strong>In Conclusion</strong></h4><p>DDD is an approach to software development that focuses on understanding and modeling the problem domain of a project. DDD emphasizes the importance of creating a shared understanding of the domain between developers and domain experts, and using that understanding to create a well-designed and well-architected system.</p><p>DDD offers a number of benefits, including improved communication and collaboration between developers and domain experts, a better understanding of the problem domain, and a more flexible and maintainable system architecture. However, DDD can also be complex and requires a significant investment in time and resources to implement effectively.</p><p>Overall, DDD can be a valuable approach for building complex software systems, particularly those that involve a significant amount of business logic and domain-specific knowledge. By emphasizing the importance of understanding and modeling the problem domain, DDD can help ensure that software systems are designed and built in a way that aligns with the needs and requirements of the business.</p><p>Some of the resources that I got help from;</p><p><a href="https://learn.microsoft.com/en-us/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/ddd-oriented-microservice">Designing a DDD-oriented microservice - .NET</a></p><p><a href="https://semaphoreci.com/blog/domain-driven-design-microservices">https://semaphoreci.com/blog/domain-driven-design-microservices</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f48ca37af5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Differences between Abstract Classes and Interfaces]]></title>
            <link>https://medium.com/@erdemdirican/differences-between-abstract-classes-and-interfaces-1d49c23107af?source=rss-c0dafba8c0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d49c23107af</guid>
            <dc:creator><![CDATA[Erdem Dirican]]></dc:creator>
            <pubDate>Fri, 27 May 2022 10:59:41 GMT</pubDate>
            <atom:updated>2022-05-27T11:17:51.686Z</atom:updated>
            <content:encoded><![CDATA[<p>Greetings, I’m here with my first post on Medium. Today I’m going to talk about Abstract Class, Interface and the differences between them. Let’s start.</p><p>Abstract class and Interface, which cause confusion due to their similarities, is a frequently asked question in job interviews. I would like to clear this confusion by explaining it in a simple way here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EE4IrlniNAhubIUrFqV3FQ.jpeg" /></figure><p><strong>Abstract Class</strong></p><p>An abstract class is a special class in C# that cannot be instantiated. We use the abstract keyword to an abstract class. We can define methods, properties, fields in abstract classes. There is an “is-a” relationship.</p><p>You can see an example of an abstract class in the code below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcc12ff6d7bc3ab472d9894845c0f913/href">https://medium.com/media/bcc12ff6d7bc3ab472d9894845c0f913/href</a></iframe><ul><li>We cannot instantiate an object from an Abstract class (“new” cannot be set, instance cannot be created).</li><li>We can define Abstract method in Abstract class. Since this method does not have a body, it must be implemented in the classes used. It is overridden in the classes used.</li></ul><p>You can see the example below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1fb774827351af8d33342df6fa868153/href">https://medium.com/media/1fb774827351af8d33342df6fa868153/href</a></iframe><p>• Abstract classes cannot be marked as static, but can contain static members.</p><p>•Abstract classes can contain constructors (They are used to initialize variables).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/918800e16cf30c5cf249b02c15cc8aa2/href">https://medium.com/media/918800e16cf30c5cf249b02c15cc8aa2/href</a></iframe><p><strong>Interface</strong></p><p>Interfaces are structures that determine what capabilities classes can have. We use the “interface” keyword when defining interfaces. Interfaces can only contain signatures of methods and properties that have no bodies. Access specifiers (public, private, protected) are not used when defining. There is a “can-do” relationship.</p><p>You can see an example interface definition in the code below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b3ded9bc76c874118dec2b64e810189/href">https://medium.com/media/0b3ded9bc76c874118dec2b64e810189/href</a></iframe><p>• Interfaces are reference type.</p><p>• We cannot get an object instance from an Interface (“new” cannot be set, instance cannot be created).</p><p>• A class can implement more than one interface.</p><p>• A class that derives from an Interface must implement all the methods found in the Interface.</p><ul><li>They do not contain constructors.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4df47648a4e3034ed5a598c889f8e397/href">https://medium.com/media/4df47648a4e3034ed5a598c889f8e397/href</a></iframe><ul><li>An Interface can inherit from another Interface.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ebdbf98b7048c50a0232c79a961ee6b/href">https://medium.com/media/9ebdbf98b7048c50a0232c79a961ee6b/href</a></iframe><p>With the new feature that came with C# 8.0, we can only write static codes inside Interfaces.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/041c551fb13b04fa6bcbb0470f62187c/href">https://medium.com/media/041c551fb13b04fa6bcbb0470f62187c/href</a></iframe><p><strong>Abstract Class vs Interface</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJCC8-HgdzuOoLqDqsuOOw.png" /></figure><p><strong>Abstract Class</strong></p><p>• We can use it as a base class.</p><p>• Our classes inherit the abstract class.</p><p>• We cannot create an object instance. (“new” cannot be set).</p><p>• We use it to reduce code duplication.</p><p>• We can define property, method, field.</p><p>• We can define Abstract method in Abstract class. Since this method does not have a body, it must be implemented in the classes used. It is overridden in the classes used.</p><p>• We can access static members in the abstract class.</p><p>• Abstarct classes cannot be marked as static.</p><p>• Can have constructors (used to initialize variables)</p><p><strong>Interface</strong></p><p>• They are the structures that determine what abilities classes can have.</p><p>• Only method and property can be defined.</p><p>• The access specifier is not used.</p><p>• Method has no body.</p><p>• The method name becomes the parameter and the return type.</p><p>• It is a reference type.</p><p>• Field cannot contain.</p><p>• Fields that take object instances cannot contain.</p><p>• An interface can inherit from another interface.</p><p>• A class can implement more than one interface.</p><p>• We cannot get an object instance from an interface. (“new” cannot be set)</p><p><strong>In Summary</strong></p><p>An abstract class is a special class that cannot be instantiated. Interfaces are the structures that determine what abilities classes can have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*9YatUlWh-qm-cbHGkdXZ9w.jpeg" /></figure><p>Some of the resources that I got help from;</p><ul><li><a href="https://docs.microsoft.com/en-gb/dotnet/csharp/language-reference/proposals/csharp-8.0/default-interface-methods">Default interface methods - C# 8.0 draft specifications</a></li><li><a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/abstract">abstract - C# Reference</a></li><li><a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface">interface - C# Reference</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d49c23107af" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>