I started coding DotNetNuke modules back in DNN 1.06 when you had to compile your module into the main source of the project. So much of a DNN module will be the same from one module to the next that a code-generation tool makes a lot of sense. I'd rather tweak and improve my base code in a template so that any best practice techniques can be automatically incorporated into my next module. I won't say that creating a DNN module from scratch by hand is overwhelming--it certainly can be done, but the layers that have been added in DNN 2 & DNN 3 added functionality at the expense of additional code layers.
For DNN3, there are some great solutions:
Some other solutions (ok, but a step behind the generators above):
- Nate Thornton's DNN Templates look like they build upon Ashish Agrawal's additions to Mark (lunchin) Hall's earlier templates (Dave Allen-Williams--Dave A-W--fits into this chain somewhere too).
- John (grandOPUS) Thomas has VB.Net templates, and MyGeneration also includes standard DNN templates in their install.
- Todd Davis' Private Assembly Creation Tool (PACT)
I've use all of the above tools to generate DotNetNuke modules. By far the best tool listed above is AppTheory's ATGen SDK. This tool not only creates the module code, SQL Install, and DNN Manifest file, it also creates a NAnt build script which will package your module in both PA and Source .zip files which include the module name and version number! The files that it creates are very thorough and generate view and edit controls that support localization already. I love this tool, but it hasn't been maintained. For DNN modules targeting DNN 3.x, I would still heartily recommend this solution (warts and all). ATGen SDK will also generate a custom profile provider object for you if you so desire.
All the other solutions (to one extent or another) generate your module source code. Some of the better ones create a Visual Studio project/solution file and a DNN Manifest file (.dnn file). Some of them generate the SQL you'll need to install your tables. Some of them create the DAL code to query your database table and turn the data into business objects for you.
The problem? Where are the solutions for generating module code for DNN4?
The DotNetNuke team ships a module generator that plugs into Visual Studio 2005. It is called a Starter Kit and generates a project that you can use to build your module. It makes a complete 'do nothing' module that is a fine starting point. However, it doesn't target the database table you've created or help you with any code specific to the layout of your module. It creates the files and sets up the namespace. That's fine--I'll not look a gift horse in the mouth, but it is a pale reflection of what could be done for DNN3.
The Starter Kit also only generates VB.Net code. I've written modules in both C# and VB.Net, and I've found that I often have some outside reason for using one language or the other (like porting some existing code from another project of mine to DNN). I'd prefer to have an option of the language that I can use.
So what have I found?
I have found a couple of useful starting points for DNN 4 module creation.
So far, the Quizical's solution seems to be the best. It doesn't create a project/solution file but it does create the SQL table creation scripts and some reasonable VB.Net starter code which is more specific than the Starter Kit initial files.
Has anyone used DNN KickStart (a module generator on Snowcovered)?
Have you seen another DNN 4 module generator that I should look at?
If so, leave a comment!