Ticket T924475
Visible to All Users

On XAF Architecture - How to develop and maintain develop many, independent and different apps in a corporate environment (with shared modules, security settings, etc.)

created 5 years ago

Good day.

I suggest that this ticket should be referred to Dennis.

XAF is a great framework and I love to be able to have a functioning application that can be used to solve business needs very quickly.

However there are some drawbacks that I would really like to see improved. My main issue has to do with that the XAF focuses on just building one application and I do not really see possibilities to share code and solutions between different applications.

The security system is a good example of this. Currently the security system has nice features and it is possible to fine tune really well the access of users to different parts and objects of the application. However, In my company have a need to develop many independent applications and that means that currently we have to define the same users and roles 20 - 50 times, once for each application which is extremely inconvenient. A shared security system between different xaf applications would be an amazing improvement.

It would also be really nice if it would be a little easier to group several xaf applications together in a sort of an umbrella application. I know it is possible to create different modules in XAF that connect to different databases and I do have an experience with this but my experience was that it is complicated and full of all sorts of difficulties.

I am very excited about the Blazor version of XAF becoming production ready and I really hope that these things, I mentions here will be considered as it develops in the future.

Best regards,
Ægir

Answers approved by DevExpress Support

created 5 years ago

Hello Ægir,

We appreciate your feedback and suggestions. I will pass them to Dennis and to the whole team.
Would you elaborate on sharing the security system? I am asking because XAF already allows you to create users and roles in the Updater.UpdateDatabaseBeforeUpdate schema method: Predefined Users, Roles and Permissions. If you create a separate XAF module with this method, you will be able to add it to any XAF application you develop. It is also possible to export roles and permissions created at runtime to the UpdateDatabaseBeforeUpdate method's code: How to generate database updater code for security roles created via the application UI in a development environment. Have you considered this option? Please let us know if it meets your requirements.

    Show previous comments (16)
    J J
    James S K Makumbi 5 years ago

      I think we need to write sample apps and work through this in code.
      We are confusing "the database" for "the application tables" in the database.
      I also think we are confusing database (mssql and mysql) users (sa and myadmin) with application users.
      2020-09-05_01-29-57.png
      Attached is an image of/from my sqlserver express instance.
      There are three app databases AgroDb, BillableHours and The Surgery.
      Each of these app databases has it's own tables for users and roles which is great becasue those three apps have absolutely nothing to do with each other (farm management, legal practice management and hospital management).
      @Dennis, the question is, if all those three apps were for the same client/customer but were developed by different teams, is there some way to have all three applications share the same security service and database of users and roles?
      That is/was the question,
      I hope I have clarified it.

      Dennis Garavsky (DevExpress) 5 years ago

        @James: Thank you for your update. Everywhere in my replies by "shared database" I meant a physical database residing on a Microsoft SQL Server (or another engine) instance. By "users" (depending on context) I meant both application end-users and associated security system objects or records in the 'PermissionPolicyUser' table within this shared database.

        Yes, there is a way to have all three applications to share the same security system settings and data in a shared database. I see a good solution with How to prevent altering the legacy database schema when creating an XAF application as it looks the simplest here. If anybody already tried to implement this or other solutions for this task, but experienced issues with connecting to multiple databases, we will be more than happy to look into your real-world scenarios and specific code that you tried to implement, but which did not work as expected or was inconvenient. Hopefully, we can make it simpler together with these facts.

          I am happy to see a solution provided by DevExpress here:

          https://docs.devexpress.com/eXpressAppFramework/118740/task-based-help/security/how-to-assign-the-same-permissions-for-all-users-of-an-active-directory-group

          I think that by utilizing this we can resolve all the use cases I had in mind. By auto creating Windows users in an XAF application (with default roles without any actual access) and creating roles that can be directly mapped to Active Directory groups we can avoid the tedious work of creating users and assigning roles to them in multiple applications. Of course the users are physically created in multiple XAF applications by this but that is not a problem as that is all done automatically.

          My experiments with this are looking good and I think it is totally fine to have the assignment of roles to individual users, centralized in Active Directory.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.