liveBook · Manning

Write once, run anywhere

As explained in .NET MAUI in Action

Write once, run anywhere is a software development approach in which one application is intended to run across multiple platforms without platform-specific modification.

Write once, run anywhere (WORA) aims to let one application run across multiple operating systems without platform-specific modification. Runtimes and shared APIs hide differences between operating-system APIs. section 1.1 section 1.6

The approach developed through several runtime models:

  • Java paired a common language and API set with the Java Virtual Machine, supporting applications across many operating systems. section 1.1
  • .NET Framework separated application code from Windows APIs, but remained Windows-only and required an installed framework. section 1.1
  • .NET Core removed key Windows dependencies and could ship its portable runtime with code for Windows, macOS, and Linux. section 1.1
  • .NET MAUI applies the WORA approach to native UI applications, allowing one app to run on multiple platforms. section 1.6

A cross-platform .NET MAUI app

Build one .NET MAUI application using .NET APIs and a supported UI language such as XAML or C#, then run it across multiple platforms without further modification. section 1.6

Figure 1.1 Legacy applications are built directly on top of operating system APIs. Java and .NET provide their own APIs for developers to use and runtimes that hide the platform APIs.

Compare legacy applications built directly on operating-system APIs with Java and .NET runtimes that provide shared APIs and hide platform details. section 1.1

How .NET MAUI in Action covers it

How deep it goes
Traces runtime abstraction from Java through .NET Core and .NET MAUI, but stops short of implementation details.
Examples
Uses Java with the JVM, .NET Framework, .NET Core, and a cross-platform .NET MAUI UI application.
What it assumes
Assumes basic software-development knowledge while introducing operating-system APIs, runtimes, and cross-platform application design.
What you can do after
Evaluate when a shared runtime and API layer can support one application across several platforms.
How it connects
Connects runtimes, application programming interfaces, operating systems, Java, .NET Framework, .NET Core, and .NET MAUI.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.