Ticket B331
Visible to All Users

Weak associations as member collections

created 19 years ago

Sometimes it would be helpfully to have the possibility to define associated objects without having a declarative association defined by the AssociationAttribute, which is based on the objects key property and mapped to database foreign key constraints.
This can be realized in a simple form (without caching the already loaded collection) like the following property definition:
Public Readonly Property SelectedObjects as XPCollection
  Get
   myCriteria = …
    Return new XPCollection(session,GetType(MyObject), myCriteria)
  End Get
End Property
This allows object references, which are built on fully free search criteria, not based on foreign key relations.
The only disadvantage of such a member collection is, we cannot bind this collection at design time to form controls.
Proposed Solution:
My idea is to define a new attribute ( for example WeakAssoctiation) to define the object type of the member collection. With this attribute information XPO should be able to set the XPMemberInfo properties like IsCollection and CollectionMemberType etc. to satisfy the binding interface like normal member collections.
The above example will then look like this:
<WeakAssociation(GetType(MyObject))> _
Public Readonly Property SelectedObjects as XPCollection
  Get
    myCriteria = …
    Return new XPCollection(session,GetType(MyObject), myCriteria)
  End Get
End Property

Comments (1)
DevExpress Support Team 19 years ago

    Thanks for the feature request. The current version does not provide a solution to your task. Most likely, we will create an attribute to specify an element type for properties of type XPCollection.

    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.