NetTiers Code Generation Cycle

December 27, 2007

Code generation is the biggest disadvantage to running an application on NetTiers.  The code generation cycle is a bit long and unnecessarily complicated.  It would be much easier to generate the framework code when the database updates via a simple one click apparatus (or a few word command) as done with Rails.**

Each time the database model updates, you must re-generate the framework for your application.  NetTiers provides a strong types/objects from tables in your database, so when your database changes, the code will change as well.  Running through five or six clicks and generating code guaranteed to work is much better than hand coding changes to three or four individual layers (unless you are billing a client and bill by how many keys you press per hour).

These instructions apply after you have setup your initial project.  [This will be a separate post … someday.  Email jasonhoekstra@gmail.com and send a letter of encouragement.]

0.)  You must have CodeSmith 4.0 or higher installed.  (I’m using 4.1 for this post.)
1.)  Open NetTiers.Cst (mine is located in C:\NetTiers_2.2\NetTiers.Cst).  Double clicking on a .cst file will open the CodeSmith engine.  (I drop an icon on my Quick Launch bar that shortcuts to NetTiers.cst.)
2.)  Open the configuration file for the project.  TJ, for BuddyBetter, I open C:\Projects\WCF\Products\BuddyBetter\BuddyBetter.csp.
3.)  Make sure that Visual Studio has closed the solution, otherwise, you’ll have to answer to five or six new project notifications.
4.)  Hit the Generate button.
5.)  A web page summary will pop up.  Scroll to the error count.  Make sure it is zero.
6.)  Reload the project file in Visual Studio.  Go back to work with your changes.

2 Responses to “NetTiers Code Generation Cycle”

  1. tjmule Says:

    Crap. this is a lot easier than i thought it would be. I sorta suspected it was in the .csp file but when I double clicked on that file directly, i got a weird dialog box. anyways, all is good. thanks!


  2. Yeah, code re-generation is one of my most unfavorite tasks when using NetTiers (it’s a small price to pay for the huge benefit of the framework and generated objects).

    The [Ruby on] Rails folks have simple commands that help generate their framework. We need to get the same on the NetTiers side. Sometime this month, I’ll try to come up with a batch file that will automate the whole thing. After that, perhaps it would be great to create a VS plug-in that wraps that batch file in a simple button to press in the IDE. Both of these things, if/when created, will be posted back here for the community to utilize as well.


Leave a comment