Template questions

Posts   
 
    
mikeg22
User
Posts: 411
Joined: 30-Jun-2005
# Posted on: 01-Jul-2005 01:01:37   

I don't have the SDK so I don't know the capabilities of using templates to customize the generated code, so here's my questions:

  1. Can I edit a template?

If so...

  1. If I edit a template to, say, include another user defined code region, and a bugfix release comes out that includes changes to this same template, will I lose the changes I made?
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 01-Jul-2005 09:26:41   

mikeg22 wrote:

I don't have the SDK so I don't know the capabilities of using templates to customize the generated code, so here's my questions:

  1. Can I edit a template?

Yes, they're just text. Customers even have a full blown IDE for that simple_smile

If so... 2. If I edit a template to, say, include another user defined code region, and a bugfix release comes out that includes changes to this same template, will I lose the changes I made?

Templates are bound to templateID's. These bindings are defined in a templateset config, which you can find in each driver's templates folder. (CSharpTemplateset.config etc.)

If you create a new templateset config (it's just xml) and bind an id to your custom template, newer templates won't overwrite your own. You do have to migrate your own to the new template though. However most of the time, bugfixes to templates are not very common, and extending templates is mostly done by include templates, i.e. binding a template to one of the include template id's discussed in the documentation ("Using the generated code -> Adding your own code to the generated classes")

Frans Bouma | Lead developer LLBLGen Pro