Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Eric J. Smith's Weblog

CodeSmith, .NET, etc...

  • More votes for CodeSmith

    I'd like to second this - CodeSmith is shaping up to be a huge timesaver in the group I work in. The code templates are pretty intuitive once you realize that they're basically just like inline ASPX code, so if you've hacked inline ASP for years you'll be right at home.
    ...
    This is an amazing product. It paid back our time investment quickly, and with huge dividends.
     
    First of all, thanks for the glowing review!
     
    I'm not sure if you know this or not, but CodeSmith does not constrain you to inline code.  You can do one of two things:
     
    1. Include a Src attribute in your CodeTemplate directive.  When this attribute is specified, just like in ASP.NET, it will dynamically compile the source file into the same assembly as the template code.  You will also need to specify the Inherits attribute to have your template derive from a class in the source file.
     
    2. Create your base template class in Visual Studio.NET and compile it to a .dll.  Then using an Assembly directive add a reference to this .dll.  You may then specify an Inherits attribute in the CodeTemplate directive to inherit from a class in the assembly or just make use of any other class in the assembly within your template code.  You can also use an Imports directive to avoid having to type fully qualified type names.
     
    Basically, CodeSmith tries to resemble ASP.NET as much as possible.  And, with the glaring exception of the equivalent of server controls and data binding, it does a pretty good job of this.

  • CodeSmith Legal Update

    RedRiver and I have agreed to terms and now I just need to go get my signature notarized on the contract.  I believe that we could see a new CodeSmith release by this weekend.

  • Typed DataSet's vs. Custom Collections

    I have been reading the blog entries (here, here) lately about Typed DataSets and it makes me wonder if anyone has really sat down and compared the performance of a custom object/collection (using a data reader to populate) to a Typed DataSet?  Performance was critical to us so we decided to go the custom collection route and we were very happy with the results, but we never actually sat down and figured out what the performance difference was.  We assumed that considering all the bells and whistles that are associated with DataSets that custom collections would be a major performance win.  And since we were using CodeSmith to generate those custom collections, it wasn't any more work to use them.  Does anyone know of any benchmarks that I could look at?

  • CodeSmith Takes Over For CollectionGen

    http://www.sellsbrothers.com/As of today, the functionality of CollectionGen has been sucked into Eric Smith's CodeSmith. I asked Eric to take on these features because CodeSmith does all of what CollectionGen does and more. All new feature requests/bug reports should go his way. Of course, feel free to continue to use CollectionGen as a model for VS.NET Custom Tools.

    Posted by Chris Sells on Mon, May 5, 2003 @ 10:31AM

  • Next CodeSmith Release Ready

    Here is a list of the changes for the next version of CodeSmith. It is ready to release now, but I am not legally able to release a new version until ownership has been transferred to me from RedRiver Systems. So far I have $100 of ~$300 (this is the revised estimate after speaking in detail with several lawyers) needed for lawyer fees to make the transfer happen.

    • Removed expiration.
    • Added CodeSmithConsole.exe to enable processing a .xml property file from the command line. (CSharpCodeGeneratorSample and VBCodeGeneratorSample folders)
    • Created installer.
    • Added a Visual Basic Code Generator Sample (VBCodeGeneratorSample).
    • Added a designer for the DatabaseSchema object.
    • Added Owner property to TableSchema, ViewSchema, and CommandSchema and fixed bug relating to tables, stored procedures and views were assuming dbo as an owner.
    • Fixed problem where SchemaExplorer would fail if collation was different from the master database.
    • Added view support to SchemaExplorer.
    • Fixed problem with SQL7 compatibility and column descriptions.
    • Updated CollectionGen templates from the latest CollectionGen release.
    • Changed to a build system instead of going on and on forever with beta builds.
    • Dropped support for Visual Studio .NET 2002. The Visual Studio features will only work with the final release of Visual Studio .NET 2003.
    • Dropped RedRiver from all namespaces. If you have templates that refer to RedRiver, you will need to update them.
    If you would like to see these new features/changes released, please help support CodeSmith by clicking on the image below and making a donation. All donations are appreciated!

  • Inside the new ValidateRequest feature

    Great, but my point  is still valid,  this break the rules.

    Because I think about production environment. Because I talk about sites went live since few months, and suddenly a new rule come without any publicity, and change the rules, creating errors.

    This is what I call a very bad mistake to implement a new rule which break your code.

    I would prefer to have this feature having a false value by default, and some strong recomendations by .Net team to turn it on rather than now having to check every single page.

  • Code Generation Network

    Many people have pointed out the existance of the Code Generation Network.  This looks like a very nice site and has a big list of code generation tools.  While browsing through it, I found a link to this interview of Dave Thomas.  I agree with a lot of what he has to say.  Until recently, CodeSmith has been a "smelly" code generation tool since it didn't have a lot of support for active generation, but with the recent addition of the VS.NET code generator it can now be used as an active generator.  I also have plans to add command line support and, thanks to a great suggestion by Duncan Godwin, I have also added a Nant build task to my TODO list.  As soon as I can get CodeSmith legally transfered to me, I will be able to start working on these ideas.  I truely believe that CodeSmith has the best template based code generation engine out of everything I have looked at and if I get to work adding more active generation support it will truely be a very powerful tool.

  • CodeSmith

    I have started to look at using codesmith for a project I am working on and so far I am very impressed with the tool. (Eric , the code smith himself, is looking for some legal aid if you are so qualified/inclined.) There are a couple of things that I am trying to figure out how to incorporate into the generation process, and as far as I can tell they are not there yet.