Boxel Framework: How Cardstack Plans to Disrupt Application Development — Part 1

A deep-dive into Boxel Framework

Cardstack Team
Cardstack

--

Applications have become an integral part of modern life, powering everything from smartphones to online shopping. However, despite its importance, application development is far from perfect. The current process of application development is time-consuming and resource intensive. Cardstack plans to change this paradigm with its Boxel Composable Development Framework.

Inspired by the term Voxel from video games such as Minecraft, Boxel Framework aims to simplify software development by allowing users, designers, and developers to work together to assemble software from pre-built components. Boxel proposes the idea of composable apps, where applications can work together as components to create more complex software.

Boxel aims to address four levels of complexity present in the current software development ecosystem to simplify the application development process.

These four levels are:

  1. Accidental Complexity
  2. Essential Complexity
  3. Emergent Complexity
  4. Mediated Complexity.

In the following paragraphs, let’s discuss each level of complexity in detail and how they impact current software development:

Level 1: Accidental Complexity

Accidental complexity refers to the complexity that arises from the use of tools, processes, or frameworks that are not essential to the software being developed but are required to support its creation. This type of complexity is considered accidental because it is not inherent in the problem domain, but rather a side effect of the chosen approach to solving the problem.

In software development, accidental complexity can lead to increased development time, increased costs, and reduced quality. This is because developers must spend time learning and navigating the tools and processes required to support the chosen approach, which takes time away from the actual development of the software. Additionally, the more complex the tools and processes are, the more opportunities there are for errors to be introduced into the code.

Accidental complexity also makes it harder to change the software in the future, as changing the tools and processes used to support the software often requires significant rework of the code. This can lead to software becoming outdated or difficult to maintain over time.

To mitigate the impact of accidental complexity, developers often turn to open-source tools and libraries that have already been developed and tested by others and can be used to support the creation of new software without adding unnecessary complexity. However, this reuse is limited to the stacks and libraries, and developers still rewrite the code around the business domain and logic for each new application.

Boxel aims to solve accident complexity by allowing developers to reuse stacks and libraries as a foundation for their applications. This eliminates the need for developers to spend time researching and selecting individual components and tools, reducing the likelihood of errors and speeding up development time.

Boxel also leverages open-source technologies, allowing developers to tap into pre-existing codes that can be easily incorporated into their applications. This reduces the amount of code that developers need to write from scratch, further simplifying the development process.

Another way that Boxel simplifies development is by providing an integrated development environment (IDE) that streamlines the coding process. The IDE includes a range of tools, such as code editors, version control systems, and debugging tools, that allow developers to work more efficiently and effectively.

Finally, Boxel’s deployment process is designed to be simple and straightforward. Developers can deploy their applications with just a few clicks, without needing to worry about server setup, maintenance, or security. This allows developers to focus on building their applications, rather than spending time on infrastructure management.

Level 2: Essential Complexity

Essential Complexity refers to the inherent complexity in a domain that cannot be simplified or abstracted away. It is the necessary complexity that is required to represent and solve the problem at hand. In software development, essential complexity is the core business logic that represents the unique requirements of an application. This complexity cannot be reduced or abstracted away without losing the essential functionality of the application.

Essential Complexity has a significant impact on current software development. Traditionally, software development has focused on reducing accidental complexity, which is easier to solve, rather than essential complexity, which is more difficult to address. However, as software applications become more complex and requirements become more diverse, essential complexity is becoming an increasingly important consideration in software development.

The impact of essential complexity is particularly evident in the development of large-scale applications, such as enterprise systems or complex web applications. These applications have unique business logic and requirements that cannot be abstracted away or simplified. In order to build these applications, software developers must understand the essential complexity of the respective domain and design solutions that address these requirements.

Essential complexity also affects software maintenance and evolution. As requirements change over time, the essential complexity of an application may also change. Software developers must be able to identify and modify the essential complexity of an application while preserving its functionality. This requires a deep understanding of the domain and the ability to refactor the code in a way that does not compromise the core business logic.

To address the challenges of essential complexity, software developers are increasingly turning to domain-driven design (DDD) and other techniques that focus on capturing and modeling the core business logic of an application. DDD emphasizes the importance of understanding the problem domain and designing solutions that reflect the unique requirements of the application.

Another approach to managing essential complexity is the use of microservices architecture. Microservices break down large-scale applications into smaller, more manageable components that can be developed and deployed independently. Each microservice can be designed to address a specific aspect of the essential complexity of the problem domain, allowing developers to focus on the specific requirements of each component.

However, DDD can lead to bloated domain models that can become difficult to maintain and change over time. Microservices can also introduce additional complexity, such as the need for service discovery and orchestration, and may not work well for certain types of applications. Another issue with both approaches is that they rely on a centralized database, which can create dependencies and limit the ability to scale the system. This can result in a situation where a small change to a single microservice can have far-reaching consequences throughout the entire system.

Boxel allows developers to create applications by focusing on the essential complexity of the business domain rather than getting bogged down in the accidental complexity of the technology stack and implementation details. Boxel achieves this by providing a structured approach to organizing the essential complexity of an application in the form of domain models. Domain models represent the business concepts, entities, and relationships that are relevant to a particular application. These models are defined using a combination of JSON, TypeScript, and Glimmer templates, which provide a simple, clear, and standardized way of representing the domain.

By encapsulating the essential complexity of an application in domain models, Boxel enables developers to build applications that are more modular, composable, and reusable. Instead of writing a monolithic application that is tightly coupled to a specific implementation, developers can create a set of loosely coupled domain models that can be composed to form a variety of different applications. Boxel also provides a runtime environment that allows domain models to be executed on both the client and server. This means that developers can create applications that can run in a variety of different contexts, including on the web, desktop, mobile, and in the cloud. By providing a consistent runtime environment across different contexts, Boxel enables developers to create applications that are more portable and adaptable.

One of the key benefits of Boxel is that it promotes the reuse of both domain models and implementation code. Because domain models are encapsulated and standardized, they can be easily shared between different applications and developers. This means that developers can leverage existing domain models to quickly create new applications or extend existing ones. Boxel also provides a rich library of implementation code that can be used to implement common functionality, such as data persistence, authentication, and authorization.

Level 3: Emergent Complexity

Emergent complexity is a phenomenon that arises when the behaviour of a system composed of many simple parts is difficult to predict or understand by looking only at the parts. In software development, emergent complexity can arise when developers are working with a large and complex codebase that is difficult to understand, maintain, and extend.

One of the key challenges of emergent complexity in software development is that it can lead to a situation where small changes or updates to the system can have unexpected and far-reaching consequences. This can make it difficult to debug and test software, and can also make it hard to add new features or refactor the code without introducing unintended side effects.

There are a few different ways in which emergent complexity can arise in software development. One common cause is the use of monolithic architectures, which can lead to tightly coupled code that is difficult to maintain and extend. In this scenario, changes to one part of the codebase can have ripple effects throughout the system, making it hard to predict the impact of any given change.

To address the challenges of emergent complexity, many software development teams are turning to new approaches such as the Model-View-Controller (MVC) pattern, to separate concerns and make the code easier to maintain. Some are also using architectural patterns, such as microservices or service-oriented architecture (SOA), to create modular, scalable systems.

However, these approaches have some drawbacks, including increased complexity of the development process, potential for integration issues, difficulty in testing, risk of over-engineering, and limited flexibility of the system. Developers need to carefully balance the benefits of these approaches against the potential drawbacks to create effective and maintainable systems.

Boxel reduces emergent complexity problems by using a modular, component-based approach to software design. Boxel breaks down a software system into smaller, more manageable components, or “boxes”, which can be developed, tested, and deployed independently. Each box has a clear interface and can communicate with other boxes through well-defined APIs, which helps to reduce the potential for emergent complexity.

Boxel also emphasizes the use of automated testing and continuous integration/continuous deployment (CI/CD) practices. This ensures that each box is thoroughly tested before being integrated into the larger system, reducing the potential for bugs and errors.

Another key aspect of Boxel is its focus on data flow management. Each box is designed to manage a specific data flow within the system, which helps to ensure that data is handled consistently and efficiently across the entire system. This approach also makes it easier to scale the system as it grows, since new boxes can be added to handle new data flows.

Overall, Boxel aims to reduce emergent complexity in software development by breaking down a system into smaller, more manageable components, ensuring each component is thoroughly tested, and focusing on consistent data flow management. By using these principles, Boxel can help developers build more reliable, scalable, and maintainable software systems.

Level 4: Mediated Complexity

Mediated complexity refers to the concept of using intermediary entities or components to manage the interactions between other components within a system. In software development, this can manifest in the form of APIs, middleware, or other abstraction layers that help manage the complexity of interactions between different software components. Mediated complexity arises when different software systems or components must interact with each other to accomplish a task. This complexity can pose a number of challenges for software development.

One potential downside of mediated complexity is that it can increase the overall complexity of software systems, making it more difficult to understand and troubleshoot problems when they arise. Additionally, mediated complexity can sometimes introduce additional points of failure or security vulnerabilities into software systems, which can be difficult to identify and mitigate.

The idea behind Boxel is to provide a structured language that can help software interact with complex systems, such as APIs, servers, and payment methods, in a more efficient and streamlined manner. By breaking down complex interactions into simple components, Boxel allows for easy orchestration of different applications and systems, making it easier for developers to build more complex applications.

Boxel consists of two types of boxels — noun boxels and verb boxels. Noun boxels define the structure and layout of an entity, while verb boxels wrap the business logic and integration. Noun boxels are like documents, while verb boxels act as commands or functions that execute a particular action. By combining these two types of boxels, developers can create complex interactions and applications that are more modular and easier to understand.

One of the key benefits of Boxel is its ability to provide a common understanding of what an account, amount, and denomination is across different applications. This means that developers can use Boxel to interact with different payment methods, such as credit cards or cryptocurrencies, without having to worry about specific implementation details. Boxel allows developers to create custom solutions by combining different boxels, creating more modular and flexible applications.

Another important aspect of Boxel is its ability to share code and customize existing boxels. This allows developers to build on existing solutions and create new ones quickly and easily. Boxel provides a catalog of boxels that developers can use as building blocks for their applications, making it easier to develop complex applications from simple components.

Boxel also provides a way for developers to monetize their contributions to the protocol by using the Champer Protocol (to be released by Cardstack) for revenue distribution. This incentivizes developers to create and contribute to the catalog of boxels, which in turn creates a more robust and diverse ecosystem of composable applications.

In conclusion, Boxel is a powerful protocol that provides a structured language for building composable applications. By breaking down complex interactions into simple components, Boxel makes it easier for developers to build complex applications quickly and easily. Its ability to share code and customize existing boxels, along with its support for different payment methods, makes it a flexible and versatile protocol for building applications.

Want to understand each of these complexities in more detail and how Boxel addresses them, watch Cardstack’s Founding Director, Chris Tse, discuss it here:

About Cardstack

Founded in 2014, Cardstack is an open software ecosystem that enables Web3 projects to build and scale their business. The Cardstack ecosystem includes two product suites: Boxel Open-Source Composable Development Framework and Champer Revenue Management Protocol along with various tools for the Web3 ecosystem. With Cardstack, Web3 businesses can create and launch their own dApps, monetize their tools, and manage their revenue distribution. Learn more about Cardstack at https://cardstack.com

--

--

Cardstack Team
Cardstack

Official account for the team behind the Cardstack project.