When we think cloud we inherently think Multi-tenant but things can get complicated when the level of white-labelling on the UI is extensive! Layout changes are typically handled by css but if the customer wants to control what every label and textbox is called then we have a problem at hand!
We recently suggested the following approach to one of our customers!
Scenario:- Customer A wants to call a button X and Customer B wants to call it Y! And they may want to do this to all labels and buttons. Customer C however is OK to go with the default!
- Each customizable button will have a name associated which should be easily identifiable like Page1HelloThere button.
- Each page will also have a name in the DB. This will be useful for reducing searching for tags during page load
- If a customer wants to customize the text of that button then one entry will be made in the UI Customization table for that Customer-Tag for each language the customer wants to support
- During Load the application will check the database to load all customizable strings for the specified Language for the Tenant ID and store in Cache
- Each time the screen is loaded, the app should quickly check in the cache to see if there are any customizations applicable for that PageTag. If yes then apply the customization to loaded page.
<Button Text=<Load from resource file> name=”page1HelloThereBtn”>
<Button Text =< Load from resource file > name=”page1ClickHereBtn>
Note the following in the implementation above :-
- John Smith has Customizations only for Hello Button in 2 languages (Spanish and French) so Click Here will load as “Click Here” only (it will be pulled from resource so it will load in the right language)
- Alex has customizations only for the “Click Here” in English so “Hello There” is still called “Hello There” it will be pulled from resource so it will load in the right language)
The approach is extensible and caters for non-fussy and fussy customers both by ensuring the database is not sparsely populated and rows are entered only if needed. Inspiration taken from none other than the master https://msdn.microsoft.com/en-us/library/aa479086.aspx!