Covalent

A lightweight Java component model and runtime container.

View the Project on GitHub opales-org/covalent

Home | Next: Step 1: Your First Component

This tutorial introduces Covalent through a small, runnable example: the back office of a tiny coffee shop. Each step adds one idea, comes with a complete program you can run, and shows the output you should get.

You do not need any prior knowledge of Covalent. If you are new to component models in general, the foundations page gives the background, but you can also start here and read it later.

What You Will Learn

Step Topic What it covers
1 Your first component component type, implementation, container, start and stop
2 Services request/response ports between components
3 Events fire-and-forget notifications, automatic subscription
4 Parameters configuring a component through its own interface
5 Lifecycle callbacks, states, activating and passivating a component
6 Advanced events manual subscription, filters, subscription delegation, cloning
7 Structuring components items (segmentation) and composition
8 Existing objects bringing a plain Java object into the runtime as a raw component
9 Next steps the component viewer, troubleshooting, where to read more

Before You Start

How To Read The Examples

Every step ends with a complete program in a single file, so you can copy it, run it, and modify it. To keep each program in one file, the components are written as nested public static classes of a launcher class. In a real application, each component type and implementation would normally live in its own file.

Covalent requires component implementations to be public classes with a public no-argument constructor. The nested classes in the examples respect this rule. See Instantiation Contract for Component Implementations.

The output shown after each program is what the program prints on the standard output. Covalent also logs a few INFO lines (container started, container stopped) through java.util.logging, on the standard error; they are left out here.

Ready? Let’s start with your first component.

Home | Next: Step 1: Your First Component