liveBook · Manning

Domain-specific language

As explained in Quarkus in Action

A domain-specific language is a language designed to express operations within a particular problem domain.

A domain-specific language (DSL) is designed to express operations within a particular problem domain. In Quarkus applications, DSLs provide Java APIs that resemble the target language while keeping execution inside the application. section 4.5.4 section 11.4

The examples use DSLs for two different integration tasks:

  • Construct GraphQL documents through chained Java method calls instead of writing raw GraphQL directly. section 4.5.4
  • Access Kubernetes or OpenShift APIs through injected Fabric8 clients and fluent calls such as namespace and field filters. section 11.4

Building a GraphQL query

A dynamic client can build a cars query by composing an operation and fields into a Document. The client executes that document and exposes response data as JSON or deserialized domain objects.

Listing running OpenShift pods

An injected OpenShiftClient expresses a pod lookup as a fluent chain: select a namespace, filter status.phase to Running, list the resources, and return the items.

How Quarkus in Action covers it

How deep it goes
Defines DSL usage and demonstrates representative calls, but defers detailed GraphQL and cloud-platform treatment.
Examples
Demonstrates a dynamic cars query and a filtered OpenShift pod listing.
What it assumes
Assumes Java and Quarkus familiarity while illustrating the domain operations through client extensions.
What you can do after
Apply it via Quarkus clients to build GraphQL documents and query Kubernetes or OpenShift resources programmatically.
How it connects
Connects domain-specific languages with GraphQL, Java, Quarkus, Kubernetes, OpenShift, Fabric8, REST APIs, and CDI.

Also explained in

Compare how 10 books explain domain-specific language →

Related concepts

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