<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Francesco Strazzullo</title>
    <description>The latest articles on DEV Community by Francesco Strazzullo (@francescostrazzullo).</description>
    <link>https://dev.to/francescostrazzullo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F125717%2F9f582d27-6d34-4eca-87ea-a1ec79aa57aa.jpeg</url>
      <title>DEV Community: Francesco Strazzullo</title>
      <link>https://dev.to/francescostrazzullo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/francescostrazzullo"/>
    <language>en</language>
    <item>
      <title>Remove Legacy Roadblocks with Architectural Clash</title>
      <dc:creator>Francesco Strazzullo</dc:creator>
      <pubDate>Mon, 15 Mar 2021 15:21:59 +0000</pubDate>
      <link>https://dev.to/claranet/remove-legacy-roadblocks-with-architectural-clash-dgb</link>
      <guid>https://dev.to/claranet/remove-legacy-roadblocks-with-architectural-clash-dgb</guid>
      <description>&lt;p&gt;The modernization of existing software is becoming increasingly important in the development ecosystem. Quoting Forbes: “Now Every Company Is A Software Company”, but a large part of enterprise software is not ready for the swift changes companies need now.&lt;/p&gt;

&lt;p&gt;Flowing is currently helping many companies struggle through their path to software modernization. We are usually called to help development teams when they are stuck with a new set of features that seem unfeasible with the current codebase/framework/architecture. Other times, our purpose is to help refactor a codebase in bad shape that is not letting the team bring enough value to their core business.&lt;/p&gt;

&lt;p&gt;We developed a dedicated brainstorming format called &lt;strong&gt;Architectural Clash&lt;/strong&gt;for both of these use cases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rdVK9NIv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3308/1%2Ar_t6T5zH3f0UCAZNxxLYIw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rdVK9NIv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/3308/1%2Ar_t6T5zH3f0UCAZNxxLYIw.png" alt="Architectural Clash" width="800" height="314"&gt;&lt;/a&gt;&lt;em&gt;Architectural Clash&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Architectural Clash is a two-day workshop to help clients remove the roadblocks with which our clients are struggling. As an example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“We would like to build a mobile version of our desktop application, but our desktop clients are directly connected to the database.”&lt;/p&gt;

&lt;p&gt;“Our codebase is a &lt;a href="https://en.wikipedia.org/wiki/Big_ball_of_mud"&gt;big ball of mud&lt;/a&gt;, and we are struggling to add a new set of features to it. We want to start working with microservices but don’t know where to start.”&lt;/p&gt;

&lt;p&gt;“Our front end is based on AngularJS. We want to stop using it and think that the only solution is to rewrite everything from scratch. Are there other options?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The main advantage of Architectural Clash is that it is an extremely practical format. We don’t waste a lot of time on analysis and hypothesis, but we start working immediately on the existing codebase. Half of the workshop is hWorkshop with our team mixing with the existing client’s team to tackle problems.&lt;/p&gt;

&lt;p&gt;An Architectural Clash is divided into three phases: Sense-Making, Clash and Decide.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JZu3l9Wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4528/1%2AXNtxODXceIf4zDnUoEsgAQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JZu3l9Wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4528/1%2AXNtxODXceIf4zDnUoEsgAQ.png" width="800" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sense-Making
&lt;/h2&gt;

&lt;p&gt;The first phase of an Architectural Clash is called Sense-Making, and its focus is to help everybody (our team and the client) better understand the boundaries of the problem. For this phase, the presence of all the interested stakeholders in the product is required.&lt;/p&gt;

&lt;p&gt;The main purpose of this phase is to understand how technical problems are related to business problems. &lt;strong&gt;Most of the time, refactoring processes fail because they are not directly connected with business goals.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a developer team complains about working with old technologies or a very confusing (or untested) codebase, we ask, “What is the &lt;em&gt;real&lt;/em&gt; problem?”. We do that with the stakeholders to find hidden connections between code and business. As an example, we try to clarify that having an untested codebase would lead to dangerous bugs that could be disastrous or the connection between a big ball of mud and the team's throughput.&lt;/p&gt;

&lt;p&gt;We do that by asking the client about the business's goal and then trying to understand the technical roadblocks to reaching that goal. One of the exercises we use in this phase is the &lt;a href="https://www.atlassian.com/team-playbook/plays/elevator-pitch"&gt;Elevator Pitch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WA9lgyQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/5404/1%2Ab_K6XCa_r5SAXoWnTfSxDA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WA9lgyQ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/5404/1%2Ab_K6XCa_r5SAXoWnTfSxDA.png" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the definition of the goal of the product, we start to identify the roadblocks and how to tackle them. However, there is a caveat when proposing a solution. All the proposed solutions to roadblocks should be written as an experiment. As an example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We believe that by using Cypress, we could add an end-to-end test suite to our product in a short time.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice that you add an expectation to the task of adding Cypress. This forces you to analyze your results after the experiment, comparing them to your expectations.&lt;/p&gt;

&lt;p&gt;So, the outcome of the first phase of the Workshop is a workshop experiment that will be the main ingredient of the next phase: &lt;em&gt;Clash&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Clash
&lt;/h2&gt;

&lt;p&gt;There is another important difference between an experiment and a task, a timebox. During the Clash phase of the workshop,** tWorkshopse of the team is to run the greatest possible number of experiments**.&lt;/p&gt;

&lt;p&gt;The eight hours of the second phase are split into eight one-hour slots. For every slot, some experiments run in parallel, dividing your team into several small teams. Every team can work for 45 minutes. At the end of the 45 minutes, all the small teams gather together to share what they learned running the experiment in the remaining 15 minutes of the slot. To help the team track down and share their results, we use a simple &lt;a href="https://docs.google.com/document/d/1RrwBSZJ3F0NcwAcIWkgjLJaEOavMXdEUZfXxiP7s7o4/edit?usp=sharing"&gt;document&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HxUiQSba--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AjnkAQ-lUzS02iOTLtkGA0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HxUiQSba--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AjnkAQ-lUzS02iOTLtkGA0w.png" alt="Experiment Outcome Template" width="800" height="1115"&gt;&lt;/a&gt;&lt;em&gt;Experiment Outcome Template&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After the slot ends, a new cycle begins until the time runs out. After every cycle, the teams could be mixed up, and each team could decide to go deeper with another experiment on the same topic or to start with something new.&lt;/p&gt;

&lt;p&gt;As Flowing, we don’t just provide a facilitator for this workshop but a team that can work in the clash phase with the client’s team. This is quite important because developers should be biased towards their codebase when dealing with legacy code. &lt;strong&gt;Reasoning and writing code with somebody who doesn’t know anything about that codebase and its history can help see things in a new way, finding new and unexpected solutions&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide
&lt;/h2&gt;

&lt;p&gt;The last phase of the Architectural Clash is “Decide”. In this phase, we take all the information about the business goals analyzed in the “Sense-Making” phase, with the outcomes of the Clash phase. Trying to define and prioritize a roadmap that will, in time, remove most of the roadblocks that are causing problems to developers and the business of our clients. In this phase, a possible exercise to use is called &lt;a href="https://medium.com/creditas-tech/managing-changes-with-the-lean-change-management-model-c3566935e10b"&gt;“Options Board”&lt;/a&gt;. In this exercise, all the actions extracted from the outcomes of the Clash phase and put on a cost/value graph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iVNPxsZK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/5256/1%2ALKRdWQtV0eSnSulAR_8Qyg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iVNPxsZK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/5256/1%2ALKRdWQtV0eSnSulAR_8Qyg.png" alt="[Lean Change Management Options Board v1.0](https://leanchange.org/wp-content/uploads/2015/09/LCM-OptionsBoard.pdf)" width="800" height="542"&gt;&lt;/a&gt;&lt;em&gt;&lt;a href="https://leanchange.org/wp-content/uploads/2015/09/LCM-OptionsBoard.pdf"&gt;Lean Change Management Options Board v1.0&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From this and other charts, we categorize and prioritize the actionable, creating a roadmap.&lt;/p&gt;

&lt;p&gt;If you think that Architectural Clash could be useful for your company, or if you have any questions, feel free to contact me at &lt;a href="//mailto:francesco.strazzullo@claranet.com"&gt;francesco.strazzullo@claranet.com&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Usual Path: a decision-making anti-pattern.</title>
      <dc:creator>Francesco Strazzullo</dc:creator>
      <pubDate>Sat, 16 Jan 2021 21:56:36 +0000</pubDate>
      <link>https://dev.to/claranet/the-usual-path-a-decision-making-anti-pattern-8np</link>
      <guid>https://dev.to/claranet/the-usual-path-a-decision-making-anti-pattern-8np</guid>
      <description>&lt;p&gt;In the last few years, I started to love boring technologies. It’s most likely connected to my age, and many projects started with bleeding-edge technologies following the hype. Usually, in the initial brainstorming meetings, I’m the grumpy guy that exclaims: “Do we really need GraphQL, a boring REST API is not enough?”.&lt;/p&gt;

&lt;p&gt;Obviously, younger teammates are generally mad at me. They see me as a &lt;strong&gt;buzzkill&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X1C4Iu0y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AC8wMXoohHXbM_ZbXyxvF9A.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X1C4Iu0y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2AC8wMXoohHXbM_ZbXyxvF9A.jpeg" alt="Grumpy Strazz" width="500" height="617"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nevertheless, I do the same work with my clients and not just with my colleagues. I frequently help them in choosing technology stacks. While I’m quite good at &lt;a href="https://medium.com/better-programming/are-you-a-hype-driven-developer-368586c27051"&gt;demystifying Hype&lt;/a&gt; when choosing technologies for a greenfield product, I usually feel puzzled when a team has the opposite approach: &lt;strong&gt;walking the usual path&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is the typical conversation I have with teams affected by The Usual Path.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;2010&lt;br&gt;
Me: What Framework should we use for this new project?&lt;br&gt;
Client: AngularJS!&lt;br&gt;
Me: It’s a bit new, but ok! Let’s try it&lt;/p&gt;



&lt;p&gt;2013&lt;br&gt;
Me: What Framework should we use for this new project?&lt;br&gt;
Client: AngularJS!&lt;br&gt;
Me: It’s quite mainstream now, and you have a lot of experienced developers that are quite skilled with it. I think it’s a good idea.&lt;/p&gt;



&lt;p&gt;2017&lt;br&gt;
Me: What Framework should we use for this new project?&lt;br&gt;
Client: AngularJS!&lt;br&gt;
Me: You Know, Angular 2 is out now. Perhaps you should consider it?&lt;br&gt;
Client: It’s not the right project to learn new technologies. Next time, perhaps…&lt;/p&gt;



&lt;p&gt;2022&lt;br&gt;
Me: What Framework should we use for this new project?&lt;br&gt;
Client: AngularJS!&lt;br&gt;
Me: I think it’s a really bad idea, the LTS is over.&lt;br&gt;
Client: I know, but we don’t have time! We have a very strict deadline! Let’s go build some directives now!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This conversation never happened, but I can assure you that something similar happened to me quite often in these years as a consultant, trying to help developer teams in making mindful decisions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sggpvnLY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4002/1%2A7NISSm8tdXetxwR23wc6-w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sggpvnLY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/4002/1%2A7NISSm8tdXetxwR23wc6-w.png" width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some years ago, I collaborated with a company that built all their core products with &lt;em&gt;Visual FoxPro&lt;/em&gt;. They were real experts in Visual FoxPro, and over the years, they became better and better. But they fall victim to the &lt;a href="https://en.wikipedia.org/wiki/Law_of_the_instrument"&gt;Golden Hammer&lt;/a&gt; law:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If all you have is a hammer, everything looks like a nail&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When Microsoft announced that Visual FoxPro would not be supported anymore, they started to realize their situation. &lt;strong&gt;They panicked and started to think about how to survive&lt;/strong&gt;. One of the proposals that emerged during that time was to give their customers laptops with Windows XP in a bundle with their software to prevent users from upgrading. I really don’t know how they solved it; I just stopped collaborating with them. But that story still haunts me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;At that time, I felt it was entirely a technical problem&lt;/strong&gt;; people were too lazy to study new stuff and fell behind. But now I know that this is just the tip of the Iceberg. So, whenever I feel that a team is walking the Usual Path, I ask questions. I want to know the &lt;em&gt;root cause&lt;/em&gt; of their reluctance.&lt;/p&gt;

&lt;h3&gt;
  
  
  It’s a “People” problem
&lt;/h3&gt;

&lt;p&gt;Developers are not “lazy”, but &lt;strong&gt;they can become “lazy” if they work in an environment that becomes toxic for innovation.&lt;/strong&gt; I observed two main factors that usually lead to the Usual Path.&lt;/p&gt;

&lt;p&gt;The first one is related to the power structure of a company. I observed that when people are afraid of trying something new, the real thing that people are afraid of is the consequences of failure. If you constantly fear that your team will be blamed for missing a deadline, you will choose to remain in your comfort zone. Because it’s easier to defend yourself if you say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h1&gt;
  
  
  “We tried our best not to miss the deadline, we used a tech stack that we know very well”
&lt;/h1&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---psKgIaO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Aqi_Heq-HjcQkLd3_T29JXg.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---psKgIaO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2000/1%2Aqi_Heq-HjcQkLd3_T29JXg.jpeg" alt="The toxicity of blaming culture" width="500" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Unfortunately, when the blaming culture takes root, it is very hard to remove. **It takes a lot of effort and the will of every person involved, from developers to C-level. Sadly, most of the time, it’s *easier&lt;/em&gt; to go to work in another company.&lt;/p&gt;

&lt;p&gt;The other factor that can lead to the Usual Path is giving little importance (or sometimes demonising) to proper training. I personally listened to some C-level states that their companies cannot &lt;em&gt;afford&lt;/em&gt; to train developers**. However, seeing the training as a mere cost is usually catastrophic for a software company.&lt;/p&gt;

&lt;p&gt;In Flowing, we deeply understand the need for training that a software company needs to survive in the ever-changing tech world. Our solution is to give a yearly budget to every surfer (we use this name to indicate who works with us) to spend on training (conferences, workshops, books, etc etc.) and give proper slack time to study and test new ideas.&lt;/p&gt;

&lt;p&gt;Moreover, every month we organize a &lt;a href="https://www.flowing.it/blog/flowing-academy-dove-si-incontrano-formazione-e-contaminazione/"&gt;Flowing Academy&lt;/a&gt; workshop. When a surfer is confident enough about a new technology or methodology, they book a monthly slot and invite other interested surfers to a Zoom meeting. The meeting itself is recorded and shared on our Slack workspace.&lt;/p&gt;

&lt;p&gt;And yes, we joke a lot during these sessions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vQVBRrG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2400/1%2AL2BrxlEp8Est0tl_M-oT6Q.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vQVBRrG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/2400/1%2AL2BrxlEp8Est0tl_M-oT6Q.jpeg" alt="Flowing: a serious company" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This totally bottom-up approach has allowed new ideas to emerge and become part of our daily lives.&lt;/p&gt;

&lt;p&gt;If your company doesn’t give you enough time for training, you may consider &lt;a href="//mailto:recruitment@flowing.it"&gt;working with us&lt;/a&gt;! 😉&lt;/p&gt;

&lt;p&gt;As a more general approach, when I notice some decision-making anti-patterns in a developers team. I usually dig deeper: the anti-pattern is always a symptom, never the real disease. Company culture is an essential part of any decision-making process.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h1&gt;
  
  
  If you have a bad company culture, you will probably make bad decisions.
&lt;/h1&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Contact Me
&lt;/h3&gt;

&lt;p&gt;I am gathering my experience in helping software development teams make decisions in complex environments in a book that you can buy on &lt;a href="https://leanpub.com/decision-making-for-software-development-teams"&gt;Leanpub&lt;/a&gt; and published by &lt;a href="https://www.avanscoperta.it/en/"&gt;Avanscoperta&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Jd9muyVa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/5100/1%2AHKdZhVSMFUgZzUJaOrbHkw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Jd9muyVa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn-images-1.medium.com/max/5100/1%2AHKdZhVSMFUgZzUJaOrbHkw.jpeg" alt="The cover of my book" width="800" height="1035"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to contact me and talk about decision-making, contact me on &lt;a href="https://www.linkedin.com/in/francescostrazzullo/"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>decisionmaking</category>
    </item>
    <item>
      <title>Sacrificial Architecture in Web Development</title>
      <dc:creator>Francesco Strazzullo</dc:creator>
      <pubDate>Mon, 17 Aug 2020 11:01:51 +0000</pubDate>
      <link>https://dev.to/francescostrazzullo/sacrificial-architecture-in-web-development-5gdg</link>
      <guid>https://dev.to/francescostrazzullo/sacrificial-architecture-in-web-development-5gdg</guid>
      <description>&lt;p&gt;What’s the ultimate goal of Agile methodologies? In my opinion, it could be distilled in the phrase: &lt;strong&gt;&lt;em&gt;«Embrace Change»&lt;/em&gt;&lt;/strong&gt;. While I understand the value of continuously adapting our code in order to develop the best software for our clients, there’s something that always bothers me as web developer. All the software architectures that I encountered during my career have one feature in common: &lt;strong&gt;they are very hard to change&lt;/strong&gt;. Just try to change this!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BuVbvpan--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://upload.wikimedia.org/wikipedia/commons/7/76/State_of_Wikibase%2527s_frontend_architecture_at_2013-04-10.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BuVbvpan--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://upload.wikimedia.org/wikipedia/commons/7/76/State_of_Wikibase%2527s_frontend_architecture_at_2013-04-10.svg" alt="Complex Architecture" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Graph by &lt;a href="https://commons.wikimedia.org/wiki/File:State_of_Wikibase%27s_frontend_architecture_at_2013-04-10.svg"&gt;Danwe&lt;/a&gt; / CC0&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So it seems that no kind of software architecture it’s really suited for Agile development.&lt;/p&gt;
&lt;h2&gt;
  
  
  Introducing Sacrificial Architecture
&lt;/h2&gt;

&lt;p&gt;Martin Fowler in one of his &lt;a href="http://martinfowler.com/bliki/SacrificialArchitecture.html"&gt;posts&lt;/a&gt; introduced the concept of Sacrificial Architecture: a software architecture designed to build code that you can easily throw away. &lt;strong&gt;Because the best code that you can write now, probably will not be suitable for your clients in a few years.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’m a frontend developer and I find that this kind of architecture is perfect for complex web application today. On the frontend, you need to change the UX and the look and feel of your application ASAP, according to your clients needs.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to apply it?
&lt;/h2&gt;

&lt;p&gt;Sacrificial Architecture is not a pattern or a well-defined architecture. So how can we apply it to modern web applications? &lt;strong&gt;Obviously, there’s no right answer to this question&lt;/strong&gt;, but I have a couple of tips to share with you.&lt;/p&gt;
&lt;h2&gt;
  
  
  Modularity
&lt;/h2&gt;

&lt;p&gt;Modularity is a must-have for Sacrificial Architecture. You should divide your application in modules. The modules mustn’t know each other, in this way you could throw away a module and the application will continue to work. If modules need to share code, it needs to be put in a “shared” module.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ddnwSv9d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/1%2At0lDIYju8_1kbo-ySKtWgQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ddnwSv9d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/1%2At0lDIYju8_1kbo-ySKtWgQ.png" alt="Our modular application" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But what happens if you need to share code between Module A and Module B? The first solution could be to put it in the “shared” module but you will find yourself in this kind of situation in no time…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G4zPWZS1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/1%2A1iD755rg8bGAiyh83UnVBg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G4zPWZS1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1400/1%2A1iD755rg8bGAiyh83UnVBg.png" alt="Our fat shared module…" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you start to put the code in the sharing module every-time you need it, the “shared” module will become a very “fat” module and then you will not be able to throw away any of your code. So in order to maintain your modules “disposable”, you need to accept code duplication. After all, as &lt;a href="https://medium.com/u/b49fae4639c2?source=post_page-----3926c0593fc8----------------------"&gt;Sandi Metz&lt;/a&gt; says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;duplication is far cheaper than the wrong abstraction.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Frameworks
&lt;/h2&gt;

&lt;p&gt;Modern Web Development is a jungle of frameworks. To apply the SA in the process of choosing the framework to develop your new JavaScript project, try to apply this pattern:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Choose your framework as you will need to change it after six months&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It may seem a little extreme, but if try to follow this rule you will use your framework better. Please consider the next AngularJS 1.X example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;getUsers&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;$http&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$http&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;  
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;$http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;v1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;home&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;  
 &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
 &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;getUsers&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
 &lt;span class="nf"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
     &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
     &lt;span class="nx"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;  
         &lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;  
             &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
         &lt;span class="p"&gt;});&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see we created a &lt;em&gt;getUsers&lt;/em&gt; service that we use in the &lt;em&gt;home&lt;/em&gt; controller. &lt;strong&gt;Note that we are bounded to Angular on the View level (the controller) and on the Business Logic level (the service)&lt;/strong&gt;. Let’s try with something different: let’s define our logic in a pure ECMAScript 6 module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;  
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;api&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;v1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  
   &lt;span class="p"&gt;});&lt;/span&gt;  
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And use it in the controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;getUsers&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;getUsers&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;home&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;  
   &lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
   &lt;span class="nf"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;  
       &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;  
           &lt;span class="nf"&gt;getUsers&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;  
               &lt;span class="nx"&gt;$scope&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
           &lt;span class="p"&gt;});&lt;/span&gt;  
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code inside the controller is exactly the same, &lt;em&gt;but now our business logic is not depending on any framework&lt;/em&gt;. In other words: it’s simpler for us to &lt;strong&gt;throw away AngularJS&lt;/strong&gt; in favour of another framework. So your work is not done after you have chosen a framework, you also need to choose &lt;em&gt;what features&lt;/em&gt; of your framework you have to use &lt;strong&gt;to keep the framework itself “sacrificial” all the time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nwmqQ2sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1280/1%2ADzZC6MtQf10DW9DLIXM8cw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nwmqQ2sb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/max/1280/1%2ADzZC6MtQf10DW9DLIXM8cw.jpeg" alt="Meme" width="640" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;This post is not meant to cover this topic entirely, and as I stated at the beginning of this post there’s no “right” guide to do a good Sacrificial Architecture: you just need to keep an open mind. And remember, quoting Martin Fowler…&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sacrificial Architecture, sometimes it’s the fastest way to learn things&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I talked about this same topic at &lt;a href="http://ruhrjs.de/"&gt;RuhrJS 2016&lt;/a&gt; in July. You can see the video below&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Q2vqjQdw6jU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Definition of Framework</title>
      <dc:creator>Francesco Strazzullo</dc:creator>
      <pubDate>Wed, 01 Jul 2020 19:38:39 +0000</pubDate>
      <link>https://dev.to/francescostrazzullo/the-definition-of-framework-k70</link>
      <guid>https://dev.to/francescostrazzullo/the-definition-of-framework-k70</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;What is a Framework?&lt;/em&gt;&lt;/strong&gt; This is one of the questions that emerged in one issue of the &lt;a href="https://github.com/frameworkless-movement/manifesto" rel="noopener noreferrer"&gt;Frameworkless&lt;/a&gt; Manifesto.&lt;br&gt;
As developers, we all know and use some frameworks in our daily job, but finding a definition of "Framework" is not a trivial task.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is a Framework?
&lt;/h2&gt;

&lt;p&gt;To try to answer this question, let's start with a definition taken from a &lt;a href="https://dictionary.cambridge.org/it/dizionario/inglese/framework" rel="noopener noreferrer"&gt;dictionary&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a supporting structure around which something can be built&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is, surprisingly, a &lt;em&gt;good enough&lt;/em&gt; explanation. If you think about some famous development framework like Angular or Spring it perfectly matches with this definition. They give to the developer a structure, usually defined as a series of architectural decisions that the team decided to delegate to the Framework. As an example, if your team decided to use Angular it delegated to the Framework some architectural decisions like language (TypeScript) and that your application will be heavily based on the reactive paradigm.&lt;/p&gt;
&lt;h2&gt;
  
  
  Libraries
&lt;/h2&gt;

&lt;p&gt;Usually, during the lifespan of a project, we don't use just frameworks, but also other packages that can help us with specific problems like manipulating arrays or dates. In a JavaScript application, your stack may contain &lt;code&gt;lodash&lt;/code&gt; or &lt;code&gt;date-fns&lt;/code&gt; or other packages like that. Are these frameworks too?&lt;/p&gt;

&lt;p&gt;The answer is &lt;em&gt;"no"&lt;/em&gt;, following the previous definition. These packages are in fact called &lt;em&gt;libraries&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So, what is the difference between Frameworks and Libraries? A quote that I use often to describe them is the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A framework calls your code. Your code calls a library.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles-i2iz7grtg.now.sh%2F" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles-i2iz7grtg.now.sh%2F" alt="A framework calls your code. Your code calls a library"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an easy way to classify if a package is a framework or a library. As an example, this is a piece of code of a simple function that use &lt;code&gt;date-fns&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;format&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;date-fns&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="na"&gt;isMonday&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;i&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;dates&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see I just call the library inside my JavaScript object. What I created here is a simple &lt;a href="https://en.wikipedia.org/wiki/Facade_pattern" rel="noopener noreferrer"&gt;Facade&lt;/a&gt; implementation to hide to the rest of my application the existence of &lt;code&gt;date-fns&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;What happens if, for whatever reason, I need to change &lt;code&gt;date-fns&lt;/code&gt; with another library or to remove date libraries completely? I just need to rewrite my Facade object. So, with very small design efforts, libraries are easy to change during time.&lt;/p&gt;

&lt;p&gt;On the other hand, this is a simple Angular service, taken from the &lt;a href="https://angular.io/tutorial/toh-pt4" rel="noopener noreferrer"&gt;tour of heroes&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Injectable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@angular/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Injectable&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;providedIn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HeroService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, trying to remove Angular will result in breaking all of your application. Most of the code written in a framework will lose its value when the framework is removed. Changing a framework in an existing project could be a very long and difficult task. One of the refactoring techniques that you may use is called &lt;a href="https://martinfowler.com/bliki/StranglerFigApplication.html" rel="noopener noreferrer"&gt;Strangler Fig Application&lt;/a&gt; pattern. In 2018 I gave a talk at a conference about this specific topic for frontend applications.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/cTSoFvAUUF8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;We can now define a better way to describe the difference between a Framework and a library.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A library should be easy to change, a Framework (most of the times) is not.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Framework's Way
&lt;/h2&gt;

&lt;p&gt;We have a clear definition of Framework and a simple rule to differentiate them from libraries. Problem solved, right? &lt;/p&gt;

&lt;p&gt;After this explanation, it should be easy to answer the question&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;React is a Framework or a Library?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Alas, is not so simple. The official definition of React, stated in the official website is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A JavaScript library for building user interfaces&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ok, so it's a library. Following our previous statement about the difference between Frameworks and Libraries, React should be easy to replace. But removing React from a project is not an easy task. The same thing often happens with another (in)famous "library" like jQuery.&lt;/p&gt;

&lt;p&gt;Why are some libraries so hard to change? What do React and jQuery have in common?&lt;/p&gt;

&lt;p&gt;When a library becomes &lt;em&gt;mainstream&lt;/em&gt;, people tend to amplify the library's core concepts to all the part of the applications. The React's mantra &lt;em&gt;"Everything is a component"&lt;/em&gt; could lead to writing everything as React Component like &lt;a href="https://reacttraining.com/react-router/web/guides/quick-start" rel="noopener noreferrer"&gt;Routes&lt;/a&gt;, &lt;a href="https://github.com/jamesplease/react-request" rel="noopener noreferrer"&gt;HTTP requests&lt;/a&gt; and other parts.&lt;/p&gt;

&lt;p&gt;React has a "way" of doing things, and accepting its way means accepting a lot of rules and decisions that you delegated not to the library itself, but to its "Framework's Way".&lt;/p&gt;

&lt;p&gt;This is not a bad thing &lt;em&gt;per se&lt;/em&gt;, but it's a very important factor to keep in consideration when choosing a technology stack. This leads to my personal and opinionated definition of Framework&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  When there is a Framework's way, there is a Framework
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;PS: If you liked this post, you can buy me a virtual coffee ️😊&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/strazz" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1600%2F1%2AWC5MWSS6s4JmUHjtztIusg.png" alt="Buy Me A Coffee"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frameworkless</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
