VITA 1.1 update, Feb 9

Feb 9, 2015 at 6:13 PM
Hi all
Today's code push contains some big internal refactorings and some changes to public APIs. The most 'visible' changes are the following:
  • Vita.Core and Vita.Data projects are now merged in one, which produces Vita.dll.
  • IEntityStore interface and EntityStore object is gone. Now all operations involve just EntityApp class.
There are a lot of internal changes and realignments, namespaces reshuffling, renames, etc. These changes I believe result in simpler, more intuitive public API, and better internal alignment.
Some particular changes:
  • AuthorizationService instance is now created automatically and is available as EntityApp.Authorization property. For handling user roles requests, instead of hooking to Authorization service event, you override GetUserRoles virtual method in EntityApp. Authorization service is always created, but gets into play only if the app starts using Secure sessions
  • CacheSettings is now property of EntityApp. The recommended pattern is to add entity types to cache inside the entity modules that declare entities. So a module, after registering entities in constructor, can add some of them to CacheSettings types, suggesting to cache them. The cache can be disabled/enabled globally by simply setting CacheSettings.CacheEnabled flag.
  • UserInfo object now contains AltUserId field (Int64) - for applications that use Integer IDs (most likely identities). Login module (ILogin entity) also handles this - there is new property AltUserId in ILogin entity. The value is returned in LoginResult object on successful login. Authorization service also supports int user ids (AltUserIdReader class for use in data filters)
  • The ActivateHelper class is gone, and messy initialization process is greatly simplified. Now you just call EntityApp.Init() - this builds the entity model and sets up all internal services. Then you call EntityApp.ConnectTo(dbSettings) to connect to the database.
  • The data operations now go through DataAccessService which internally handles a list of data sources. A data source is basically a tuple: Database and associated Cache. For now, it all works and tested with a single database/data source. The move is to handle multiple databases scenario, like multi-tenant app - when a single app handles multiple org customers, with each org having its own database instance.
There a still some unfinished places there which I need to brush-up, will be coming shortly. I will be updating documentation pages this week to match the new APIs
Feb 10, 2015 at 11:55 PM
Documentation pages updated