Jinaga 0.2.108

There is a newer version of this package available.
See the version list below for details.
dotnet add package Jinaga --version 0.2.108
NuGet\Install-Package Jinaga -Version 0.2.108
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jinaga" Version="0.2.108" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Jinaga --version 0.2.108
#r "nuget: Jinaga, 0.2.108"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Jinaga as a Cake Addin
#addin nuget:?package=Jinaga&version=0.2.108

// Install Jinaga as a Cake Tool
#tool nuget:?package=Jinaga&version=0.2.108

Jinaga.NET

Resilient, reliable data transfer for .NET.

What it Does

In Jinaga, you define a data model in terms of immutable facts. A fact represents an entity, a change to an entity, or a decision that a user or service has made.

In Jinaga.NET, facts are C# records.:

[FactType("Corporate.Company")]
record Company(string identifier) {}

[FactType("Corporate.Employee")]
record Employee(Company company, int employeeNumber) {}

When a user or service makes a decision, you will add a fact to the system. This will store it in the local database. It will also update the local UI. And it will publish it so that others can learn about the decision.

var contoso = await j.Fact(new Company("Contoso"));
var jane = await j.Fact(new Employee(contoso, 1));
var bob = await j.Fact(new Employee(contoso, 2));

To query facts, write a specification. Start at a know fact and find all related facts that match that specification.

var employeesOfCompany = Given<Company>.Match((company, facts) =>
    from employee in facts.OfType<Employee>()
    where employee.company == company
    select employee
);

var contosoEmployees = await j.Query(contoso, employeesOfCompany);

A query returns results at a point in time. If you want to keep a user interface up-to-date, you will need to continually watch.

var observer = j.Watch(contoso, employeesOfCompany, o => o
    .OnAdded(employee => AddEmployeeComponent(employee))
    .OnRemoved(component => RemoveEmployeeComponent(component))
);

Finally, if you want to be notified in real time of new information, just subscribe.

var subscription = j.Subscribe(contoso, employeesOfCompany);

The client will open a persistent connection with the server. The server will notify the client the moment a new employee is hired. Because the client already set up a watch, the new employee will appear on the UI.

Running a Replicator

A Jinaga front end connects to a device called a Replicator. The Jinaga Replicator is a single machine in a network. It stores and shares facts. To get started, create a Replicator of your very own using Docker.

docker pull jinaga/jinaga-replicator
docker create --name my-replicator -p8080:8080 jinaga/jinaga-replicator
docker start my-replicator

This creates and starts a new container called my-replicator. The container is listening at port 8080 for commands. Configure Jinaga to use the replicator:

var j = JinagaClient.Create();  // Defaults to http://localhost:8080/jinaga

Roadmap

Jinaga.NET is co-evolving with Jinaga.JS. Each of these projects has a front end and a back end. Either front end is intended to work with either back end. And the back ends are intended to interconnect to form a decision substrate.

Jinaga Roadmap

APIs

The primary APIs for Jinaga are:

  • j.Fact - Add and publish a fact
  • j.Query - Project the facts matching a specification
  • j.Watch - Continually update a projection
  • j.Subscribe - Receive continuous updates from peers

The Subscribe API is not fully implemented in Jinaga.JS, and not implemented yet in Jinaga.NET. The JS version uses polling rather than the intended mechanism of Web Sockets or HTTP/2 Server Push.

Storage

Jinaga.NET currently has only memory storage, which is packaged with the unit testing library. The next storage solutions to implement are SQLite to support Xamarin mobile apps and PostgreSQL to support Docker deployment. After that, the MS SQL Server implementation will support enterprise solutions that need to keep the journal transactionally consistent with the projection.

The IStore interface for Jinaga.NET currently includes both Query and QueryAll. The QueryAll method is more general. All calls to Query will be moved over, and then the more specific method will be removed. Jinaga.JS does not yet have the equivalent of QueryAll, so that will come later.

Pipelines

The pipeline compiler continues to evolve. I'm using .NET Interactive Notebooks to explore the types of queries that applications will need, and then test drive their implementations. The next pipeline feature to implement is nested specifications.

The pipeline inverter is currently driven by scenarios as well. A future project will be to walk through the proof of query inversion presented in The Art of Immutable Architecture and verify that this pipeline inverter is correct. We will also back port the Jinaga.NET pipeline inverter to Jinaga.JS.

Rules

Authorization rules -- which limit the users who can create facts -- are implemented in Jinaga.JS, but not yet in Jinaga.NET. Distribution rules -- which limit the specifications that a user can query -- are not yet implemented in either.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Jinaga:

Package Downloads
Jinaga.UnitTest

Support for unit testing Jinaga applications. Data management for web and mobile applications. Connect your client to a replicator to replace your hand-written API and database. Jinaga supports occasionally connected clients with local storage in SQLite.

Jinaga.Graphviz

Generates visualizations of Jinaga facts and types. For use wihtin .NET Interactive Notebooks. Data management for web and mobile applications. Connect your client to a replicator to replace your hand-written API and database. Jinaga supports occasionally connected clients with local storage in SQLite.

Jinaga.Store.SQLite

SQLite storage for Jinaga applications. Data management for web and mobile applications. Connect your client to a replicator to replace your hand-written API and database. Jinaga supports occasionally connected clients with local storage in SQLite.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.11.17 148 4/19/2024
0.11.16 137 4/14/2024
0.11.15 145 4/9/2024
0.11.14 123 4/7/2024
0.11.13 133 4/7/2024
0.11.12 130 4/7/2024
0.11.11 141 4/1/2024
0.11.10 159 3/31/2024
0.11.9 134 3/30/2024
0.11.8 130 3/30/2024
0.11.7 145 3/29/2024
0.11.6 140 3/24/2024
0.11.5 164 3/13/2024
0.11.4 205 3/6/2024
0.11.3 189 3/1/2024
0.11.2 164 2/29/2024
0.11.1 199 2/19/2024
0.11.0 159 2/16/2024
0.10.1 186 2/15/2024
0.10.0 226 2/11/2024
0.9.7 191 2/10/2024
0.9.6 192 2/8/2024
0.9.5 207 2/2/2024
0.9.4 181 2/1/2024
0.9.3 189 1/31/2024
0.9.2 220 1/24/2024
0.9.1 209 1/20/2024
0.9.0 213 1/19/2024
0.8.4 443 11/17/2023
0.8.3 329 11/11/2023
0.8.2 282 11/2/2023
0.8.1 294 11/1/2023
0.8.0 142 10/23/2023
0.7.2 297 10/19/2023
0.7.1 302 9/21/2023
0.7.0 327 9/12/2023
0.6.5 379 8/29/2023
0.6.4 379 8/26/2023
0.6.3 308 8/26/2023
0.6.2 374 8/19/2023
0.6.1 344 8/19/2023
0.6.0 323 8/17/2023
0.5.1 359 8/16/2023
0.5.0 352 8/12/2023
0.4.0 390 5/28/2023
0.3.0 554 2/12/2023
0.2.109 660 2/5/2023
0.2.108 888 10/18/2022
0.2.107 951 10/15/2022
0.2.106 982 10/12/2022
0.2.105 933 10/11/2022
0.2.104 956 9/25/2022
0.2.103 984 9/25/2022
0.2.98 984 9/25/2022
0.2.97 981 9/25/2022
0.2.24 681 11/30/2021
0.2.23 681 11/27/2021
0.2.22 2,368 11/27/2021
0.2.21 3,251 11/25/2021
0.2.20 789 11/12/2021
0.2.19 691 11/11/2021
0.2.15 725 11/9/2021
0.2.13 718 11/8/2021
0.2.3 780 11/4/2021
0.2.1 734 11/3/2021
0.2.0 767 11/1/2021
0.1.1 778 9/26/2021
0.1.0 825 9/26/2021