<?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 Ariel Kohan on Medium]]></title>
        <description><![CDATA[Stories by Ariel Kohan on Medium]]></description>
        <link>https://medium.com/@arielkohan?source=rss-a795de0d8b4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*R9GNJ6k7MfPAa0yQ30c2Hg.jpeg</url>
            <title>Stories by Ariel Kohan on Medium</title>
            <link>https://medium.com/@arielkohan?source=rss-a795de0d8b4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:06:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arielkohan/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[The Importance of Inversion of Control and the way to Achieve it using Dependency Injection]]></title>
            <link>https://medium.com/@arielkohan/inversion-of-control-ac8dd48e4341?source=rss-a795de0d8b4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac8dd48e4341</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[object-oriented]]></category>
            <dc:creator><![CDATA[Ariel Kohan]]></dc:creator>
            <pubDate>Sun, 08 Dec 2019 14:59:43 GMT</pubDate>
            <atom:updated>2019-12-08T14:59:43.163Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNlgXKlJo4DATTJnyLewDw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@patrykgradyscom?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Patryk Grądys</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>In my <a href="https://medium.com/@arielkohan/software-architect-why-and-how-899cbfdf0170">previous article</a>, I presented the motivation to pursue the role of a software architect and mentioned some major concepts that anyone interested in this topic should learn.</p><p>Today, we are going to discuss a principle that made one of the most significant transformations in the way I design software: the Inversion of Control, which is one of the five principles elaborated by Robert C. Martin (also known as “Uncle Bob”) in the first decade of this millennium. The rest of them are the principles of Single responsibility, Open-closed, Liskov Substitution, and Interface Segregation<strong>.</strong></p><p>These postulates are usually referenced by the acronym SOLID and, by augmenting the flexibility and extensibility of our creations, they represent a big contribution to the way we build software nowadays.</p><h3>Defining Inversion of Control Principle.</h3><p>First, let’s go back to the basics of the Object-Oriented Paradigm, whose main purpose is to solve problems by creating <strong>objects</strong> that symbolize <em>things</em> of a delimited part of the real world called <strong>domain</strong>. The <strong>classes</strong> provide the structure of those objects, specifying fields that express their current <strong>state </strong>and exposing <strong>methods</strong> that transform that internal state or give information about it.</p><p>Objects are constantly communicated with each other by <strong>messages </strong>that trigger methods in the counterpart. Think about an object “P” of the class <strong>Person </strong>that contains an object “C” of the class <strong>Car </strong>in its fields. Assuming that <strong>C</strong> allows the necessary operations, <strong>P</strong> could call methods like <em>startEngine</em>, <em>accelerate</em> and <em>brake</em>. Now, let’s describe two kinds of relations between the classes.</p><p>On the one hand, we can talk about a <strong>dependency relation</strong>: the source code of the Person class <strong>depends on </strong>the source code of the Car class; in the absence of the latter, there would be a compilation error in the first one — depending on the language. We can easily find dependency relations by looking at classes import/require statements.</p><p>On the other hand, there is a <strong>relationship of control </strong>in the same course as the previous one. The source code of the Person <strong>controls </strong>what the Car object does. P decides when C starts the engine by calling that method at a certain moment or when certain conditions are met.</p><p>These two connections sharing the same direction are the simplest way to think and design objects. However, the <strong>principle of Inversion of Control </strong>proposes that, thinking with a modular perspective, we can achieve a more flexible, testable and loosely-coupled software by <strong>opposing the directions of the dependency and the control</strong>.</p><p>Later we are going to discuss this further but for the moment, let’s keep this concept like that.</p><p><em>It is time to put on your seat belts, we are arriving at a case study.</em></p><h3>Case Study: My Online Store Shipments</h3><p>The simplest example would be to talk about database connections and the persistence world, but who likes obvious examples? I don’t. So today we are going to talk about the world of shipping.</p><p>Imagine you are starting a new online shop selling the most amazing <em>whatever you want</em>. You’ll have different modules like Catalog, Order Management, Customer Support, Shipping, and many others.</p><p>We are going to focus on Shipping for this demonstration and I’ll do my best to display different stages of the project and the real value of inversion of control.</p><p>Note: the following examples are based on a multi-module Java Project. However, the code was created to be readable to anyone with OO code experience. Besides, the idea is to focus on how the different kinds of shipping modules work and how they are used. Because of that, we will just use the abstraction <em>Application</em> or <em>Client</em> to represent a module that depends on shipping. The <a href="https://github.com/arielkohan/inversion-of-control-demo">repository is hosted on Github</a> and contains different branches that represent the different stages of the system.</p><h3>The shipping world before Inversion of Control and Dependency Injection</h3><p>If we are starting a business we probably lack enough infrastructure to handle the shipping on our own. The idea here is to outsource this part of the process: we need to integrate our system with a 3rd party company to automate the shipping requests.</p><h3>The Terrifying Worst Case 👻</h3><p>Assume we use UPS and, to prevent verbosity in the example, we also have an SDK to integrate with them.</p><p><em>Hurry! We have to deliver code! What do we do? Oh, look at that UPS library, isn’t that cute? Let’s use it where we need it </em>😇<em> </em>— ladies and gentlemen, this is the place where the terror and the most horrible creatures are hidden.</p><p>What happens next? The ShippingClient class is born — some code was deleted to reduce the size of the code. Take a quick look, especially to the <em>shipStuff</em> method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6a5c236f2d2dc172947353036a2d7d8/href">https://medium.com/media/a6a5c236f2d2dc172947353036a2d7d8/href</a></iframe><p>Three of the four lines of the <em>shipStuff</em> are UPS-specific. We could add two more lines if we take a look at the private methods. That doesn’t feel quite right. What would happen if we have to ship stuff from five different modules? UPS lines would be invading those modules. What if we want to migrate to FedEx? Well… I wouldn’t like to be in front of the developers when they are told to make that modification.</p><p>You may note that we are depending on <em>com.arielkohan.[…].UpsLibrary</em>. That class is contained in the <em>ups-shipping-library</em> module, which was created to simulate a real SDK but the idea is to think about it as something managed by a 3rd party.</p><p>If we climb to the upper floor, this would be a global perspective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*QsKr33plhjjRtMomelBJDw.png" /><figcaption>Modules Diagram generated by IntelliJ Idea.</figcaption></figure><p>Like I said before, <em>Application</em> represents a module that needs the ability to ship something but we can also think that there are multiple modules with that requirement.</p><p>You can access the complete version of this stage <a href="https://github.com/arielkohan/inversion-of-control-demo/tree/worst-case">here</a>.</p><p><em>Ok, guys, it seems that we have some problems with this solution. We must refactor this and make something better. Who is with me!?</em></p><h3>First steps in the right direction.</h3><p>We reflect on that for two long minutes, we take a quick look at the code and we make the decision: send the troop to encapsulate the methods of the library.</p><p>We discover that UPS let us calculate prices and ship orders with two different priorities: STANDARD and FASTEST shipments. We have to deploy the new version before the end of the week so we rapidly create a <em>shipping</em> module with a Shipping class, a new class with the methods <em>calculateStandardPrice</em>, <em>standardShip</em>, <em>calculateFastestPrice, </em>and <em>fastestShip</em>. All of them receive objects from our model so we feel the satisfaction that now every module can access this functionality without UPS lines.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c5da95847b7bfd1bdce3d5b64441189/href">https://medium.com/media/7c5da95847b7bfd1bdce3d5b64441189/href</a></iframe><p>So now, our ShippingClient is also transformed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e78d2c8b5c227b96787a7c5e3062fbca/href">https://medium.com/media/e78d2c8b5c227b96787a7c5e3062fbca/href</a></iframe><p>The global perspective can be diagramed like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*qvdGB35ZoGcFlBjEK3TYxg.png" /><figcaption><em>Diagram generated with Intellij Idea + some manual modifications.</em></figcaption></figure><p>The application client now depends directly on a module that we own, but the UPS library is not gone, it’s just an internal dependency of our shipping module.</p><p>Well, in fact, Application still has access to the UPS classes — if we depend directly on a module, we have access to their dependencies too. And it means that the previous ShippingClient would still be working. In a real-world scenario, with other lazy or ignorant devs, that could lead to some modules upgrading their dependencies but leaving some code with references to 3rd party code. That could cause trouble, couldn’t it?</p><p>Furthermore, don’t you think that this encapsulation is too much based on the external library? Same question as before: what would happen if we migrate to another provider? Probably the changes will be easier now, but we may not have the FASTEST shipment available and we would have to change our implementation. The result: we would still have to modify every module client.</p><p>In case you are not easy to convince, let me give you more. Testing. What about it? No system can compose an acceptable architecture without a good amount of testing behind it. No system can be flexible and maintainable without it. Blame on you if you can sleep lacking properly testing, at least, the most important parts of your business process.</p><p>See, how could we test the shipping client without generating real UPS orders? How can we provide a stub implementation so we can unit test our code easily without side effects? How can we simulate failure behavior?</p><p>In the following sections, we are going to refactor the code using Dependency Injection to achieve Inversion of Control. That will allow us to answer the questions and solve our problems.</p><p>Find the complete version of this intermediate stage <a href="https://github.com/arielkohan/inversion-of-control-demo/tree/improvable-case">here</a>.</p><h3>Dependency Injection For The Win</h3><p>I spent a few minutes trying to find an interesting definition of dependency injection and I ran into this StackOverflow question:</p><p><a href="https://stackoverflow.com/questions/1638919/how-to-explain-dependency-injection-to-a-5-year-old"><em>How to explain dependency injection to a 5-year-old?</em></a></p><p>The question was closed because it doesn’t fit the site’s standards but, before that, there was enough time for a guy called John Munsch to make a lovely <a href="https://stackoverflow.com/a/1638961/7123734">answer</a> that we can work with:</p><blockquote>When you go and get things out of the refrigerator for yourself, you can cause problems. You might leave the door open, you might get something Mommy or Daddy doesn’t want you to have. You might even be looking for something we don’t even have or which has expired.</blockquote><blockquote>What you should be doing is stating a need, “I need something to drink with lunch,” and then we will make sure you have something when you sit down to eat.</blockquote><p>Now, allow me to translate that answer. The first paragraph is talking about the problems of not applying dependency injection: let’s play the role of a software component for a moment.</p><p>As a component, we would need the help of another component to achieve a certain task like the kid that needs a juice or something to drink. Then, we could construct the other component with all the implementation details that it needs, similar to a kid going to the refrigerator and searching specifically for an orange juice.</p><p>In that case we would be making a potential mistake: as the second paragraph of the answer suggests, we only need to achieve a certain task (drink something) and, as long as the other component allow that, we shouldn’t be worried about the other component specifics (if there is not juice, the kid could drink a soda or water and he will be fine; but if the only option that he would accept is orange juice, then he will not be able to drink). Dependency injection is the mechanism that helps us provide already-constructed specific implementations where certain characteristics are expected.</p><p>If we go back to our shipping example, we could say that the shipping clients don’t really need to know that UPS is handling the shipments for them, they just need to be able to ship stuff — even if we decide to handle the shipments ourselves, those components don’t need to and shouldn’t know it. Moreover, they don’t even need to know how to construct the Shipping implementation. Give them a well-defined interface, inject the real implementations where it’s required and you’ll get something much flexible and maintainable.</p><p>In the first sections, I mentioned that inversion of control is about having <strong>dependencies</strong> relations pointing to one direction and <strong>control</strong> to the other. Next, we will refactor our project to achieve this.</p><h3>Injecting dependencies in our Project</h3><p><em>Quick paragraph about the tools to use…</em></p><p>It is not the scope of this article to explain how to implement a dependency injection mechanism so we are going to use <a href="https://spring.io/projects/spring-boot">Spring Boot</a>. What is important to mention about it is the concept of bean: objects that can be injected where we need them. These objects usually depend on other beans; Spring lets you decide if you want it to take care of all of this automatically or if you want to wrap certain objects manually. There are different ways to configure beans here but we’ll only show the ones that I used the most:</p><ul><li>Special annotations (like ‘<em>@Component’</em>) in the implementation class of the bean. See the new version of the Shipping Client.</li><li>‘<em>@Bean’</em> methods that return objects of the type of the bean you need. See the Bean method in the new Application class.</li></ul><p><em>Ok, back to our project…</em></p><p>This time we are going to implement the best solution we can. But what that would be exactly? If we recap our previous problems, we could mention the following desires:</p><ol><li><strong>Forbid</strong> client-modules to <strong>depend on specific</strong> shipping implementations.</li><li>Client modules <strong>shouldn’t need to know the details of constructing</strong> the shipping implementation.</li><li><strong>Maximum flexibility</strong> in the architecture: there should be a way to use different shipping implementations depending on external things like environment properties or making a difference in whole-system executions versus unit tests.</li><li>Client modules should be <strong>easy to test</strong> and don’t generate side effects.</li></ol><p>The first thing we are going to do to achieve this is to create a well-defined interface. Not only a Java interface, but this will also be a whole new module with multiple files:</p><ul><li><strong>Request objects: </strong>data transfer objects or enums that we are going to receive as parameters describing the details of the request.</li><li><strong>Exceptions:</strong> business errors that we could throw if something unexpected happens or if we can’t accomplish what the client needs.</li><li><strong>Response objects:</strong> for simplicity, we won’t create/use them in this example.</li><li><strong>The java interface itself</strong>, that will be replaced with some specific implementation.</li></ul><p>It’s crucial to design this interface thinking in terms of our business needs, and not with the 3rd party code in mind — we can worry about that when we create an implementation that works as an adapter between our core and the library or external API that we use.</p><p>The files for the <em>shipping-interface</em> module:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b001bae86d8ae8f288f30280b1e18c8/href">https://medium.com/media/3b001bae86d8ae8f288f30280b1e18c8/href</a></iframe><p>We would also have our <em>ups-shipping</em> module that will contain the <em>UpsShippingImpl</em> implementation class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7515b527dd643ba6983cd0111522ac1/href">https://medium.com/media/f7515b527dd643ba6983cd0111522ac1/href</a></iframe><p>Another important but small modification: the shipping client modules must only reference the <em>shipping-interface</em> module, but the module that starts the whole application should have references to all the interface and implementations so it’s able to inject <em>real </em>stuff where it’s needed. Because of that, we will split the previous client module between an <em>application</em> module and a <em>shipping-client</em> module. In a more realistic scenario, we would have multiple shipping clients and all of them would only have reference to the interface.</p><p>That said, let’s take a look at the files of those two modules.</p><p>The new shipping client:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83f602767635eb03cf693ec10d6f64c2/href">https://medium.com/media/83f602767635eb03cf693ec10d6f64c2/href</a></iframe><p>The component annotation in line 12 tells spring to mark this class as a bean. At execution time, the framework will try to construct this object, considering the requirements — constructor parameters — and passing the available implementations to satisfy them.</p><p>The new Application class:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aca6106119bc80de63fb1bf9e410f887/href">https://medium.com/media/aca6106119bc80de63fb1bf9e410f887/href</a></iframe><p>The <em>SpringBootApplication</em> annotation makes Spring start looking for other configurations across the whole project and mark this class as a configuration class itself, allowing us to add the bean method at line 18, where we set a <em>UpsShippingImpl</em> object as the implementation to use instead of the <em>Shipping</em> interface.</p><p>At lines 13 and 14 we start the Spring application and we ask for the shipping client bean — the one that was automatically configured with the component annotation.</p><p><em>Take the elevator and let’s see the global picture from above.</em></p><p>From the second floor we can see a simplified class diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*Tbj0pAtONyr7mS3egcsCCg.png" /><figcaption><em>Diagram generated with Intellij Idea + some manual modifications.</em></figcaption></figure><p>If we define our <strong>Business Core </strong>as the area of our application that contains the business logic that our systems needs in order to work and <strong>Implementation Details </strong>as some specific replaceable solutions that provide some functionality, we could say that the <em>shipping-client </em>and the <em>shipping-interface</em> modules can be part of the first one and the UPS implementation, part of the latest. Remember: <em>shipping-client</em> could be replaced by more realistic modules like <em>order </em>or<em> customer-support</em>.</p><p>Now, take a look at the arrows of the diagram: all of them represent <strong>dependencies</strong>. Do you see how <strong>all the arrows from the UPS implementation point towards the business core</strong>? However, how do you think that <em>control </em>arrows would be represented? <strong>The control would be directed from the business core to the implementation detail</strong>.</p><p>In his book <a href="https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164#:~:targetText=Clean%20Architecture%3A%20A%20Craftsman&#39;s%20Guide%20to%20Software%20Structure%20and%20Design,Martin%20(Author)"><em>Clean Architecture</em></a><em>, Uncle Bob defines this as an </em><strong><em>architectural boundary</em></strong>, where all the dependencies cross the boundary in one direction: from details to higher-level policies. And this, of course, can be extended to other details like the persistence mechanism or the presentation layer. The databases don’t need to be the core of our systems — in fact, they shouldn’t. With this principle and techniques, we could start our projects working with an in-memory repository and then, when we have a stronger understanding of the project, decide which kind of persistence are we going to use.</p><p>The main purpose of these actions is to isolate our business rules — our real value — from changes caused by replaceable details. Actually, now we could plug-out and plug-in new shipping implementations in a few minutes and our core won’t notice it.</p><p><em>Inversion of control achieved, my friends.</em></p><p>Let’s go to the third floor to see that more clearly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*UT_TgzVKKVf4Tuh665rHwQ.png" /><figcaption><em>Diagram generated with Intellij Idea + some manual modifications.</em></figcaption></figure><p>The status of our previous desires?</p><ul><li><strong>Forbid client-modules to depend on specific shipping implementations</strong>. The shipping client can’t access any UPS specific class.</li><li><strong>Client modules shouldn’t need to know the details of constructing the shipping implementation.</strong><em> </em>They don’t. Shipping client doesn’t know anything about how we create a Shipping object.</li><li><strong>Maximum flexibility in the architecture: there should be a way to use different shipping implementations depending on external things like environment properties or making a difference in whole-system executions versus unit tests. </strong>For external properties<em>, </em>we could just create another implementation module and modify the Bean method to create objects depending on that value. For the scopes of tests, we could create a stubborn implementation module and add that dependency in the modules with test scope — for Java see <a href="https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope">Maven Dependency Scopes</a>.</li><li><strong>Client modules should be easy to test and don’t generate side effects.</strong><em> </em>If you don’t like the option in the previous bullet, you could just create an <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html">anonymous class</a> implementation for the test.</li></ul><p>In the following JUnit test example, I demonstrate the case mentioned in the last sentence.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39137c7dfcae247e0ce5e1cea2a1b86e/href">https://medium.com/media/39137c7dfcae247e0ce5e1cea2a1b86e/href</a></iframe><p>Pretty cool, right? It seems that we reached our goal.</p><p>The complete version <a href="https://github.com/arielkohan/inversion-of-control-demo/tree/ioc-version">here</a>.</p><h3>That’s it.</h3><p>If we keep this mentality when we design and implement our systems, I’m sure that the quality and flexibility of our systems would be incredible.</p><p>Take a look at this tweet that Vaughn Vernon, one of the most important people in the world of Domain-Driven Design, shared a few days ago:</p><h3>Vaughn Vernon on Twitter</h3><p>When you start with this, monolith to microservices is a few days away. You may even decide not to.</p><p>I don’t know what you think but I’d say that he is talking about modules with well-defined interfaces and the possibilities that this gives us.</p><h3>Bonus Track For Java Devs</h3><p>If you are a Java Dev that use to work with modules or if you can take a few days to learn that. There are a few tasks that you could try and will probably help you to understand everything better:</p><ol><li>Clone or fork the <a href="https://github.com/arielkohan/inversion-of-control-demo">repository</a>.</li><li>Create another shipping implementation module and adjust the Bean method in Application to use your new implementation.</li><li>Create a stub implementation for tests and adjust the maven file to import it with Test scope in the shipping client. Update the test to use that implementation.</li><li>Create a new implementation module that depending on some characteristics of the request, decide if it uses a UPS implementation or the implementation that you created for (1). Hint: that module will have references to the Shipping interface, the UPS implementation and the implementation that you created.</li><li>Make sure to let me know how it goes!</li></ol><h3>Contact.</h3><p>If you need some help with the<strong><em> </em></strong>previous steps, feel free to add a question in comments or to send me an email to arielkohan94@gmail.com with the subject ‘IoC article’.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac8dd48e4341" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you a Software Dev? Why and How you Should Empower Yourself as an Architect.]]></title>
            <link>https://medium.com/@arielkohan/software-architect-why-and-how-899cbfdf0170?source=rss-a795de0d8b4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/899cbfdf0170</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ariel Kohan]]></dc:creator>
            <pubDate>Sat, 16 Nov 2019 19:40:46 GMT</pubDate>
            <atom:updated>2019-11-16T19:40:46.178Z</atom:updated>
            <content:encoded><![CDATA[<p>If you enjoy what you do, you are going to love this.</p><figure><img alt="Dark desk with a Macbook." src="https://cdn-images-1.medium.com/max/1024/1*2U-LMRCunGq62A8goFfrDg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@nkachanovskyyy?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Nikita Kachanovsky</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>I know who you are 🙈</h3><p>If you are a software developer that likes what you do, then I can tell more about you. You are a <strong>problem-solver that sees complexity as an opportunity to demonstrate what you are capable of</strong>. You appreciate the freedom to investigate, think, test and create; you dislike repetitive work and tasks with every step defined in detail. Yeap, I know… You prefer to build something to automate that.</p><p>If you feel that this description talks about you, then we are similar and hopefully, this article will serve its purpose.</p><h3>First of all, what do we really mean when we talk about Software Architecture 🧐</h3><p>According to <a href="https://en.wikipedia.org/wiki/Software_architecture">Wikipedia</a>…</p><blockquote>Software architecture refers to the fundamental structures of a software system and the discipline of creating such structures and systems. Each structure comprises software elements, relations among them, and properties of both elements and relations.</blockquote><p>With this definition, it is clear that every executable piece of software has its own structure. Furthermore, systems are usually formed by a bunch of clearly separable services that constitute a network that communicates in different ways.</p><p>Software architects are big-decision-makers (aka heroes). They analyze the requirements and the organization to determine if and how a system should be divided; the responsibilities of each division; the internal designs; programming languages; and the technologies used in the communication. Moreover, they envision how the system could be changed while scaling or being extended.</p><p>In fact, the levels of flexibility of a software project are usually degraded with the pass of time — the amount of effort required to make a change increase exponentially. Because of that, one of the most — if not <strong>the</strong> most — important goals of this position is to take the necessary actions to prevent that situation as much as possible.</p><p>Now, let’s remember some wise words of uncle ben…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FMCZ39lz83o5lC%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2FMCZ39lz83o5lC&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2FMCZ39lz83o5lC%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="232" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe7baf112f07e31b98890f8bd7ab28f7/href">https://medium.com/media/fe7baf112f07e31b98890f8bd7ab28f7/href</a></iframe><p>In spite of I wouldn’t recommend a software architect to say out loud that (s)he is like Peter Parker, (s)he is indeed responsible for her/his decision and, even though everyone makes mistakes, (s)he must promise to investigate and evaluate different possibilities and have a reasonable justification for each decision.</p><h3>Specific decisions that you could take as an Architect</h3><p>Of course… The theory is great but we also need concrete stuff. Let’s go there.</p><p>Jim is an architect and he wants to be a good guy. One day, his employer/client comes and asks him to lead a team dedicated to the creation of an articles management system. Writers should be able to publish articles and the software will be in charge of delivering the content to readers, classifying that content and generating recommendations (what a marvelous slice of creativity, right?).</p><p>Assuming that the requirements are better specified than that, Jim would have to consider his resources (team size and abilities) and take some of the following decisions:</p><ul><li><strong>In how many business areas (Bounded Contexts) should the domain be divided.</strong></li><li><strong>How many backend services should be created for the first version of the system: </strong>one (Monolithic) or more (Microservices)<strong>.</strong></li><li><strong>If a Serverless solution makes sense for some use cases.</strong></li><li><strong>Take leverage of some NoSQL databases in some services: </strong>ElasticSearch, MongoDB, Redis, Cassandra.</li><li><strong>Programming languages, Frameworks.</strong></li><li><strong>Which information should be cached, where and how.</strong></li><li><strong>Types of communication between services and with the outside world: </strong>Http, Websockets, Event Sourcing.</li><li><strong>The internal designs of services to keep the system in a modular and loosely-coupled state allowing flexibility and future improvements.</strong></li></ul><p>Of course, we could mention other choices to take but let’s skip them for the moment.</p><p>Jim, like every architect that praises himself, is always reading about new technologies, standards, and patterns; that help him to form new ideas and imagine ideal scenarios for what was requested. However, he comprehends that he is part of a team with limited resources and abilities, therefore, it is crucial to add that variable as brain-input to make judgments.</p><p>Some details are usually done temporarily in some way and planned to be modified when certain conditions are reached.</p><p>How would you feel if this task is assigned to you? You could be a little bit nervous. Nonetheless, if you are like Jim and me, I’m sure that excitement would be all over your body. A sense of challenge would be in your mind and you would start thinking about different possibilities immediately. With these augmented responsibilities, those qualities you appreciate of being a software developer would skyrocket. Besides, it’s important to make clear that an architect codes less but doesn’t stop doing it. As a matter of fact, an architect is usually one of the most capable programmers.</p><h3>How can I become an Architect</h3><p>There isn’t a clear roadmap to follow before being capable of applying to this position, but, apart from the soft skills (clear communication, empathy, etcetera) that are strongly desirable, we could definitely suggest some technical skills that a candidate should learn.</p><ol><li><strong>[Not a MUST but strongly recommended] Deep knowledge in, at least, one programming language with Object-Oriented Features. </strong>Java, C#, Go, you name it. Though every language is different and has its own details, any who conquer the singularities in one of them has faced common problems for software developers and has discovered tools, libraries or classes that usually have a counterpart in other technologies. Even if you work on a system using a language with other characteristics, this experience will certainly help you to design services (or a group of services) with a more flexible and decoupled structure.</li><li><strong>Understanding the main programming paradigms. </strong>The purpose of them and how their concepts can be interrelated in a single application.</li><li><strong>Familiarity with the principal Design Patterns. </strong>The use cases of Creational, Structural and Behavioral OO patterns but also Functional patterns like Clojure, Currying and Function Composition.</li><li><strong>Awareness of important software principles like Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation and Dependency Inversion (SOLID). </strong>Meaning, benefits, and techniques to achieve them.</li><li><strong>Comprehension of both traditional and trendy architectures.</strong> Master-Slave; Client-Server; Microservices; Serverless; Event Sourcing; CQRS; and many others.</li><li><strong>Experience with currently accepted Good Practices. </strong>Domain-Driven Design, Test Driven Development, Continuous Integration, Continuous Delivery, etcetera.</li><li><strong>Certain consciousness of new security and communication standards. </strong>What are they solving and how much advantage do they represent compared with the previous techniques.</li></ol><p>The list can continue. An architect could reach a point that (s)he knows the most important areas but it is evident that (s)he has to keep learning until the end of his life in that role. Believe me, it’s worth it.</p><h3>Empowerment 💪</h3><p>Is it not possible to assure that your company is going to put Software Architect as your title if you start this learning path. Nevertheless, if you start this learning path and demonstrate your evolution, some things will undoubtedly happen.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F2rEbZGCeHsBk4%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2F2rEbZGCeHsBk4&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F2rEbZGCeHsBk4%2Fgiphy-downsized-large.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/623cb7f14ded07c1434c65cf56ad12a0/href">https://medium.com/media/623cb7f14ded07c1434c65cf56ad12a0/href</a></iframe><p>By starting making recommendations and suggestions to improve the development goals, people will start asking you to <strong>participate in their software design discussions</strong> and you will <strong>stop abiding</strong> others’ choices.</p><p>Your voice will be heard like never before. Furthermore, you could start <strong>teaching</strong> these things to your colleagues — one of the best ways to affirm your current knowledge 🤓. Once you are on that, you will have the possibility to analyze the problems of other people and learn from them, accelerating your learning curve.</p><p>The more skills you prove, the more <strong>freedom</strong> you will get. Hence, instead of receiving details that simplify the solution of those complex problems, you’ll be defied with <strong>challenges of your real size</strong>.</p><h3>Hello World.</h3><p>This article presents important tasks that can be entrusted to you at the end of this route. Luckily, one day you will be there so I would like to add a bit of personal advice:</p><p>While you increment your knowledge, you’ll find things that could be improved and technically ideal possibilities for future developments. Then, don’t rush on taking quick elections and dedicate some time to think about the world that surrounds you: hierarchical structure of your organization, the form of developer teams, number of people that could apply their efforts in your project, among others.</p><p>Remember: it is not the primary goal of your organization to make the purest piece of software, so, even knowing that imperfect choices have side effects, it is sometimes wise not to pursue the most ideal case.</p><h3>Future Content.</h3><p>In the following weeks, I will be delivering a series of opinionated articles seeking the goal of sharing some details of architectural concepts and demonstrations with real and specific examples.</p><p>Thanks for taking the time to read this, see you soon! 😊 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=899cbfdf0170" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>