Domain Model Mapping

Posts   
 
    
krkc
User
Posts: 20
Joined: 12-Apr-2006
# Posted on: 20-Oct-2006 08:27:41   

Hi,

LLBLGen Pro Version: 2.0 SQLServer : 2005 .NET : 2005

I'm working on a Domain Model Architecture where my SQLDatabase replicates the architecture class model.

I have a Base Abstract Class (X) and Classes A, B & C are deriving from X and have a 1:1 mapping on the Pk of X.

Like how in the TwoClass Scenario LLBL is deriving the Entity Class from EntityBase Class, I am using a Single Class Scenario (General) to acheive the same like


Public abstract class X : XEntity
{
...
}

Public class A : X
{
...
}


My ASPX Page



public partial class MyPage : UI.Page
{
      protected void Page_Init(object sender, EventArgs e)
     {
           //To Do
           How to create and instance of A with all the AEntity features
     }
}


Waiting for your feedback

Many Regards, Ravi K. Kalyan

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 20-Oct-2006 09:18:16   

I'm sorry I'm not following...

So at the end what's your question ?

krkc
User
Posts: 20
Joined: 12-Apr-2006
# Posted on: 20-Oct-2006 11:34:16   

krkc wrote:

public partial class MyPage : UI.Page { protected void Page_Init(object sender, EventArgs e) { //To Do How to create and instance of A with all the AEntity features } }

** How to create and instance of A with all the AEntity features**

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 20-Oct-2006 16:26:42   

How to create and instance of A with all the AEntity features

Doesn't AEntity falls in the inheritance hierarchy of A? If so then A will inherit all the features in AEntity

krkc
User
Posts: 20
Joined: 12-Apr-2006
# Posted on: 23-Oct-2006 07:36:58   

Walaa wrote:

Doesn't AEntity falls in the inheritance hierarchy of A? If so then A will inherit all the features in AEntity

As per my model, I have to inherit my ClassA from X and not from AEntity as I have some methods in X which I need to implement in A.

And that is the reason I am unable to create an instance of A with all the feautes of the AEntity.

Also suggest me how can I provide SQLCacheDependency for the classes?

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 23-Oct-2006 09:55:06   

And does X inherit from another entity "XEntity" rather than AEntity?

If so then you might consume AEntity inside class A (since multiple inheritance is not allowed) -> define an instance of AEntity within class A

krkc
User
Posts: 20
Joined: 12-Apr-2006
# Posted on: 27-Oct-2006 12:26:47   

Walaa wrote:

And does X inherit from another entity "XEntity" rather than AEntity?

If so then you might consume AEntity inside class A (since multiple inheritance is not allowed) -> define an instance of AEntity within class A

ThanQ. I now have a Public Property of the TableEntity in my class and in the class constructor I am initializing the TableEntity and thus getting the Multithreading running.