Barncept

Your understanding outlives your code.

Code is rewritten, frameworks come and go, folders get reshuffled. What lasts is how you understand the domain. Barncept captures that understanding as a graph of linked concepts, each with a plain meaning, so it can be realised in any way you like.

The Barncept schema editor showing a hotel's reservations vocabulary as a tree of concepts. The selected concept, booking, means a guest's hold on a room for a run of nights, and is linked to the facts is confirmed and has been cancelled.
Meaning first

Concepts that explain themselves.

Every concept has a name and a meaning written in plain words, and it’s linked to the concepts it depends on. Months later, anyone can open the graph and understand not just what exists, but what each thing is for.

The reservations vocabulary: a room, a guest and a booking, with what can be true of rooms and bookings reservations room guest booking is on offer is out of service is confirmed has been cancelled
From stories

The words your stories use, organised.

The people, things and actions in your Barnspec stories can be exported as a concept graph in one step. The business’s own vocabulary becomes something you can see whole, reorganise and build on, rather than words scattered across tickets.

Exported from a hotel’s reservation stories

  • guestchoosing and securing somewhere to stay
  • rooma room the hotel lets to guests
  • bookinga guest’s hold on a room for a run of nights
  • book a rooman action a guest takes
Realise it any way

One model. Any shape.

Barncept never decides what a graph becomes. A folder structure, a diagram and a set of documents are each one possible realisation, never the model itself. Turn the same graph into real folders, an architecture to check code against, or whatever you need next.

Every Barnark architecture template is a Barncept graph, edited in exactly the same way.

The Barncept editor open on the Domain Driven Design architecture template, with the Command concept selected and its meaning shown.
An architecture template is a concept graph too.
Go deeper

How it works underneath.

Everything above, in more detail, for when you want it.

The three kinds of conceptDefinitions, Abstractions and Implementations
  • Definition: a concept that can require other concepts beneath it, such as Application or Domain.
  • Abstraction: a role that concrete things fulfil, such as Aggregate or Command.
  • Implementation: a concrete thing that fulfils one Abstraction, such as Basket fulfilling Aggregate.

The editor marks them with a square, a triangle and a circle.

Templates and custom schemasPortable vocabulary, and the things that use it

A template schema holds only Definitions and Abstractions: a reusable vocabulary. A custom schema adds Implementations, so it can be resolved from a root into a concrete, named tree. A bad schema fails loudly, naming the missing reference or the cycle it found.

Root
|
+--Application
+--Domain
Realising a graph as foldersScaffold it, then check it still matches

Barnscaff, Barncept’s companion, turns a resolved graph into real directories and files, and scans an existing folder to check it still matches.

$ vendor/bin/barnscaff scaffold library Root ./generated --apply
$ vendor/bin/barnscaff scan library Root ./generated
From PHPSchemas are plain arrays or JSON
$schema   = new SchemaFactory()->create($data);
$instance = new ResolverFactory()->create()
    ->resolve($schema, ImplementationKey::new('Root'));

echo new PresenterFactory()->create()->present($instance);
Get started

Open your concepts in the browser.

Barncept needs PHP 8.5, Composer and the ds extension. Set up your project once, then open the editor.

$ vendor/bin/barncept init
$ vendor/bin/barncept gui
InstallationNot on Packagist yet: install from a BarnSuite checkout

Add path repositories for package/barncept, cli/barncept-cli and gui/barncept-gui, then:

$ composer require rmb32/barncept rmb32/barncept-cli rmb32/barncept-gui