# 🦉 Why Owl ? 🦉 The common wisdom is that one should not reinvent the wheel, because that would waste effort and resources. It is certainly true in many cases. A javascript framework is a considerable investment, so it is quite logical to ask the question: why did Odoo decide to make OWL instead of using a standard/well known framework, such as React or Vue? As you might expect, the answer to that question is not simple. But most of the reasons discussed in this page are a consequence from a single fact: Odoo is extremely modular. This means, for example, that the core parts of Odoo are not aware, before runtime, of what files will be loaded/executed, or what will be the state of the UI. Because of that, Odoo cannot rely on a standard build toolchain. Also, this implies that the core parts of Odoo need to be extremely generic. In other words, Odoo is not really an application with a user interface. It is an application which generates a dynamic user interface. And most frameworks are not up to the task. Betting on Owl was not an easy choice to make, because there certainly are a lot of conflicting needs that we want to carefully balance. Choosing anything other than a well known framework is bound to be controversial. This page will explain some of the reason why we still believe that building Owl is a worthwile endeavour. ## Strategy It is true that we want to keep control of our technology, in the sense that we do not want to depend on Facebook or Google, or any other large (or small) company. If they decide to change their license, or to go in a direction that will not work for us, this may be a problem. This is even more true because Odoo is not a conventional javascript application, and our needs are probably quite different as most other applications. ## Class components It is clear that the biggest frameworks are moving away from class components. There is an implicit assumption that class components are terrible, and that functional programming is the way to go. React even goes as far as to say that classes are confusing for developers. While there is some truth to that, and to the fact that composition is certainly a good mechanism for code reuse, we believe that classes and inheritance are important tools. Sharing code between generic components with inheritance is the way Odoo built its web client. And it is clear that inheritance is not the root of all evils. It is often a perfectly simple and appropriate solution. What matter most is the architectural decisions. Also, Odoo has another specific use out of class components: each method of a class provides an extension point for addons. This may not be a clean architecture pattern, but it is a pragmatic decision that served Odoo well: classes are sometimes monkey-patched to add behaviour from the outside. A little bit like mixins, but from the outside. Using React or Vue would make it significantly harder to monkey patch components, because a lot of the state is hidden in their internals. ## Tooling React or Vue have a huge community, and a lot of effort have been made into their tooling. This is wonderful, but at the same time, a pretty big issue for Odoo: since the assets are totally dynamic (and could change whenever the user installs or removes an addon), we need to have all that kind of tooling on the production servers. This is certainly not ideal. Also, this makes it very complicated to setup Vue or React tools: Odoo code is not a simple file that import other files. It changes all the time, assets are bundled differently in different contexts. This is the reason why Odoo has its own module system, which are resolved at runtime, by the browser. The dynamic nature of Odoo means that we often need to delay work as late as possible (in other word, we want a JIT user interface!) Our ideal framework has minimal (mandatory) tooling, which makes it easier to deploy. Using React without JSX, or Vue without vue file is not very appealing. At the same time, Owl is designed to solve this issue: it compiles templates by the browser, it doesn't need much code for that, since we use the XML parser built into each browser. Owl works with or without any additional tooling. It can use template strings to write single file components, and is easy to integrate in any html page, with a simple `