I have an LLBLgen'd DAL that is done and in use today for an application.
We have several projects now, where customers have contracted us to extend the application for them.
So my Goal is to keep my core project as is, and extend it for each customer.
My first guess is this.
Say the core database/application has an Entity Called Product, and our client wants to add extended fields/properties to that entity.
So I add a table to the customer catalog, called ProductExtension.
ProductExtensionId - GUID
Product - GUID
Width
Height
Weight
Color
Now I have a 1:1 extension table for data, but I'm going to have a hard time getting the data back into the LLBLgen'd product. If I add a relationship, then the LLBLGen'd code is going to duplicate my oroginal ProductEntity, so I'm not adding a relationship in the database.
I can use inheritance chain, to help as a facade object.
pseudo ...
public class ClientProduct : ProductEntity
{
ClientFields ProductExtensionEntity;
}
Then I have a new object that will nicely work for all the data round trip in llblgen, but I have to call all the methods twice, once on product, and once on ProductExtention. Sure I can override the save() and do the code in there, but I'm still calling the code twice, and doing two round trips to the database.
This is all because I don't know how, or if, there is a way to set relationships programatically, after the code has been gen'd.
<summaryQuestion>
Can I add the 1:1 PK/FK relationship in code, after the projects have been created, or am I on the right track with the inheritance style above? Or is there something else that I haven't seen or thought of yet?
</SummaryQuestion>
Thanks for the guidance.