Industry 4.0 and Real-Time Applications
with Minimal Code
Cognibase is a Real-Time Object Platform and .NET Application Development framework for apps that can be deployed anywhere.
Start in minutes with an Object Server, SQL DB, Authentication, RPC, Transactions, Caching, Live updates, Change events and more.
Works seamlessly with any .NET frontend framework
WPF | Avalonia | MAUI | WinForms | Uno Platform* | ASP.NET MVC | Blazor*
Supports any platform / device / target
Cloud | Windows | Linux | MacOS | Android | iOS* | RPi | Web Assembly*
* under development
Build your apps faster like innovators do
Declarative Data Modelling
Build your Reactive Entity Model (Domain) with a minimal special notation. Feel comfortable as it is similar to Entity Framework.
Learn more >
Learn more >
Out-of-the-box Backend
Plug your entity model in the server and you are ready to go. The Object Server has many functions built-in.
Learn more >
Learn more >
Transactional Data Sync
It provides a simplified programming model where the changes are continuously synchronized to the clients.
Learn more >
Learn more >
Event Driven
Integration Engine
Fuse data from various sources into the same Entities. Use Runtime and Gated fields wherever needed and minimize integration code.
Learn more >
Learn more >
Standard .NET
Use the same tools you are familiar with, like Visual Studio. Take advantage of the large .NET ecosystem and Nuget packages.
Learn more >
Learn more >
Learn instantly
A Super productive framework for writing less code:
- Create Entities: Define the classes of the Reactive Entity Model (Domain).
- CRUD Operations: Create, Read, Update and Delete objects like in typical ORMs.
- Subscriptions: React to transaction and change events at various levels.
- Queries: Build object oriented queries using the OOQL simple or verbose syntax.
- Live Collections: Powerful automatically updated collections for reference lists and queries
- UI Bindings: All entities implement INotifyPropertyChanged and are easily bindable to UI frameworks.
- Create Entities
- CRUD operations
- Subscriptions
- Queries
- Live Collections
- UI Bindings
A simplified chat domain.
[PersistedClass]
public class User : DataItem
{
[PersistedProperty(IdOrder = 1)]
public string Username { get => getter<string>(); set => setter(value); }
[PersistedProperty]
public DateTime LastLoginTime { get => getter<DateTime>(); set => setter(value); }
[PersistedProperty(ReverseRef = nameof(ChatMessage.Author))]
public DataItemRefList<ChatMessage> Messages => getList<ChatMessage>();
[PersistedProperty(ReverseRef = nameof(ChatRoom.Users))]
public DataItemRefList<ChatRoom> ChatRooms => getList<ChatRoom>();
}
[PersistedClass]
public class ChatRoom : DataItem
{
[PersistedProperty(IdOrder = 1, AutoValue = AutoValue.Identity)]
public long Id { get => getter<long>(); set => setter(value); }
[PersistedProperty(IsMandatory = true)]
public string Name { get => getter<string>(); set => setter(value); }
[PersistedProperty]
public DataItemRefList<ChatMessage> Messages => getList<ChatMessage>();
[PersistedProperty(ReverseRef = nameof(User.ChatRooms))]
public DataItemRefList<User> Users => getList<User>();
}
[PersistedClass]
public class ChatMessage : DataItem
{
[PersistedProperty(IdOrder = 1, AutoValue = AutoValue.Identity)]
public long Id { get => getter<long>(); set => setter(value); }
[PersistedProperty]
public string Text { get => getter<string>(); set => setter(value); }
[PersistedProperty]
public DateTime CreatedTime { get => getter<DateTime>(); set => setter(value); }
[PersistedProperty]
public DateTime FirstReadTime { get => getter<DateTime>(); set => setter(value); }
[PersistedProperty(ReverseRef = nameof(User.Messages))]
public User Author { get => getter<User>(); set => setter(value); }
}
// Reading a user
var key = DataItemKey.BuildKey<User>("myusername");
var user = client.ReadDataItem<User>(key);
// Reading a chatroom
var key = DataItem.BuildKey<ChatRoom>(1);
var room = client.ReadDataItem<ChatRoom>(key);
// updating user scalar value
user.LastLoginTime = DateTime.Now;
client.Save(user);
// creating a message
var msg = client.CreateDataItem<Message>();
msg.Text = "Hello my friend";
msg.User = user; // creating a relation between msg and user, back reference is automatically assigned
msg.Room = room; // creating a relation between msg and chat room, back reference is automatically assigned
client.Save(msg, room, user);
// Deleting a user
user.MarkForDeletion();
client.Save(user);
// Reading a user
var key = DataItem.BuildKey<User>("myusername");
var user = client.ReadDataItem<User>(key);
// Reading a chatroom
var key = DataItem.BuildKey<ChatRoom>(1);
var room = client.ReadDataItem<ChatRoom>(key);
// Subscribe to all transaction events
client.DataItemSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
// Subscribe to all transaction change events that that occur at every instance and the client listens to
client.DataItemSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
// Subscribe to transaction change events that occur at every instance of a specific type, eg chatrooms
var roomClassInfo = DataItem.GetClassInfo(typeof(ChatRoom));
roomClassInfo.DataItemSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
// Subscribe to transaction change events for the specific instance, eg chatroom 1
room.DataItemSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
// Subscribe to transaction change events that occur to references of the specific instance
room.DataItemReferenceSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
// Subsribe to all instance changes, both transaction and local changes
client.DataItemChanged += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: {String.Join(',', e.ChangedPropertyNames)}");
// Subsribe to standard .NET property change events, both transaction and local changes
user.PropertyChanged += (o, e) => Console.WriteLine( e.PropertyName );
// get Message class info
var msgClassInfo = DataItem.GetClassInfo(typeof(Message));
/******** perform query using the simple syntax ********/
// create expression
var expr = new ExpressionBuilder($"where {nameof(Message.IsRead)} = true");
expr.DeclareClassInfo(msgClassInfo);
// create where expression
var whereIsReadExpr = expr.Create(msgClassInfo);
// create query (validator)
var validator = new DataItemCollectionValidator<Message>(true) as IDataItemCollectionValidator<Message>;
validator.QueryExpression = whereActiveExpr;
validator.IsForceLoader = true;
// read current instances and create a collection that is automatically validated against the query and updated on each transaction
client.ReadDataItems(validator);
/******** perform query uisng the verbose syntax ********/
// get IsRead field
var isReadField = msgClassInfo.GetField(nameof(Message.IsRead));
// create where expression
var whereIsReadExpr = new WhereComparisonExpression(isReadField, WhereOperator.Equal, false);
// create query (validator)
var validator = new DataItemCollectionValidator<Message>(true) as IDataItemCollectionValidator<Message>;
validator.QueryExpression = whereActiveExpr;
validator.IsForceLoader = true;
// read instances based on query (non-live collection)
client.ReadDataItems(validator);
/******** Query based Live Collection ********/
// create expression
var expr = new ExpressionBuilder($"where {nameof(Message.IsRead)} = true");
expr.DeclareClassInfo(msgClassInfo);
// create where expression
var whereIsReadExpr = expr.Create(msgClassInfo);
// create query (validator)
var validator = new DataItemCollectionValidator<Message>(true) as IDataItemCollectionValidator<Message>;
validator.QueryExpression = whereActiveExpr;
validator.IsForceLoader = true;
// read current instances and create a collection that is automatically validated against the query
var liveCollection = client.ReadDataCollection(validator);
// subscribe to transactions changes. Track additions and removals in the list
liveCollection.DataItemListSaved += (o, e) => Console.Write(
$"Added Members:" + String.Join(',', e.AddedMembers.Select(x => x.FullId)) + Environment.NewLine +
$"Removed Members:" + String.Join(',', e.RemovedMembers.Select(x => x.FullId)));
// Subscribe to transaction change events that occur to a reference list members
liveCollection.DataItemListMemberSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
/******** Reference List Live Collection ********/
// subscribe to transactions changes. Track additions and removals in the list
room.Messages.DataItemListSaved += (o, e) => Console.Write(
$"Added Members:" + String.Join(',', e.AddedMembers.Select(x => x.FullId)) + Environment.NewLine +
$"Removed Members:" + String.Join(',', e.RemovedMembers.Select(x => x.FullId)));
// Subscribe to transaction change events that occur to a reference list members
room.Messages.DataItemListMemberSaved += (o, e) => Console.WriteLine(
$"Changed Item: {e.DataItem.FullId}," + Environment.NewLine +
$"Changed Fields: { String.Join(',', e.GetChangedFields().Keys)}");
Standard Xaml and WinForms binding out-of-the-box
<Grid Grid.Row="2"
RowDefinitions="Auto,Auto"
ColumnDefinitions="1*,3*">
<Label Grid.Row="0"
Grid.Column="0"
Text="Name:"/>
<Label Grid.Row="1"
Grid.Column="0"
Text="Message:"/>
<Entry Grid.Column="1"
Grid.Row="0"
Placeholder="Enter your name"
Text="{Binding Username}"
x:Name="nameEntry"/>
<Entry Grid.Column="1"
Grid.Row="1"
Placeholder="Enter your message"
Text="{Binding Text}"
x:Name="messageEntry"/>
</Grid>
Enterprise Grade Features
Declarative Data Modelling
Build your Reactive Entity Model (Domain) with a minimal special notation. Feel comfortable as it is similar to Entity Framework.
Out-of-the-box Backend
Plug your entity model in the server and you are ready to go. The Object Server has many functions built-in.
Transactional Data Sync
It provides a simplified programming model where the changes are continuously synchronized to the clients.
Event Driven
Write reactive appication code using typical .NET events like PropertyChanged.
Integration Engine
Fuse data from various sources into the same Entities. Use Runtime and Gated fields wherever needed and minimize integration code.
Standard .NET
Use the same tools you are familiar with, like Visual Studio. Take advantage of the large .NET ecosystem and Nuget packages.
Risk-Free, Cost-Effective, Guaranteed Delivery!
Start your project now!
Contact Us
Schedule a Meeting