Tl;dr Unity architectural framework built on Zenject and UniRx with the purpose of speeding up development while encouraging well laid out architecture. It heavily relies on code generation. You could compare it to Ruby on Rails, in that it prefers convention over configuration and wants you to automate the repetitive stuff (but then, my experience with RoR is very limited)
Reactor is just the name for MVPs Presenter with all the data exposed in form of UniRx data streams. In its current form, one presenter gets created for every model and you bind data manually, more or less like this:
using UniRx;
using UnityEngine;
public partial class FooReactor
{
protected override void BindDataSourceImpl(FooModel model)
{
Subscriptions.Add(model.GetProperty<string>(nameof(IFoo.Text)).Subscribe(Debug.Log));
}
}
There's also experimental implementation of automatic view binding, for the time being though (20/02/24), I discourage using it yet; it's still subject to change.
This is the second meaning of R in UMVR - Repository lays out the models in a predictable way. Think of it like of the way to make your model a little more like a database, with each Repository being a table.
You can get by primary key:
Id totallyValidId = default;
repository.Get(totallyValidId);
You can register secondary key and get by it:
public FooRepository(FooReactorFactory fooReactorFactory, FooRepository repository) : base(fooReactorFactory)
{
AddIndex(nameof(IFoo.Text), new SecondaryIndex<string,IFoo>(nameof(IFoo.Text), repository));
}
...
repository.GetBy(nameof(IFoo.Text), "Hello world");
And then there's the obvious stuff: Added/Removed events, iterators.
- Zenject usage is assumed and made easier by automatic generation of installers
Viewsare written manually, Zenject will deliver them toReactorsautomatically- Rest of the stuff is generated: in Unity,
[Tools]->[UMVR]->[Generator] - You should not modify
ModelinReactorsto avoid circular dependencies. Write ownControllersto drive the logic and modifyModel. Viewsshould never touchModeldirectly - there'sICommandinterface for that.- Since UniRx uses
IDisposablefor subscription cleanup, it trickles down to UMVR as well. Most types areIDisposableso you can dispose your subscriptions easily. Bind toIDisposablein Zenject to automate that.