Entities

A big part of any application is modeling entities. These are objects that can be created, destroyed, and modified.

Since Jianga facts are immutable, they don't directly map to entities. If you have properties that you want the user to be able to change, you can't make them part of its fact. Instead, you'll define different facts for different actions you can perform on an entity.

  • Create
  • Delete
  • Restore
  • Modify

We already saw how to model the creation of an object. You declare a fact that represents its identity. The fields of the fact tell you things like its creator and where it exists in the hierarchy. They also include just enough identifying information to distinguish one entity from another.

The first entity we created was the site:

[FactType("Blog.Site")]
public record Site(User creator, DateTime createdAt) { }

Let's see how to model the other operations.

See Also

Jinaga is a product of Jinaga LLC.

Michael L Perry, President