0.19.3 • Published 10 years ago

thingmodel v0.19.3

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

ThingModel

ThingModel synchronizes data and models in realtime over the network for multiple devices.

ThingModel is a new wheel, but a simple, fast and light one.

ThingModel does not need compilation, it does not include a DSL either and everything is done during runtime. You can build the model on the fly and the connected applications can learn it during their executions.

If you are looking for innovative products about models, you should also take a look at ThingML or Kevoree.

The model

Model

Light network synchronization

  • Clients and servers over WebSockets
  • Light serialization with Protocol Buffers
  • Diff algorithm, only send changes
  • String cache for smaller messages

Multi-plateform

  • C#
  • .Net and Mono
  • For the PixelSense table
  • And because C# is cool
  • JavaScript (and TypeScript)
  • HTML5 browsers
  • Works with Node.JS
  • Java
  • Android (with Google Glass support)
  • JVM (with Minecraft)
  • Or a HLA bridge for VBS

A collection of tools

A broadcast server

Screenshot server

If this server doesn't suit your needs, you can easely develop your own ThingModel server.

A time machine

Screenshot timemachine

The time machine saves the model in realtime (1 hertz as maximum frequency by default). Thanks to protocol buffers, gzip and sqlite, it's very light.

And you can go back in time just with a HTTP request.

Bugs

ThingModel is tested and used almost every days and it works, but it's not stable.

Please follow the checklist if you are experiencing some weird problems.

Installation

Nuget: Install-Package ThingModel -Pre

Bower: bower install ThingModel

Maven: need motivation

Otherwise: Download

Example (in CSharp)

// Declare the rabbit type
var typeRabbit = BuildANewThingType.Named("rabbit")
				.WhichIs("Just a rabbit")
				.ContainingA.String("name")
				.AndA.LocationLatLng()
				.AndA.NotRequired.Double("speed")
				.AndAn.Int("nbChildren", "Number of children");
				
// Create a rabbit instance
var rabbit = BuildANewThing.As(typeRabbit)
				.IdentifiedBy("ab548")
				.ContainingA.String("name", "Roger")
				.AndA.Location(new Location.LatLng(60,10))
				.AndAn.Int("nbChildren", 12);

// The warehouse stores the objects
var warehouse = new Warehouse();

// Create a websocket client
var client = new Client("Emitter", "ws://localhost:8083/", warehouse);

// Register the rabbit
warehouse.RegisterThing(rabbit);

// Send the changes to the server
client.Send();
var warehouse = new Warehouse();
var client = new Client("Receiver", "ws://localhost:8083/", warehouse);

warehouse.Events.OnNew += (sender, args) => {
    Console.WriteLine(args.Thing.String("name"));
};