Overview

Map Java 17 habits to the Musi Book without repeating every construct example.

Java makes code durable through packages, classes, interfaces, records, exceptions, annotations, and tools that preserve names for years. Musi keeps the concern for contracts, but shifts where contracts live: records/data for shapes, classes/instances for behavior, Option/Result-like values for expected branches, and effects for work Java often hides behind services or exceptions.

Use this guide as a translation journal for Java code. Start with the familiar habit, then ask which Musi construct owns the same promise. A page is successful when it tells you which old instinct to keep and which old shortcut to drop.

Start from the habit that hurts

Habits that still help

  • Keep the Java habit of naming APIs for future readers.
  • Drop class-as-container reflexes when a Musi record, data variant, or instance is the smaller contract.
  • Keep examples tied to ordinary work: receipts, routes, files, animals, people, rooms, and services.

First false friend

Musi class is a behavior contract supplied by instances; records and data model object shape. If you need a person, car, invoice, or package, start with records or data. If you need any type that can compare, show, encode, or step, use a class with instances.

When to switch to the Musi Book

Stay in this guide while a Java habit is getting in the way. Switch to Values and let, Records, Patterns, Generics, Classes, and Effects when you need the source-of-truth rule.