Vibrant discussion about CSLA .NET and using the framework to build great business applications.
has anyone taken Kathleen Dollard's code that accompanied her book "Code Generation in Microsoft .Net" and used it as a basis for a live project?
I too have been developing code generation systems in one form or another for many years but never using an XML approach until recently and never generating WinForms UI. What approach do you use?
I'm not using xml as a basis for code generation yet.
I use a custom csla library that understands the sql server database structure and c# code.
That, or I just use a single sql statement if it's simple enough (like for the stored procedures to insert, update, etc.)
I'm not sophisticated enough with my object modeling to need an intermediate xml layer yet, nor have I had the time to build the intermediate tools I would need.
I am using Code Generation from Kathleen Dollard since last year. I’ve tried other code generators and I think that the XML and XSLT is the best approach.
I am working in an application where the 90% of all code is autogenerated. I am generating also the UI.
The most important things (to me) from the Kathleen’s purpose is:
- You can generate huge amounts of metadata from your database.
- You can generate not only the classes of your application but also the stored procedures needed in your database. And if you want, you can synchronize your database with the new generated stored procedures in the same process (with the same click you used to generate them).
- You can infer the relationships between classes. This makes easier regenerate the full application in 10 minutes with just one click.
- You can regenerate almost everything any time you want. As the database is the main metadata source, when the database changes you can regenerate your metadata, your stored procedures and your application’s classes.
- As you have all your inference rules in different XSLT files you have all development process documented and you know the why of every line of code (auto generated).
- When there is a bug in your classes or stored procedures, the problem is cloned in many objects, so it is easy to detect it. Then you look for a solution, you change your XSLT files and your make one click on your mouse. In few minutes the problem is gone in all the application. This is amazing!
I believe that XML and XSLT based generation is very powerful and flexible. I am the author of Code Complete a code generator based solely on XML and XSLT, and the whole idea has been inspired by the Kathleen Dollard's book.
Thank you for your reply Philip. I have had a brief look at Code Complete and it looks exactly what I'm looking for, but I have just a few questions like what version of CSLA does it target? Do you intend to keep it inline with future development of the CSLA framework? If this is not the place to ask such questions can you guide me to the right place.
The current version of Code Complete supports the latest version of CSLA.NET and we update the Code Generator to support always the latest version.
To learn more about Code Complete you can visit http://www.eurowisesoft.com