Print Page | Close Window

Link to Object with Multiple Subclasses

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=968
Printed Date: 28-Apr-2026 at 12:16am


Topic: Link to Object with Multiple Subclasses
Posted By: danielp37
Subject: Link to Object with Multiple Subclasses
Date Posted: 17-Oct-2008 at 9:44am
I have an abstract Agreement object with many subclasses (MemberAgreement, InvestmentAgreement, etc)

I have another object that links directly to one of these Agreements but the agreement might be of any of those types or may not exist at all because it hasn't been set yet.

Normally when navigating to a link that does not exist a null entity would be returned but in this case the Agreement base class is abstract since in practice we would never have an instance of agreement but I am getting an error when traversing the link because it can't create an instance of an abstract class (which I assume is occurring when it is trying to create the null entity for Agreement). 

This isn't a huge issue to me at the moment as I can code around this but I just thought it was an interesting issue.



Print Page | Close Window