Common Question: Base Classes?

Posts   
 
    
BoredAPC
User
Posts: 3
Joined: 28-Oct-2010
# Posted on: 28-Oct-2010 15:18:40   

Hello,

I use a homemade set of codesmith templates right now that use an implementation of the CSLA framework.

I was hoping to demonstrate base class inheritance functionality in LLBLGen, but I am not sure how to do it.

I'd searched for an answer, but did not find what I was looking for.

Scenario:

Given the base class of (pseudo code):

public class BaseValueClass

// properties

int Id DateTime DateCreated int InsertedBy DateTime DateUpdated int UpdatedBy DateTime ConcurrencyDate

snip <<

These 6 fields are in each value object.

Our current system has these 6 fields in each table, with the Id field named differently for each table (Customer table id = CustomerId, Orders table id = OrderId)

We gen our DALs and we pass in info unique to each object that lets it know that CustomerId = the Id property of the base class.

Question(s):

In LLBLGen, do I need to make a base class table and inherit from it? Can I still use an implementation of LLBLGen inheritance if my Id fields are unique to each table (CustomerId, OrderId)?

Do I need to even worry about deriving these common fields from a base class if I am using LLBLGen?

I had demoed LLBLGen 2.5 (2.6?) a few years ago and was able to show colleagues how similar it was our framework for runtime coding, and I'd like to re-visit LLBLGen again, but I am stuck on this aspect and functionality when comparing it to our (now unsupported internally) code generation setup.

Thanks!

**

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 28-Oct-2010 22:28:52   

LLBLGen does not support the concept of a base class, with a set of fields, from which all the other entity classes inherit. The reason for this, I suspect, is that if you are creating the classes manually then it makes sense to have a base class as it cuts down on the amount of code that you have to write by hand.

If on the other hand, the code is being generated for you, there is no real advantage to having a base class...

Matt

BoredAPC
User
Posts: 3
Joined: 28-Oct-2010
# Posted on: 29-Oct-2010 18:06:37   

Got it!

That's kinda what I thought.

Again - Great product! Good to see all the old faces from years ago have moved to the LLBLGen team.

Looking forward to getting it in-house to show the magic to people.