Adapter true Full/Safe

Posts   
 
    
Jeff M
User
Posts: 250
Joined: 04-Aug-2004
# Posted on: 07-Dec-2004 07:24:08   

Is it possible to create an Adapter template that further abstracts the EntityClasses -> EntitySubClasses -> SafeEntityClasses? The SafeEntityClasses would inherit from the EntitySubClasses and would not be overwritten upon new generations. The generator would relate the SafeEntityClasses (along with related collections) to each other in much the way that EntityClasses are handled in the Self-Servicing templates.

Is this a good idea?

Jeff

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Dec-2004 10:11:09   

Check out the derivedentity templates in the 3rd party section on the website (customer area) simple_smile These will generate derived classes for you for adapter, which are not affected by the general adapter templates/code generation runs.

Frans Bouma | Lead developer LLBLGen Pro
Jeff M
User
Posts: 250
Joined: 04-Aug-2004
# Posted on: 07-Dec-2004 15:15:13   

I think that you're referring to the Extended entity generator templates for Adapter, but these MyEntities have to be regenerated when there are changes to the underlying database. Where should we put custom code?

Thanks. Jeff

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 07-Dec-2004 15:40:53   

They only have to be regenerated when an entity is added, or a relation has been changed.

You could also opt for custom include templates. This comes down to binding a file with your custom code to the ID: Custom_EntityAdapterTemplate in a copy of the template set config you're currently using.

If the logic is for all teh entities, simply add the code and it will end up in all the entities. If logic is for one entity only, surround the logic with: (example here, the entity is Order) <[If StringValueEquals CurrentEntityName "Order"]> // your code for the Order entity <[EndIf]>

(you can also specify more than 1 entity or use NOT to exclude just one or a couple of entities. See the SDK docs for details)

then, everytime you generate your code, select that custom template set config and your custom code is generated into the entity classes.

To ease development of such templates, please use the Template Studio beta, available in the extra's section simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Jeff M
User
Posts: 250
Joined: 04-Aug-2004
# Posted on: 07-Dec-2004 19:33:55   

Looked at the Template Studio for the first time. Amazing!