Abstract Entity...

Posts   
 
    
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 30-Oct-2006 02:27:13   

I just ran into a problem regarding Inhertiance and Abstract.

I have a hierarchy, with the top class marked as Abstract.

The following code works, and I would expect it not to:

MyRegularEntity test = new MyRegularEntity(); test.SomeInheritanceBasedCollection.AddNew(); //this would add the abstract class?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-Oct-2006 07:42:40   

More information is needed, please refer to the following guidelines: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7725

Make sure you explain your relation & inheritance hierarchy.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 30-Oct-2006 08:28:57   

Abstract isn't really abstract. It's not defined as abstract in the code, because the framework internally sometimes needs to create a dummy instance, for example for properties or for other things, and thus having an abstract class won't work. This means that the constructor is internal.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 31-Oct-2006 02:34:27   

Walaa - looks like you are the new forum police! simple_smile Two posts and I got two offenses. Anyway, I think I provided enough detail in this particular example for the problem I was experiencing.

Thanks for the answer Otis.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 31-Oct-2006 08:43:57   

We started the guidelines to overcome the useless first set of questions so people get to the solution sooner and we can help more people. Hijacking threads is also cumbersome, as often the problem isn't the same and the thread might be long and complex. simple_smile

Frans Bouma | Lead developer LLBLGen Pro