Adding interface layer for multiple code generations for different target databases for abstracted usage in the same app

Posts   
 
    
tuxen
User
Posts: 2
Joined: 20-Apr-2010
# Posted on: 20-Apr-2010 14:56:57   

Hi all.

Is it possible to add an interface layer to ease switching between 2 different code generations for different databases?

The challenge is this.

I have 1 Application which depending on a configuration setting runs with a backend DB of either SQL server 2005 or Sql Compact edition.

At runtime the application chooses the correct database layer based on the configuration. Both the DB layer code for SQL Server 2005 and Sql compact edition is interfaced so business layers using the db service doesnt care about the underlying provider.

So can I implement something like this with LLBLGen ? And what techniques in LLBLGen should be used to obtain this ?

Define DB interfaces

Generated DB layer A - implements DB interfaces Generated DB layer B - implements DB interfaces

Thank you, best regards Tuxen

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Apr-2010 07:29:37   

Are you using Adapter or SelfServicing? DataAccessAdapters implements IDataAccessAdapter so you can use such interface. Then you can have two different DAL to use/switch.

David Elizondo | LLBLGen Support Team
tuxen
User
Posts: 2
Joined: 20-Apr-2010
# Posted on: 21-Apr-2010 12:34:54   

daelmo wrote:

Are you using Adapter or SelfServicing? DataAccessAdapters implements IDataAccessAdapter so you can use such interface. Then you can have two different DAL to use/switch.

Thank you for your quick answer. Currently the projects data access code gets generated by another framework. Ill try a llblgen demo using adapters and check it out using the interfaces.

thanks