Ticket T140371
Visible to All Users

XAF: Use Domain Component in Module with relationship to XAF User Account

created 11 years ago

Hello,

I'm attempting to build an XAF module with domain components to be reusable in an XAF app.  I've got a single DC with some properties and I'd like to add a many-to-many relationship from the DC to the XAF user account object type regardless of how the user account is setup in the XAF solution.

What is the recommended way to accomplish this?

--

The specific use case is the DC is an object that one or more users could "Favorite".

Answers approved by DevExpress Support

created 11 years ago

Hello Adam,

Mixing domain components and persistent classes is not recommended and has limited support in XPO. So, it is better to design DC versions of user and role classes (find an example in our demo at C:\Users\Public\Documents\DevExpress Demos 14.1\Components\eXpressApp Framework\SecurityDemo\CS\DCSecurityDemo.Module\Security).
If you just want to add a reference to a persistent object from a domain component and vice versa, then you can use solutions from the How do I reference a domain component from an XPO business class thread.
However, there is no universal way of doing this irrespective of the user type. So, you would likely provide specific solutions for particular user types here.
Take special note that establishing a true XPO association between a DC and XPO entities would require modifications of the source code of both entities, unless you opt to do this at runtime by customizing the types metadata: How to customize a Business Model at runtime (Example). This approach has limitations for domain components as well.

    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.