Code Generation of CSLA Stored Procs

Code Generation of CSLA Stored Procs

Old forum URL: forums.lhotka.net/forums/t/572.aspx


Bonio posted on Saturday, July 08, 2006

This may sound like the height of laziness :-) , but I looking for recommendations for a suitable template to generate Stored Procs for CSLA objects. I have hundred of tables and hand-coding each one will take me years..\Big Smile [:D]

I have tried using those designed for Easy Objects, but have been having problems getting the timestamp columns just right.

Could someone recommend a set of templates that might be suitable (either for CodeSmith or MyGeneration).

Thanks in advance.

Bonio

Bonio replied on Saturday, July 08, 2006

In response to my own question Smile [:)], I have been playing around with MyGeneration templates to
see if I could get what I needed.

Attached is my first effort, based on the Doodads template code and altered to match Rocky's SP structure in his book (especially the timestamp feature).

This is a bit of a 'bodge' coding, but I have managed to now successfully generate my CSLA.Net SPs.

Comments/amendments gratefully accepted.

Bonio

P.S. the template is a .vbgen file created in the latest version of MyGeneration v.1.1.6.0 - link to this software (freeware) : http://www.mygenerationsoftware.com/portal/default.aspx

harmar replied on Thursday, September 07, 2006

while reading the book i also had the idea of fumbling around with the doodads template to generate all the stored procs for the ptracker db (it works for other db's too).
because timetable columns are already treated the way i like it i didn't change that. but because i like the way the procs are named in the book i added this naming convention to the template (it only works for english names and can be unchecked). so a table named 'Employees' generates to: addEmployee, existsEmployee, ...
this template does the job for me ;-)

regards
harmar

figuerres replied on Thursday, September 07, 2006

I have not looked at the one you used but FWIW I have started using CodeSmith and so far I have generated about 20-30K lines of VB.Net and TSQL with it.

very good ! easy to understand, and looks like it can create text for just about anything, just make a template.

not free but I can see that just in 2 weeks it's created code that by hand would have taken months to key in and test. and as I tune the templates each time I use them it's better output with less manual tweaking!

skagen00 replied on Friday, September 08, 2006

FWIW, you can download CodeSmith 2.6 for free, which does allow the capacity to use the C# codesmith templates.

The creator of the templates did an absolutely marvelous job.

 

Copyright (c) Marimer LLC