ENSEMBLU Project Axiom v1.0.0

Project Axiom What It
Actually Solves

Seven real failure modes in enterprise Java infrastructure—and the exact, zero-dependency module that removes each one at the root.

The 7 Infrastructure Failures

Deep breakdown of enterprise bloat eliminated by com.ensemblu.

01 / 07

The ORM Trap

Problem: Heavy ORMs map relational tables to mutable object graphs causing N+1 query explosions and dirty-checking overhead.

The Fix: Relational data treated as raw streams and flat immutable maps—no object virtualization layer.

// Solved by axiom-spec and axiom-warp-jdbc
// and axiom-warp-reactive
// Direct-to-PostgreSQL parameter binding,
// zero reflection.
02 / 07

The Null Reference Trap

Problem: Unchecked null indicators lead to scattered checks and NullPointerExceptions.

The Fix: Absence becomes an explicit, typed data construct via algebraic types.

// Solved by axiom-sovereign and axiom-language
// Explicit Result and sum types at every boundary.
03 / 07

The Annotation & DI Container Magic

Problem: Runtime classpath scanning hides lifecycles and slows startup.

The Fix: Explicit, manual composition with every dependency passed as a plain parameter.

// Solved by default — the zero-reflection,
// zero-scanning core all other modules build on.
04 / 07

The Custom Parser Void

Problem: Reflection-based JSON parsers slurp payloads into mutable object graphs.

The Fix: Hand-crafted parsers inspect raw byte streams directly into immutable maps.

// Solved by axiom-spec
// Explicit schema contracts validated at perimeter,
// not inferred at runtime.
05 / 07

The Java Collections Desert

Problem: HashMap/ArrayList reliance creates synchronization bottlenecks.

The Fix: Hash Array Mapped Tries (HAMT) and Vector Bitmapped Tries for thread-free state.

// Solved by axiom
// HAMT / VBT core persistent data structures.
06 / 07

The Exception-Driven Control Flow

Problem: Using exceptions for expected outcomes costs stack-trace generation overhead.

The Fix: Expected outcomes return explicit Result containers and sum types.

// Solved by axiom
// Result-pattern return types throughout.
07 / 07

The Infinite Tooling Churn

Problem: Constant upgrades to build plugins that break compatibility on minor releases.

The Fix: Zero-dependency foundations on raw JDK primitives (Loom, Amber).

// Solved by default
// All modules, zero external dependencies
// on Maven Central.

Fluent Code Examples & Core API

Deep dive into Axiom's fluent mechanisms, sealing boundaries, and infrastructure tooling.

1. The Result Pipeline axiom
Result<Integer> parsed = Axiom.Check.attempt(() -> Integer.parseInt(raw));
parsed
    .validate(n -> n > 0, "must be positive")
    .map(n -> n * 2)
    .peekFailure(e -> log.warn(e.getMessage()))
    .getOrElse(0);

// Result has three states — Success, Failure, Empty — modeled as a sealed State<T>.
2. Guarding the Perimeter with If & Soft Validation axiom
Axiom.Check.that(factory)
        .is(Objects::nonNull, "RawProvisioner instance can't be null")
        .will()
        .thenApprovedOrElseThrowException();

// Soft validation — collecting every violation:
Axiom.Check.soft(order)
        .is(o -> o.qty() > 0, "qty must be positive")
        .andIs(o -> o.price() >= 0, "price must be non-negative")
        .will()
        .generateResultErrorIfExists();   // Result<String> listing every breach
3. Persistent Data Structures (HAMT & VBT) axiom
PersistentMap<String, Object> user = Axiom.Data.<String, Object>emptyMap()
        .put("id", 1L)
        .put("name", "Ofek");

PersistentMap<String, Object> updated = user.put("name", "Ofek Cohen"); // user is untouched
PersistentList<Integer> nums = Axiom.Data.range(1, 10);
4. Diffing State: MapDelta / ListDelta axiom
MapDelta<String, Object> delta = oldState.diff(newState);
delta.added();    // keys present only in new
delta.removed();  // keys present only in old
delta.updated();  // keys with a changed value
delta.invert();   // flips added <-> removed, for undo/rollback logic
5. Navigating Nested Structures with Source axiom
Source root = Axiom.Forge.source(deeplyNestedMap);
Source name = root.follow("user").follow("profile").follow("name");

if (name.exists()) {
    String value = (String) name.getValue();
}

// Immutable, path-copying updates:
Source updatedRoot = name.update("New Name");
6. Type-Safe Extraction with TargetNavigator axiom
Result<Integer> age  = user.targetKey("age").toIntResult();
String         name = user.targetKey("name").toStringVal();         // throws on failure/missing
PersistentList<String> tags = user.targetKey("tags").toStringListVal();
7. Configuration Parsing & Mapping axiom
ConfigSource config = Axiom.Config.file("app.properties");
int poolMax = config.targetField("engine.pool.max").toIntVal();

Result<PersistentList<PersistentMap<String,Object>>> users = config
        .asMappedList("users", sub -> Axiom.Data.<String,Object>empty()
                .put("name", sub.targetField("name").toStringVal())
                .put("role", sub.targetField("role").toStringVal())
        );
8. Side Effects & File Reading axiom
Effect<Nothing> log = Axiom.Io.log("Warp initialized");
log.run(); // nothing happens until you call run()

Result<String> contents = Axiom.Io.read("data/seed.properties");
axiom-sovereign: Operational Entry & Dop Normalization axiom-sovereign
import com.ensemblu.axiom.sovereign.parser.AxiomDopParser;

// Direct execution
final var result = AxiomDopParser.take(inputString).openBuffer().parse();

// Dop.normalize is the single canonicalization point before comparison/storage.
axiom-language: Validating Content axiom-language
import com.ensemblu.axiom.schema.SchemaGuard;

// Executes validation handshake
final var result = SchemaGuard.checkContent(rawJsonString)
    .basedOnSchemaInPath("schemas/user-profile")
    .withAxiomParser();
axiom-spec: Perimeter Handshakes, Parsing & Protocols axiom-spec
// 1. Database Handshake
final var plan = SqlParser.forge("INSERT INTO users (name, age) VALUES (:java.name, :java.age)");
IngressBinder.apply(binder, plan, myContractMap, myDataMap);

// 2. High-Precision Parsing
final var data = JsonParser.take(jsonString).openBuffer().ensureRootIsObject().parseObject();
final var row = CsvRowParser.takeLine("val1,val2").basedOnHeaders("col1", "col2");

// 3. Structural Materialization
final var materialized = RowMaterializer.materialize(row);

// 4. Defining the Protocol
AxiomProtocol.LONG.getSetter().set(binder, index, myLongValue);

// 5. Registry Management
final var registry = new AxiomRegistry<>(AxiomProtocol.class);
final var protocol = registry.get("LONG");
axiom-warp-jdbc: Connection Pooling & Transactional Strikes axiom-warp-jdbc
RawProvisioner provisioner = AxiomWarp.connect(configSource)
        .withPoolProvider(config -> MyPoolImplementation.from(config))
        .validateRules()
        .getOrThrow();
AxiomWarp warp = new AxiomWarp(provisioner);

// Transactional Write
Result<PersistentList<PersistentMap<String, Object>>> result =
        warp.write(() ->
                warp.strike()
                        .dynamic("INSERT INTO users (id, name) VALUES (:java.id, :java.name)")
                        .withContract(Axiom.Data.<String,AxiomProtocol>emptyMap()
                                .put("id", AxiomProtocol.LONG)
                                .put("name", AxiomProtocol.STRING))
                        .withData(Axiom.Data.<String,Object>emptyMap()
                                .put("id", 1L)
                                .put("name", "Ofek")));

// Bulk-ingest CSV & Delta Sync
warp.ingest()
    .fromFile("users.csv")
    .usingFileHeaders()
	.onTableName("users");
    
warp.sync()
    .tableName("users")
    .whereDelete("id = :java.id")
    .whereUpdate("id = :java.id")
    .withDelta(mapDelta);
axiom-warp-reactive: Vert.x Async Streams & Forensic History (AHE) axiom-warp-reactive
AxiomWarp warp = AxiomWarp.protocol()
        .withFactory(RawProvisioner.basedOnConfig(configSource)
                .withPoolProvider(config -> MyPool.from(config))
                .validateRules()
                .getOrThrow())
        .withCache(TemporalStreamBuffer.ofWindowDuration(Duration.ofMinutes(5)))
        .withDialect(Dialect.POSTGRES);

// Async Read & Write
Future<Result<PersistentList<PersistentMap<String, Object>>>> rows =
        warp.strike().shot("SELECT * FROM users").arm(client);

// Query with forensic history on failure (AHE Protocol)
WarpStrike withHistory = warp.withHistory(Duration.ofSeconds(30));
withHistory.read(client -> warp.strike().shot("SELECT * FROM ledger").arm(client));

Support Ensemblu

Ensemblu is sovereign, zero-dependency Java infrastructure — no reflection, no framework bloat, no hidden magic.

Sponsor to fund independent development and help grow a cleaner Java ecosystem.

Sponsor Us on GitHub