Browse by Tags

To “as” or not to “as”
Sun, Aug 12 2012 13:37
Iris Classon is asking and finding answers for “stupid” questions on her blog. First of all, they are definitely not stupid questions. There are a lot of nuances of .NET that slip out of our daily thinking. When I first started my Getting Geeky with the .NET Framework series I’d ask really hot coders basic questions – things that affect... Read More...
by Kathleen | 5 comment(s)
Filed under: , ,
Open Source
Wed, Feb 13 2008 9:31
It’s occurred to me that if you are following this and my DNR TV show a logical reaction would be “OK, so that’s a lot of hot air, where do I get it?” I intend for all of this to be released Open Source, on whichever site s hot when I release it. I hope I’ll start releasing pieces in just a matter of weeks. It will help a lot if it becomes “we” instead of “me... Read More...
Isolating Metadata
Wed, Feb 13 2008 9:26
In code generation, metadata is the information about your application, generally about your database and definitions to express your data as business objects. If you use Entity Framework, your metadata is the edmx file which is displayed via the designers. If you’re using CodeSmith, the metadata is more subtle. Metadata can also be about the process itself.... Read More...
CurrentTypeInfo and the Context Stack
Tue, Feb 12 2008 9:46
Creating templates requires a lot of access to the thing you’re currently creating. That’s the current output type, which as I discussed in yesterday I suffix with “Info.” The CurrentTypeInfo is thus what you’re currently outputting. I neglected to clarify in that post that the Data and the Info classes are in entirely different assemblies. The Data classes could... Read More...
Two Parallel Entities - Metadata and Info
Mon, Feb 11 2008 11:08
One of the confusing things about templating is that you are writing two programs simultaneously and there is no way around it. My brilliant son may write a templating language for a class project, and this is exactly what he wants to address – that and the issue of escaping. You can’t avoid it, he just thinks they should look different – I’m hoping he doesn... Read More...
Inheritance and Templates
Mon, Feb 11 2008 10:25
One of the most valuable things about templates written in .NET code of any style is the ability to use inheritance. This is classic inheritance where local state allows you to push functionality into base class methods that would become cumbersome and have excess dependencies if treated as external utility methods. Inheritance also allows polymorphism, which... Read More...
.NET Template Organization
Sun, Feb 10 2008 17:55
So, now that you know where I’m going with this – language neutral templates – I want to step back to the basics. Even if you don’t want to build language neutral templates, there are things to learn along the way about making good XML literal templates, and why this approach might be better than your current code gen mechanism. Note, the examples in this post... Read More...
The Punch Line
Sun, Feb 10 2008 17:21
I mentioned a few days ago that there was a punch line for the XML Literal Code Generation. I planned to unveil this slowly, but it just sprung out of the box when Carl posted episode #102 (which I thought was due for next Friday. And I’m afraid that I need to add that I was sick during the taping and my brain running at half capacity. If anything isn’t clear... Read More...
Code for DNR TV # 97 and #98 Sample Code
Sun, Feb 10 2008 17:14
Sometimes I drop the ball and I did on getting these samples posted. Note that this is for the two episodes I did on 3.5 languages. I think these episodes are a good run through of the features in both languages. The title wound up with the word "Compare" in the title. I'm not sure I really compare them, beyond seeing them side by side, which I... Read More...
by Kathleen | with no comments
Filed under: , ,
XML Literal Code Genaration - Code again again
Sun, Feb 10 2008 10:53
Crap. For now, I'm just removing the coloring. Paste this into VS for coloring. It's much prettier: Private Function MemberDataPortalFetch() As String ' TODO: Add special handing for timestamp Return _ <code> Private Overloads Sub DataPortal_Fetch(ByVal criteria As Criteria) Using cn As New SqlConnection(<%= mObjectData.ConnectionStringName... Read More...
XML Literal Code Generation - Code again
Sun, Feb 10 2008 10:32
OK, that code listing got friend on load. Let me try again. Private Function MemberDataPortalFetch() As String Return _ < code > Private Overloads Sub DataPortal_Fetch(ByVal criteria As Criteria) Using cn As New SqlConnection( <%= mObjectData.ConnectionStringName %> ) cn.Open() Using cm As SqlCommand = cn.CreateCommand cm.CommandType = CommandType... Read More...
XML Literal Code Generation
Fri, Feb 8 2008 11:20
You must use VB for XML Literal Code Generation. Sorry, that’s life. I don’t have a crystal ball on this, but for now even if you’re a C# programmer you’ve got to suck it up and use VB. The code you output can be VB or C# however, but the template itself has to be written in VB. If you’re allergic to VB, get shots. So, what does a microcosmic view of a XML literal... Read More...
Let’s Talk Templates
Thu, Feb 7 2008 16:07
Code generation templates have several competing pressures – they need to be easy to use and they need to be powerful. They need to be flexible but encourage best practices. If you ever say “my templates got me started then I had to customize them” you’re templating can be better. I’m not aware of any situation where you can’t isolate the handcrafted code from... Read More...
DNR TV on .NET 3.5 Languages - Part 1 Posted
Fri, Jan 18 2008 13:55
Check out .NET Rocks TV this week for the first of two parts on .NET 3.5 languages - that's right C# 3.0 and VB 9 together. It makes sense since most features cross over, and where they don't you'll want a handle on the differences. Read More...
C# 3.0, VB 9.0 and Anonymous Types
Thu, Nov 22 2007 11:57
Rick Strahl talks about new C# 3.0 features , but leaves a few questions… Why can’t you change the property values instances of anonymous types? The problem is that instance of anonymous types are hashed by hashing all values. Thus, if values could change, all hashes would have to be updated (impossible with the .NET design) or hashes would not match and all... Read More...
by Kathleen | 3 comment(s)
Filed under: , ,