<?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 Muhammed Ali Aydın on Medium]]></title>
        <description><![CDATA[Stories by Muhammed Ali Aydın on Medium]]></description>
        <link>https://medium.com/@mammimia?source=rss-2d65b0cb31ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*5e2os70m3tZ-hUCfR8JnUQ.jpeg</url>
            <title>Stories by Muhammed Ali Aydın on Medium</title>
            <link>https://medium.com/@mammimia?source=rss-2d65b0cb31ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:46:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mammimia/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[Clean Architecture -> PART V: Architecture]]></title>
            <link>https://medium.com/@mammimia/clean-architecture-part-iv-architecture-5eee3cb5656a?source=rss-2d65b0cb31ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eee3cb5656a</guid>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Muhammed Ali Aydın]]></dc:creator>
            <pubDate>Sat, 01 Feb 2020 13:18:34 GMT</pubDate>
            <atom:updated>2020-02-03T08:12:11.655Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eUAsLeG7uQaAgYMs" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Chapter 15: What is Architecture</h3><p>Architecture can be defined as the shape given to a software system by the creators of that system. This, division of the system into components is the arrangement of the components and how they communicate with each other. The purpose of shaping; facilitating development, deployment, operation and maintenance costs. In addition, the main purpose of building a system on good architecture is to keep the programmer’s productivity to the maximum by minimizing the lifetime cost spent on the system.</p><h4>1. Development</h4><p>Decisions about architecture often vary according to different developer team structures. While a superstructure structure is unnecessary for a group of small programmers dealing with a small project, it is important to develop the architectural system with minimum effort and maximum productivity for groups of different teams working on larger projects.</p><h4>2. Deployment</h4><p>An effective software system must be deployable. As deployment costs increase, the benefit of the system decreases. Therefore, Software Architecture needs to allow the system to be easily deployable with a single action.</p><h4>3. Operation</h4><p>The effect of Architecture on operations is less than that of other features. This is because almost every operational challenge can be solved by using more hardware without major changes to architecture. However, this does not imply that architectures where the system’s operations are well organized are undesirable.</p><p>That is, architecture needs to create the infrastructure that will allow the system to use the case, feature, and required behavior.</p><h4>4. Maintenance</h4><p>Maintenance’s main cost is spelunking and risk. Spelunking is a cost that is needed to find the best strategy and best place to add a new feature to the existing software or to repair a deficiency.</p><p>These costs can be drastically reduced in Architecture which has been prepared with a comprehensive thinking. By correctly dividing the system into components and isolating these components with stable interfaces, new features can be added and the risk of problems caused by carelessness can be significantly reduced.</p><p>● A good architecture should not depend on a particular database, web server or framework. It should be considered that these decisions have not been made yet. In this way, these decisions can be postponed or changed at any time.</p><p>● Architecture should not be device dependent, but should be designed to be applicable to each different device.</p><h3>Chapter 16: Independence</h3><h4>1. Use Cases</h4><p>Use cases means that architecture supports what the system intends to do. If the system is a shopping card application, the architecture must also support shopping card use cases.</p><h4>2. Decoupling Layers</h4><p>The architecture of a system requires that the structure of the system support all use cases, but does not know these use cases. It only knows the basic requirements of the system. Therefore, the architecture uses SRP (Single Responsibility Principle) and CCP (Common Closure Principle) to distinguish them.</p><p>A good architecture separates the UI parts of a use case from the business rule. This makes the use cases visible and clear, allowing them to be replaced independently of each other.</p><p>While business rules can be very tightly connected with the application, they can also be in a general relationship. For example, validation of input fields in the application involves a tight connection with the application, but rather a tighter connection with a business rule domain that allows the calculation of interest on money in a bank account. These two different types of rules are written for different reasons and therefore are classified differently (change at different rates, and for different reasons). Therefore, considering these two different classified situations separately, it will allow to be changed independently of each other.</p><p>On the other hand, the database is not related to the business rule or UI. Therefore, it must be independent of other parts of the system.</p><p>As a result, the architecture must ensure that each of these parts is separated from each other from the other parts of the system so that each part can be replaced independently.</p><h4>3. Decoupling Use Cases</h4><p>Use cases may also need to be changed for different reasons. Use cases are the most natural reasons for dividing the system into different parts. If layers (UI, application-specific business rules, application-independent business rules, database) are assumed to be horizontal dividing lines, use cases can be considered as vertical lines that divide this system.</p><p>If the system is divided correctly, new use cases can easily be added to the system without the need to intervene with the old use cases.</p><h4>4. Independent Develop-Ability</h4><p>The better the layers and use cases can be separated, the better the architecture of the system supports feature, component, layer and other tools, regardless of how they are organized.</p><h4>5. Duplication</h4><p>Duplication is often described as a bad thing for a software. Therefore, the developer wants to avoid code duplication.</p><p>There are two different types of duplications; true duplication, false or accidental duplication. Two different pieces of duplicated code that appear to be identical and appear in different locations are not considered true duplicates if they are classified as different and written for different purposes.</p><p>In the case of use cases, one of the errors generally made during the vertical partitioning of the system is that similar screen structures, similar algorithms, or similar database queries and schemes that use schemas connected to each other. Before qualifying them as interdependent, it is necessary to ensure that they are truly duplication.</p><p>Similarly, when the system is horizontally divided into layers, the data structure of a database record is similar to that of a particular data structure. Instead of creating a view model whose elements look the same and whose elements are the same, the developer might consider switching the database record to the UI. This is called accidental duplication. It does not require much effort to create the same view patterns, and this also ensures that the layers are separated from each other in an appropriate manner.</p><h4>6. Decoupling Modes</h4><p>There are many ways to distinguish between layers and use cases. It can be done at source code level, binary code (deployment) level or execution unit (service) level.</p><p>● <strong>Source Level: </strong>Check the dependencies between the source code modules to see if a change in one module requires replacement or recompilation of other modules.</p><p>● <strong>Deployment Level: </strong>Dependencies between deployable units such as jar files, DLLs, shared libraries are checked to see if one module’s source code requires rebuilding or re-deploying others.</p><p>● <strong>Service Level: </strong>By reducing dependencies to the level of data structures and communicating only through network packets as each execution unit does, source and binary changes can be made completely independent of the others.</p><p>It is difficult to know which of these ways is the best way for the project, in the early stages of the project. In fact, as the project begins to mature, the optimal mode can also vary.</p><h3>Chapter 17: Boundaries: Drawing Lines</h3><p>● Database is a tool where business rules are used indirectly. The Business rule does not have to know any details about the schema, query language, or database. All he needs to know is that there is a set of functions that make the corresponding changes in the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*xjiFDbnS_uQMKSralBFlxw.jpeg" /><figcaption>The database behind an interface</figcaption></figure><p>● Thanks to this modularity, which database is used (MySQL, Oracle, Couch, Datomic…) is ignored by business rule.</p><h3>Chapter 18: Boundary Anatomy</h3><h4>1. Boundary Crossing</h4><p>Boundary crossing is defined as the function on one end of the boundary calling the function on the other end and passing data to it. The secret to creating an appropriate boundary crossing lies in the good management of source code dependencies.</p><h4>2. The Dreaded Monolith</h4><p>The simplest and widely used in architectural boundaries do not have a solid, physical representation. They are usually based on the discipline of separation of functions and data in a single address range and using a single processor. This is called source-level decoupling mode. However, for deployment, this means that a single executable file is executed, which is called a monolith.</p><p>The simplest possible boundary crossing can be accomplished by calling a function from a low-level client to a high-level client.</p><p>If a high-level client needs to call a lower-level service, dynamic polymorphism is applied to reverse the dependency control flow.</p><h4>3. Local Processes</h4><p>Local processes are one of the most powerful physical achitectural boundaries. A local process can be called from the command line or using an equivalent system call. They usually communicate with each other, via sockets, or using a tool provided by the operating system, such as a mailbox-message box.</p><p>Each local process can be either a statically linked monolith or a combination of dynamically linked deployment components.</p><h3>Chapter 19: Policy and Level</h3><p>Software systems are statements of policy. In other words, a computer program is a detailed description of policies that converts the inputs it receives to output. In most important systems, policy can be broken down to be expressed in smaller policies. The division of these policies into smaller pieces and grouping them according to what has been changed is part of the development of software architecture. At the same time, policies changing at the same level and for the same reason are grouped as belonging to the same component.</p><p>Art of architecture says that the grouped components must be in a directional graph without loops. The components of this graph have the same level of policy. The directional edges in this graft represent the dependencies between the nodes and are used to connect components of different levels to each other.</p><p>In a good architecture, the direction of these dependencies depends on the level of the component to which they are connected. In any case, low-level components need to be designed to depend on high-level components.</p><h4>1. Level</h4><p>The concept of this level, whether high or low, is determined by proximity to input and output. The more distant a policy is from input and output, the higher the level. Those who manage input and output are considered the lowest-level policies of the system.</p><h3>Chapter 20: Business Rules</h3><p>Business rules are defined in the book as roughly the rules or procedures for earning or saving business money. To be defined in a superficial manner, these rules should ensure that they are earning or saving business money, whether or not implemented on a computer. These rules are called Critical Business Rules. These rules usually require data to work. This data is also called Critical Business Data. Regardless of whether the system is automated, these data and rules must exist.</p><p>Rules and data need to be linked. The objects that link them are called Entity.</p><h4>1. Entity</h4><p>Entities are objects that work on Critical Business Data and embody a group of business rules in the system. The interface of an Entity consists of functions where Critical Business Rule’s are implemented.</p><p>It does not need to be written in object-oriented language to create an Entity. Although it is usually understood as it should be a class; A separate or combined software module that will allow Critical Business Data to be linked to Critical Business Rule is sufficient to create Entity.</p><h4>2. Use Cases</h4><p>Use case is an explanation of how to use an automated system. A use case should specify in detail the input to be provided by the user, the output to be returned to the user, and the steps during which this output is generated. Use cases are also defined as application-specific business rule, in contrast to Critical Business Rule.</p><p>It is important, however, that a use case does not define how the system will look to the user and an entitity does not know about the use case that controls it. Entities are defined as high level, while use cases are defined as low level. Therefore, use cases are dependent on Entities.</p><h4>3. Request and Response Models</h4><p>Use cases expect an input data and use this data to generate output data. However, a well-designed use case object does not bear any trace of how this data will communicate with the user. In other words, HTML, SQL definitions are not used in use cases.</p><p>The use case class uses simple data structure requests for inputs and simple data structure responses for outputs. Again, these data structures are not dependent on anything.</p><p>People often think that data structures should contain references to Entitity objects. This makes sense because Entities and request / response models share a lot of data. However, this should be avoided. These two objects exist for different purposes. They will also violate CCP and SRP because of their dependence when they change at different times. This will result in a lot of stray data and a large number of conditions in the code.</p><h3>Chapter 21: Screaming Architecture</h3><h4>1. The Theme of an Architecture</h4><p>Architectures are not related to frameworks and should not be supported by any framework. Frameworks are tools to be used and should not confused with architecture.</p><h4>2. The Purpose of an Architecture</h4><p>At the center of a good architecture should be use cases. Thus, when designing the architecture, the structure must be designed to support these use cases and not to depend on any framework, tool or environment. A good software architecture followed by framework, database, web server and other environemental issues. The Framework option is always left as an open door.</p><p>A good architecture should always be easy to modify after making these decisions (database, webserver, etc.).</p><h4>3. Frameworks Are Tools, Not Ways of Life</h4><p>Frameworks can be very powerful and useful. However, the price of this should not be forgotten. The questions that one should ask himself when making this decision are: how to use and how to protect it.</p><p>In summary, strategy is needed to prevent the Framework from overriding architecture.</p><h3>Chapter 22: The Clean Architecture</h3><p>Architectures need to produce systems with the following characteristics:</p><p>● Framework-independent</p><p>● Testable</p><p>● UI independent</p><p>● Database independent</p><p>● Independent from any agency</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*e0qRviUteYPCMoj0Ow0RhA.jpeg" /><figcaption>The clean architecture</figcaption></figure><h4>1. The Dependency Rule</h4><p>The above circles represent different areas of a software. As you move to the inside circles, the level of software increases. The outside circles represent the mechanisms. The inner circles represent the policies. A circle located inside does not have information about the circles located outside. At the same time, the data structures that will not be used by the inside circles should be defined in the outside circles.</p><h3>Chapter 23: Presenters and Humble Objects</h3><h4>1. The Humble Object Pattern</h4><p>Humble Object Pattern is a design pattern that adopts to distinguish unit tests from behaviors that are difficult to test from behaviors that are easy to test. It divided these behaviors into two modules or classes. One of these modules is humble: it contains all the behaviors that are difficult to test.</p><p>For example, GUIs are units that are difficult to test. However, some GUI behaviors can be easily tested. In these cases, using Humble Object Pattern, we can split these two types of behavior into two different classes, Presenter and View.</p><h4>2. Presenters and Views</h4><p>Views are humble objects that are difficult to test. The codes inside these objects should be kept as simple as possible. These objects show the data in the GUI but do not process the data.</p><p>Presenter is a testable object. Presenter’s task is to accept the data from the application and present it in the required format so that Views can be displayed on the screen in a simple way. Presenter stores the data in View Models by converting them to the appropriate format, so that View data can be easily retrieved from View Models and displayed.</p><h4>3. Database Gateways</h4><p>Database gateways provide an interface between database operations and other parts.</p><h4>4. Data Mappers</h4><p>It is often difficult for people to predict which layer the object relational mapper (ORM, such as Hibernate) will be on.</p><p>Objects are not data structures. They are not, at least from the user’s point of view. If the data is set to private, the user cannot see any data in the object. All he can see are the public methods of the object. Therefore, objects are seen by users as clusters of operations.</p><p>On the contrary, a data structure consists of only public data variables. Therefore, ORMs are called data mappers because they transfer data from relational databases to data structures.</p><p>Back to the top, ORMs are located in the database layer for these reasons. In fact, ORMs are also a type of Humble Object that creates a boundary between the gateway interface and the database.</p><h3>Chapter 24: Partial Boundaries</h3><p>Full-fledged architectural boundaries are very costly. In order to be created, mutual boundary interfaces, data structures for input and output, and all other dependency management will be necessary for the two sides to be independently compile and deployed.</p><p>In most cases, a good architect can decide that the cost of a boundary will be high, but it must also leave space for this boundary to be created where necessary. Partial boundaries are used for these “or if necessary” cases.</p><h4>1. Skip the Last Step</h4><p>One way to create a partial boundary is to create independent components that can do all the necessary work, then collect them all in one component. Everything required (interface, input / output, etc.) is set in the same way, but all can be compile and deploy as a single component.</p><p>Although it requires as much code and design as it needs to literally build a boundary, it eliminates the problem of managing multiple components. There is also no payload to track version number or manage release.</p><h4>2. One-Dimensional Boundaries</h4><p>In a full-fledged boundary, the separation of maintenance for both sides is very costly in terms of initial setup and maintenance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*HMqSIz29OZg1oHgJsaBKNw.jpeg" /><figcaption>The Strategy pattern</figcaption></figure><p>As shown in the diagram above, such situations may result in architectural boundaries in the future. Dependency inversion plays a role in the separation of Client and ServiceImpl. It should be clearly stated that this decomposition can rapidly deteriorate, as indicated by dotted arrows. Without mutual interfaces, it will not be possible to prevent such backdoors from the diligence and discipline of developers and architects.</p><h4>3. Facades</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*u4a24cotg-8s2dkQ5omx9Q.jpeg" /><figcaption>The Facade pattern</figcaption></figure><p>Boundaries are defined by Facede classes. In these Facade classes, all services are listed in methods and service calls are distributed to classes that should not be accessed by the client.</p><h4>4. Conclusion</h4><p>In this chapter, three different ways of creating a partial boundary are discussed. They all have benefits and bad sides. Each one is suitable for specific situations.</p><h3>Chapter 25: Layers and Boundaries</h3><p>AArchitectural boundaries are available everywhere. The task of the architects is to be careful about them and to realize when it is necessary, but also to realize that the boundaries created are literally costly. It should be noted, however, that the subsequent addition of neglected boundaries would be very costly.</p><h3>Chapter 26: The Main Component</h3><p>The main component is the lowest level policy of the system. It is the first entry point of the system and everything depends on it. Its mission is to create all the factories, strategies, other global opportunities and control the high-level parts of the system.</p><h3>Chapter 27: Services: Great and Small</h3><h4>1. Service Architecture</h4><p>It is thought that using service in the system creates an architecture in a natural way. However, this idea has proved to be inaccurate by being patented.</p><p>The architecture of a system is defined as the separation of the high-level policemen from the low-level policemen by using boundaries, taking into account the Dependency Rule. But services alone divide the behavior of the system into different parts.</p><h4>2. The Decoupling Fallacy</h4><p>The biggest benefit of the system is that the parts can be separated very strongly. In this way, all services can operate as different processes, even different processors. However, one of the biggest misconceptions is that these services still share resources on the processor or network. What’s more, these services are strongly linked to sharing data.</p><h4>3. The Fallacy of Independent Development and Deployment</h4><p>Another default benefit of the services is that the system can be broken down and assigned to development teams. Thus, each team can be responsible for the writing, maintaining and operating of a service. This provides scalable development.</p><p>Although some of this thought is true, it is difficult to say that it is completely true. Historically, some large enterprise systems with a monolith and component-based structure are as good as service-based systems. Therefore, services-based architectures are not the only option in scalable system development.</p><p>Another misunderstanding is that services do not always provide independent development, deployment, and operated systems. In some ways, such as data, these services may be interdependent.</p><p>That is all. For more information, you can read the book “Clean Architecture: A Craftsman’s Guide to Software Structure and Design (Robert C. Martin Series)”.</p><p>You can use the link below to go to the beginning of the article.</p><p><a href="https://medium.com/@mammimia/clean-architecture-part-i-introduction-7a1b05ce3181">Clean Architecture -&gt; PART I: Introduction</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eee3cb5656a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Architecture -> PART IV: Component Principles]]></title>
            <link>https://medium.com/@mammimia/clean-architecture-part-iv-component-principles-89d3cb58c195?source=rss-2d65b0cb31ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/89d3cb58c195</guid>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Muhammed Ali Aydın]]></dc:creator>
            <pubDate>Sat, 01 Feb 2020 13:00:10 GMT</pubDate>
            <atom:updated>2020-02-11T15:15:43.016Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wQVVrEWv73FPJn_M" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Considering that SOLID principles tell us how to arrange bricks in a room or wall, component principles tell us how the rooms inside the building will be arranged.</p><h3>Chapter 12: Components</h3><p>Components are deployment units. In other words, they are the smallest assets of the system that can be deployed. These are jars in Java and gem files in Ruby.</p><p>Compiled languages are combinations of binary files, while interpreted languages are combinations of source files. So for each language, they are part of deployment.</p><h3>Chapter 13: Component Cohesion</h3><p>It is an important decision to determine which classes belong to which component. When deciding, guidance from a good software engineering principle is needed. Three component coupling principles are available:</p><p>● <strong>REP: </strong>The Reuse/Relase Equivalance Principle</p><p>● <strong>CCP: </strong>The Common Closure Principle</p><p>● <strong>CRP: </strong>The Common Reuse Principle</p><h4>1. The Reuse/Relase Equivalance Principle (REP)</h4><p>REP is a principle that allows us to see the obvious, though a little late. People want to reuse a component that they cannot or will not use unless they are followed by a process release or a given release number.</p><p>However, this is not easy, because when one component does not have a release number, there is no way to know whether the reused componenting is compatible with the others. More precisely, this means that the developer needs to know when a release will arrive and what innovations will come with this release.</p><p>From a software design and architectural perspective, this principle says that classes and modules within the component must be in a cohesive group. According to this principle, the component cannot consist of randomly assembled classes and modules. Instead, they should serve a theme that encompasses them, or a common goal that they all share. The classes and modules that make up the component must also be released together. In this way, they can all share the same version number and the same release tracking.</p><p>The weakness of this principle is that what it provides by the strengths of the other two principles is more than affordable. More precisely, CCP and CRP define this principle more strongly, but with a negative perception.</p><h4>2. The Common Closure Principle (CCP)</h4><p>SRP is adapted for components. Unlike SRP, it considers that a component should not have multiple reasons to change. That is, SRP says that if different functions need to change for different reasons, they should be divided into different classes, whereas CCP says that if different classes need to change for different reasons, they must be divided into different components.</p><p>When the code in an application has to change, instead of changing all components, the problem must be solved by changing the content of only one component. Thus, if the change is limited to only one component, only that component will need to be deployed. This will ensure that other components are not affected by this event.</p><p>At the same time, it tends to gather the classes that conform to the Open Closed (OCP) principle to the same component, which is closed to modification, but open to extensions, with the same type of changes. Thus, it aims to replace the minimum number of components in case of any requirement change.</p><h4>3. The Common Reuse Principle (CRP)</h4><p>CRP is another principle used to determine a class or component will belong to which component. It argues that classes that are reusable and which will cooperate with each other in the reuse phase must be in the same component.</p><p>CRP also tells us which classes should not be in the same component, as well as telling us which classes to put in the same component. When a component uses another component, a dependency occurs between them. It does not weaken the dependency between them, even if the component is only a class. Because of this connection between them, when a change is made to the component used, it is reflected in the component that uses it. Even if no changes have been made to the component being used, or even if the change does not affect the component at all, it must be recompiled, validated, and deployed.</p><p>So if we’re going to make a component-dependent development, we need to make sure that the process is dependent on every class in that component. For this reason, CRP is more of a guideline than to tell us which class will be in a component, but which one will not. CRP is also defined as the generic version of the ISP. ISP says that we shouldn’t depend on a class that we don’t use, while CRP says we shouldn’t depend on a component that we won’t use.</p><h4>4. The Tension Diagram For Component Cohesion</h4><p>In fact, it can be said that these three principles are at war with each other. While REP and CCP are more prone to increasing the size of the component, CRP is trying to reduce the size of the component.</p><p>“Cohesion Principles Tension” diagram is given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*Jm0Zcp8kCwvOPfRSXsdV3w.jpeg" /><figcaption>Cohesion principles tension diagram</figcaption></figure><p>A designer who focuses exclusively on REP and CRP will cause a large number of components to be affected by the smallest changes. On the contrary, a designer who focuses strongly on CCP and REP will result in a large number of unnecessary releases.</p><p>A good designer should try to find a middle way in this tension triangle according to the concerns of the development team, but should be aware that these concerns will develop over time.</p><p>Generally, projects are initially more prone to the right side of the triangle, and as the project matures, this trend shifts to the left. This indicates that the component structure may vary depending on the maturity and timing of the project.</p><h3>Chapter 14: Component Coupling</h3><p>There are three principles regarding the relationships between components:</p><p>● <strong>ADP: </strong>Acyclic Dependencies Principle</p><p>● <strong>SDP: </strong>Stable Dependencies Principle</p><p>● <strong>SAP: </strong>Stable Abstractions Principle</p><h4>1. The Acyclic Dependencies Principle</h4><p>Sometimes we see that the things that we’ve been working on all day, after a day, don’t work. When we investigate this, we realize that someone else changes something that we have developed as dependent and makes all the things we deal with inoperable. The author calls this the morning after syndrome.</p><p>“the morning after syndrome” occurs in development environments with some programmers changing source code. While this problem does not cause very big problems in relatively small teams, it is not possible to say the same for large teams.</p><p>Two solutions have been proposed for this problem: weekly build and Acyclic Dependencies Principle (ADP).</p><h4>a. The Weekly Build</h4><p>Usually used in medium-sized projects. Developers work the first four days of the week, ignoring the others. Without any integration concerns, they develop the code as if the code will run independently. After four days, on Friday, all changes and the system are integrated.</p><p>Although this approach provides a great advantage for the first four days, the fifth day causes a serious problem. As the project grows, the cost of integration increases and the burden on other days begins. As integration decreases, so does the efficiency of the development team. Therefore, this situation causes crisis in time.</p><h4>b. Eliminating Dependency Cycles</h4><p>This problem can be resolved by dividing the development environment into releasable components. These components become the work of a developer or a team and can be made available to other developers.</p><p>When a new release of a component is released, other teams also need to adapt their work to the new release. However, each change made to a component may not be critical to other teams. It is a decision of the team to decide whether the work will be adjusted according to the new release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*PJFUSUoKsbNndtuxmTW6Yg.jpeg" /><figcaption>Typical component diagram</figcaption></figure><p>Above is a specific component structure of an application. There is no cycle in this graph structure which is a directional graph. Therefore, it is called directed acyclic graph.</p><p>Let’s assume that the team that developed Presenter has released a new release. Using the graph, we can say that the Main and View components will be affected when we follow the arrows in the opposite direction. The team working on these components needs to decide whether to adapt their own components with this new change.</p><p>When the release time of the whole system arrives, the process goes from bottom to top. First, the Entities component is compiled, tested and released. This is followed by Database and Interactors. Then the same operations are applied to Presenter, View and Controller. Lastly after applying to Authorizer and Main, it ends.</p><p>Suppose a developer works in the Database component. He knows that this component is dependent on Entities. However, because of the cycle here, it is also dependent on Authorizer and Interactors components. This makes the Database component a difficult component for release. This level of dependence leads to serious problems, if not compulsory.</p><h4>c. Breaking the Cycle</h4><p>In such cases, it is possible to reconstruct the graph by breaking the cycle. There are 2 different ways to do this:</p><p>By applying DIP, an interface between Entities and Authorizer can be placed and the connection can be reversed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*OYaDBJbQYYhYsbiRKMG5Hg.jpeg" /><figcaption>Inverting the dependency between Entities and Authorizer</figcaption></figure><p>A component to which Entites and Authorizer components are dependent can be created. This is usually applied when a temporary solution is required. Creating new components means that the dependency structure will also grow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*5Efqun_YMdiPHumATnN6qw.jpeg" /><figcaption>The new component that both Entities and Authorizer depend on</figcaption></figure><h4>2. Top-Down Design</h4><p>The conclusion that can be drawn from the problems described so far is that the component structure cannot be designed from top to bottom. Component structure is not one of the first things to be done when designing the system, it should develop according to the growth and change of the system.</p><p>The fact is that component dependency diagrams do not have much to do with defining the functions of the application, but rather are important in the planning of the application’s buildability and maintability features. Therefore, they are not designed from the very beginning of the project. When there is no software for executing build or maintain functions, there is not much need for planning.</p><p>The changes are localized as much as possible in a specific region, and can be achieved by having the class distributions of the components where regional changes can be made by giving importance to SRP and CCP.</p><p>As application begins to grow, reusable element formation becomes a concern. At this point, components are started to be combined using CRP. The loops resulting from this process are also broken using ADP and component dependency is eliminated, but the graph is growing.</p><p>If the component dependency structure is attempted before any class is designed, it will lead to serious consequences. It is very difficult to recognize the dependencies and reusable elements when there is no design. Therefore, the component dependency structure grows and develops with the logical design of the system.</p><h4>3. The Stable Dependencies Principle</h4><p>The design cannot be completely static. To be a sustainable design, it needs to be a little volatility. By applying CCP, components that are sensitive to changes and independent of others are created. Some of these components are designed to be volatile. These are expected to be changeable as the project matures.</p><p>At the same time, it is necessary to make sure that these temporary components are not dependent on the components that are difficult to change. Failure to meet this requirement makes it very difficult to change the component, which is designed to be susceptible to change. Therefore, it can be ensured that such dependence does not occur by using the Stable Dependencies Principle (SDP).</p><h4>a. Stability</h4><p>It becomes difficult to change a software component when many other components depend on it. In order to change any property of this component, it is necessary to do so in accordance with all dependent components. Therefore, components that have a large number of dependent components are considered very stable.</p><h4>4. The Stable Abstraction Principle</h4><p>Some software in the system is not required to change very often. This type of software includes high-level architecture and policy decisions. That is, it is not preferred that such business and architectural decisions be temporary. Therefore, these softwares that contain the high-level policy decisions of the system should be included in the stable components.</p><p>However, this makes architecture inflexible. In such cases, by applying OCP, it is possible to create flexible and non-modification classes with the help of Abstract classes.</p><p>Stable Abstraction Principle (SAP) provides a relationship between stability and abstractness. On the one hand, it says that the stable component should be abstact, so it doesn’t prevent it from being extended, on the other hand, it says that the unstable component must be concrete and unstable, and also that concrete code should be easily modified.</p><p>You can access the next section from the link below.</p><p><a href="https://medium.com/@mammimia/clean-architecture-part-iv-architecture-5eee3cb5656a">Clean Architecture -&gt; PART IV: Architecture</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89d3cb58c195" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Architecture -> PART III: Design Principles (SOLID)]]></title>
            <link>https://medium.com/@mammimia/clean-architecture-part-iii-design-principles-solid-b8d06497001?source=rss-2d65b0cb31ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8d06497001</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <dc:creator><![CDATA[Muhammed Ali Aydın]]></dc:creator>
            <pubDate>Sat, 01 Feb 2020 12:44:08 GMT</pubDate>
            <atom:updated>2020-02-01T13:19:41.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8rz9kqJAPdViHkxj" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A good software system is provided by clean code. When bricks are not good, no matter how good the developed architecture is. On the other hand, a pile of rubbish made of very good bricks also makes no sense. This is where SOLID principles come into play.</p><p>SOLID principles determine how functions and data structures are organized in classes and how these classes relate to each other.</p><p>The purpose of these principles in creating a mid-level software structure is;</p><p>● Changes to be appropriate</p><p>● Easy to understand</p><p>● Ability to use basic components used in most software systems</p><h3>Chapter 7: SRP: The Single Responsibility Principle</h3><p>In its simplest definition, as the name implies, each module is based on the principle that it should be responsible only for one thing. The book is described by the following words:” A module should be responsible to one, and only one, actor.”</p><h4>1. Symptom 1: Accidental Duplication</h4><p>Suppose the Employee class of a salary payment application is issued. This class has three methods: calculatePay(), reportHours(), and save()</p><p>● <strong>calculatePay(): </strong>Used by<strong> </strong>CFO (Accounting Department)</p><p><strong>● reportHours(): Used by COO (Human Resources)</strong></p><p>● <strong>save(): </strong>Used by<strong> </strong>CTO (Database Administrators)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*4ZewoBnEQak-bxl6C4PrvA.jpeg" /><figcaption>The Employee class</figcaption></figure><p>It can be said that this class violates the SRP principle because it is used by three different actors. The fact that the developer puts these three methods into only one Employee class causes the actors to be interdependent.</p><p>Suppose that the calculatePay() and reportHours() functions use a common algorithm to calculate non-overtime hours. Let&#39;s assume that the developer gives these algorithms in a single regularHours() function to avoid duplicate code generation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*YEAUq0bZCAKl9XPqLP8hmA.jpeg" /><figcaption>Shared algorithm</figcaption></figure><p>The CFO team would like to make a small change in the calculation of non-overtime hours, while the COO team expects these hours to continue to be calculated as before. The function is changed as the CFO team wants, but the COO team continues to use it unaware that it has been changed. For this reason, it constantly deals with wrong values, causing millions of dollars of budget damage due to incorrect data.</p><p>The reason for all these problems stems from the fact that different actors are very closely connected. The SRP principle explains this: “Codes to which different actors are dependent should be separated.”</p><h4>2. Symptom 2: Accidental Duplication</h4><p>Suppose that two different developers or developer teams are trying to change the Employee class simultaneously. In such a case there will be a code conflict and this will result in merge problems.</p><p>Although tools have been developed to solve merge problems today, there is no tool to deal with every merge case. Therefore, there is always risk.</p><p>This problem can be solved in different ways. However, in all, functions must be moved out of class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*BQaFMMrIhk_89LXGRMsNMQ.jpeg" /><figcaption>The “Facade” pattern</figcaption></figure><p>Facade patterns are generally used to solve such problems, as shown in the figure above. The specified functions are divided into three different classes and communicate only with an Employee Data class with data structures. Since these three classes do not know about each other, accidental duplication can be prevented in this way. There is very little code in the corresponding EmployeeFecade class. This class is only responsible for instantiating and delegating.</p><h3>Chapter 8: OCP: The Open-Closed Principle</h3><p>The general idea of this principle is great. It tells you to write your code so that you will be able to add new functionality without changing the existing code. That prevents situations in which a change to one of your classes also requires you to adapt all depending classes. Unfortunately, Bertrand Mayer proposes to use inheritance to achieve this goal: “A class is closed, since it may be compiled, stored in a library, baselined, and used by client classes. But it is also open, since any new class may use it as parent, adding new features. When a descendant class is defined, there is no need to change the original or to disturb its clients.”. The nature of a software must be extensible without any modification.</p><p>The main benefit of this approach is that an interface introduces an additional level of abstraction which enables loose coupling. The implementations of an interface are independent of each other and don’t need to share any code. If you consider it beneficial that two implementations of an interface share some code, you can either use inheritance or composition.</p><h3>Chapter 9: LSP: The Liskov Substitution Principle</h3><h4>1. Guiding The Use of Inheritance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*T7YY9rg6GLOZEFVE3eECOA.jpeg" /><figcaption>License, and its derivatives, conform to LSP</figcaption></figure><p>Suppose we have a class called License and let it have a calcFee() function used to calculate the bill. This License class also has two subclasses, PersonalLicense and BusinessLicense. These two classes use different algorithms to calculate the license fee.</p><p>When the solution to this problem is handled according to LSP, Billing’s behavior can easily work through the License interface, without any difference to any subclass type.</p><p>As a result, LSP extends the level of architecture. The slightest substitution violation causes the system architecture to be contaminated with extra mechanisms.</p><h3>Chapter 10: ISP: The Interface Segregation Principle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*qHqtFs5rLgoENh2EaSYN4g.jpeg" /><figcaption>The Interface Segregation Principle</figcaption></figure><p>Suppose that more than one user uses the functions of the OPS class. However, User1 only uses op1, User2 uses only op2 and User only uses op3.</p><p>When the code for the corresponding state is written in OO language, User1 will become dependent, even if it does not call them with User2 and User3 for no reason. This dependency will also require that a change in op2 or op3 be recompiled and deployed, even if no changes have been made to User1.</p><p>This problem can be solved by separating operations into interfaces as follows. By converting these operations to the interface, the dependencies between the Users will be eliminated, so that any action performed on the others will not affect unrelated Users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*9urJ1gkckdeTbneHJ6DbeA.jpeg" /><figcaption>Segregated operations</figcaption></figure><h4>1. ISP and Language</h4><p>The description mentioned in the previous section shows critical changes depending on the type of language.</p><p>In statically typed languages (such as Java), users must use declaration, such as import, use, or include. Especially in the include declarations in the source code, the source code dependencies are forced to be recompiled and deployed.</p><p>In dynamically typed languages (such as Ruby and Python), most declarations are not included in the source code. Instead it is called at run time. Therefore, source code dependencies are not forced to compile and deploy again. This is the main reason why dynamically typed languages create more flexible and lighter connected systems than statically typed languages.</p><p>It is worth noting that the ISP is a language problem rather than an architectural problem.</p><h3>Chapter 11: DIP: The Dependency Inversion Principle</h3><p>The general idea of this principle is as simple as it is important: High-level modules, which provide complex logic, should be easily reusable and unaffected by changes in low-level modules, which provide utility features. To achieve that, you need to introduce an abstraction that decouples the high-level and low-level modules from each other.</p><p>Based on this idea, Robert C. Martin’s definition of the Dependency Inversion Principle consists of two parts:</p><p>● High-level modules should not depend on low-level modules. Both should depend on abstractions.</p><p>● Abstractions should not depend on details. Details should depend on abstractions</p><p>An important detail of this definition is, that high-level <strong>and</strong> low-level modules depend on the abstraction. The design principle does not just change the direction of the dependency, as you might have expected when you read its name for the first time. It splits the dependency between the high-level and low-level modules by introducing an abstraction between them. So in the end, you get two dependencies:</p><ol><li>the high-level module depends on the abstraction, and</li><li>the low-level depends on the same abstraction</li></ol><p>You can access the next section from the link below.</p><p><a href="https://medium.com/@mammimia/clean-architecture-part-iv-component-principles-89d3cb58c195">Clean Architecture -&gt; PART IV: Component Principles</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8d06497001" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Architecture -> PART II: Starting With The Bricks: Programming Paradigms]]></title>
            <link>https://medium.com/@mammimia/clean-architecture-part-ii-starting-with-the-bricks-programming-paradigms-a0138a114eb2?source=rss-2d65b0cb31ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0138a114eb2</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Muhammed Ali Aydın]]></dc:creator>
            <pubDate>Sat, 01 Feb 2020 12:12:40 GMT</pubDate>
            <atom:updated>2020-02-01T13:19:28.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ldq7udgmJ4YJTAKN" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One of the most important revolutions in programming is paradigms. Paradigms are the way of programming, relatively independent of the programming language. A paradigm tells you which programming structure to use when. There are now three different paradigms: structured programming, object-orient programming, and functional programming.</p><h3>Chapter 3: Paradigm Overview</h3><h4>1. Structured Programming</h4><p>Although it is not the first paradigm to be introduced, it is the first paradigm to be accepted. It was discovered in 1968 by Edsger Wybe Dijkstra. Dijkstra argued that uncontrolled jump operations (goto) are harmful to the program structure. It has transformed jumps into if / then / else and do / while / until, which we use today.</p><h4>2. Object-Oriented Programming</h4><p>Object-oriented programming, considered the second paradigm, was originally discovered by Ole Johan Dahl and Kristen Nygaard in 1966, two years earlier.</p><h4>3. Functional Programming</h4><p>As the third paradigm, functional programming, which has just begun to be accepted, is actually one of the first discovered paradigms. Suggested by Alonzo Church. Functional languages have no assignment statements. Most functional languages only allow the variable to change according to very strict disciplines.</p><h4>4. Food For Thought</h4><p>Every paradigm mentioned above limits the capabilities of the programmer. None of them adds new abilities. A paradigm tells the programmer what he shouldn’t do, rather than tell him what to do.</p><h3>Chapter 4: Structured Programming</h3><h4>1. Proof</h4><p>Dijkstra realized that programming was difficult in the early years and that its programmers did not handle it well. A program contained a lot of complex details for the human brain to manage well without help. Dijkstra applied proof, a mathematical discipline, to solve this problem. He thought programmers could implement the hierarchy that mathematicians used.</p><p>During his research, he discovered that goto statements prevent problems from being divide into smaller pieces and solved by the divide-and-conquer approach. However, he realized that there were no such problems in the different uses of goto, and suggested that these could be used as control structures such as if / then / else and do / while. By means of control structures, problems could be divide into provable units as recursive.</p><h4>2. Science to the Rescue</h4><p>While mathematics is a discipline used to prove that verifiable expressions are true, science, on the contrary, is a discipline that tries to prove that provable expressions are wrong.</p><h4>3. Tests</h4><p>Dijkstra expressed his opinion about the tests: “The test allows an existing bug to be found, not to detect a non-existing bug.”. In other words, tests can prove that a program is not correct, but it cannot be proved to be true.</p><h4>4. Conclusion</h4><p>The ability to split a program into workable parts makes structured programming valuable. This is the main reason why modern languages today do not support the limiting goto statement.</p><h3>Chapter 5: Object-Oriented Programming</h3><p>Object-oriented is defined as an approach that makes software easier to understand because it is closer to real-world relationships. However, this does not fully define Object-oriented programming. For a better understanding of object-oriented programming, encapsulation, inheritance and polymorphism should be mentioned.</p><h4>1. Encapsulation</h4><p>OO languages allow easy and effective encapsulation of data with functions. As a result, a boundary is drawn out of the data and function associated with each other. For those outside this limit, the data is confidential and is only known by some functions. This concept is usually realized with private class variables and public class functions.</p><h4>2. Inheritance</h4><p>Inheritance is a mechanism in which one class can achieve the attributes of another class. In this way, the variables and methods of an existing class can be reused.</p><h4>3. Polymorphism</h4><p>It means multiple forms. Occurs when there are multiple classes that are in an inheritance relationship with each other. The method obtained with Inheritance allows the use of different methods for each class.</p><h4>4. Dependency Inversion</h4><p>Let’s think of a software that doesn’t have a safe and appropriate mechanism for Polymorphism. In the calling tree of this software, the main function calls high level functions, high level functions mid-level functions, and mid-level functions call lower level functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*3puSpLIAZlAvSn0qIT_X6A.jpeg" /><figcaption>Source code dependencies versus flow of control</figcaption></figure><p>When the Main function, calling a function with a high level, must use the name of the module that has the function. As go down in this way, each caller must use the module that has the function it calls. Therefore, flow control determines the behavior of the system and originates from source code dependencies.</p><p>When Polymorphism is involved, a situation different from the one described above occurs;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*UBi-WDVkUomOJWafA5BkYg.jpeg" /><figcaption>Dependency inversion</figcaption></figure><p>In the figure above, the HL1 module calls the F() function of the ML1 module. In fact, the call is made via the interface. However, because the interface does not exist at run time, HL1 simply called ML1’s F() function.</p><p>However, the source code dependency between the ML1 and I interface is in the opposite direction compared to the flow control. This is called dependency inversion, and this invention has been a milestone into software architectures.</p><p>OO languages can reverse any source code dependency, wherever it is, thanks to safe and convenient polymorphism.</p><h3>Chapter 6: Functional Programming</h3><p>The concept of functional programming dates back to the old years of programming. This paradigm was founded by Alonzo Church based on l-calculus in the 1930s.</p><h4>1. Squares of Integers</h4><p>An OO language uses mutable variable — variables whose value may change during the execution of the program. However, there are no mutable variables in a functional language. A variable is initialized, but never changed.</p><h4>2. Immutability and Architecture</h4><p>The reason why mutable variables are not used is explained as follows: all race conditions, deadlock conditions and concurrent update problems are caused by mutable variables. If the value of a variable does not change, there is no race condition or concurrent update problem. There will also be no deadlock if there are no mutable variables.</p><p>Each developer aims to develop a robust program that will work with multiple threads and processors. But the question is: is immutability applicable?</p><p>The answer is that if we have an infinite storage space and an infinite processor speed, it can be implemented using these infinite resources.</p><h4>3. Segregation of Mutability</h4><p>One of the most common methods used to achieve immutability is to separate the system into mutable and immutable components. In this way, immutable components perform their functions functionally, without using any mutable variables. They then communicate with other components, enabling the necessary mutable operations to take place.</p><p>You can access the next section from the link below.</p><p><a href="https://medium.com/@mammimia/clean-architecture-part-iii-design-principles-solid-b8d06497001">Clean Architecture -&gt; PART III: Design Principles (SOLID)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0138a114eb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Architecture -> PART I: Introduction]]></title>
            <link>https://medium.com/@mammimia/clean-architecture-part-i-introduction-7a1b05ce3181?source=rss-2d65b0cb31ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a1b05ce3181</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[sofware-development]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Muhammed Ali Aydın]]></dc:creator>
            <pubDate>Sat, 01 Feb 2020 11:22:18 GMT</pubDate>
            <atom:updated>2020-02-03T08:16:07.858Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6mFSR3rkuUf2U58C" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, I summarized the book “Clean Architecture: A Craftsman’s Guide to Software Structure and Design” by Robert C. “Uncle Bob” Martin. The article consists of 5 parts and 27 chapters in total. Also all titles are used the same as in the book. Therefore, you can read from the book using the same title for more information.</p><p>Nowadays, even high school children can write a program and make it work. The code they wrote is probably not very good, but it works.</p><p>However, writing code and developing software is a completely different task. When the software is written correctly, the same work can be done using only a part of the human resources required to create and maintain it. This makes changes simple and quick. By reducing the required effort to minimum, functionality and flexibility can be maximized.</p><h3>Chapter 1: What is Design and Architecture</h3><p>For years, the semantic difference between design and architecture has been discussed. However, it can be said that there is no difference between these concepts.</p><p>Architecture is generally defined as a context used to purify high level from lower level detail; design is defined as lower level implementation of decisions and structures. Whereas low-level details and high-level structures are part of the system. Without one, the other cannot be used, nor is there a line that can separate them.</p><h3>Chapter 2: A Tale of Two Values</h3><p>There are two different values that each system provides to related places, behavior and structure. Software developers are obliged to ensure that the system will be developed by meeting these two values at high level. However, software developers often focus on one more than the other during development. Unfortunately, this makes the software system worthless.</p><h3>1. Behavior</h3><p>The machines requested by the persons concerned are coded by the developers to meet the requirements. When the machine violates these requirements, the developer tries to detect and resolve the bugs of this system. Most developers think that the job is to implementation and solve bugs according to requirements. However, this idea is wrong.</p><h3>2. Architecture</h3><p>Software is developed to make the system “soft”. The soft concept mentioned here is that the behavior of the system can be easily changed. If stakeholders decide to change a feature, this change should be made in a simple way.</p><p>The changes requested by the persons concerned are seen as simple changes in the same area, whereas on the developer’s side these are seen as pieces that need to be placed in the puzzle. Since the shape of the system does not match the shape of the request, each new request can be placed more difficult than the previous one.</p><p>The author used the concept of “shape” as a metaphor. This is because software developers are often forced to insert square nails into round holes.</p><h3>1. Eisenhower’s Matrix</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*poBYq8K-ppp3aBhf2L_f6A.jpeg" /><figcaption>Eisenhower’s</figcaption></figure><p>President Dwight Eisenhower presented a matrix about the importance and urgency of a business. He said the following about this matrix: “I have two kinds of problems, urgent and important. The urgent ones aren’t important and the important ones will never be urgent.”</p><p>This word is used today as an old saying. Things that are urgent are seldom important, and jobs that are important occasionally become urgent.</p><p>● The initial value of a software — behavior — is an urgent need, but not always particularly important.</p><p>● The second value of the software — architecture — is important, but will never be particularly urgent.</p><p>Of course, there will be both urgent and important, or both non-urgent and non-important. We can list them in order of importance:</p><p>▪ 1. Urgent and important</p><p>▪ 2. Not urgent and important</p><p>▪ 3. Urgent and not important</p><p>▪ 4. Neither urgent nor important</p><p>It should be borne in mind that the architecture of a code — because it is important — is in the top two in the list, and behavior — as urgent — in the first and third.</p><p>Common error during development is due to poor separation of first and third rows. This problem is due to the neglect of the important features of architecture and focusing on the development of a feature that may be useful to the system.</p><p>In summary, if architecture comes last, the system’s development will be costlier than it should be and it will be almost impossible to make changes to the system. If this was allowed to happen, this shows that the software development team did not struggle hard enough to design architecture correctly.</p><p>You can access the next section from the link below.</p><p><a href="https://medium.com/@mammimia/clean-architecture-part-ii-starting-with-the-bricks-programming-paradigms-a0138a114eb2">Clean Architecture -&gt; PART II: Starting With The Bricks: Programming Paradigms</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a1b05ce3181" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>