Last week I helped to a customer who tried to marry our E2813 and E968 examples. After helping the customer, I decided to refactor the latter example to make it more universal. Of course, fortune and hunger for coding are not the only reasons for this. I remember that in the past, our customers wanted to use E968 with different security strategies while we only had an example for the simple security system, which is not as popular. Another reason is that the way of managing settings for all application users can be improved (currently it is possible by running the application with a special command line parameter). Finally, the current example class structure might be simplified. So, I decided to kill all these birds with a single stone.
Attached is a zipped version of what I came up with in the end. Notice the new DbModelStore XAF module that is ready to use in your application. It depends on the core stuff only. The core of the module itself is a couple of persistent classes used to store model differences and aspects in the database + a custom ModelDifferenceStore. You can provide your own versions of persistent classes as they both implement the base IModelAspect and IModelDifference interfaces. Of course, a custom ModelDifferenceStore talks to interfaces instead of real classes.
If you provide your own versions of these classes you can specify their types via the respective ModelAspectType and ModelDifferenceType properties of the DbModelStore module (via the Application Designer).
To manage default model settings for all users, a special Configurator user is used (if the security system is enabled). I have also shared a small video to show this process in action.
Take special note that once the configuration is finished, users must restart their applications. If you want, you can specify a custom user name via the respective property of the DbModelStore module.
I hope that one day a similar functionality will be implemented in our framework by default. At least, this is the first step toward it;-)
As always, I will be glad to hear your feedback on how this works and whether you like what you see. Thank you in advance!