theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

Add a registry for model classes #190

Closed spoenemann closed 6 years ago

spoenemann commented 6 years ago

Currently model classes registered by implementing a subclass of SGraphFactory or SModelFactory, while views are registered with a string-key-based registry, which is a lot easier. We should add another registry for model classes and add a utility function that allows to register both the model and the view in a single line of code.

This change can be done in a way that existing custom model factories remain valid: the SModelFactory should take care of looking up the model registry.