Leaning Into Windows
Kathleen Dollard's view of life and .NET development
Browse by Tags
All Tags
»
Code Generation
(
RSS
)
.NET
C#
Composition
Design
MEF
Sytem.AddIn
Visual Basic
Plain Old Objects and MEF
Thu, Oct 11 2012 6:08
After my MEF presentation at the Hampton Roads .NET User Group someone asked me about creating objects like customers and invoices via MEF. I gave an overly quick answer to a really good question. A lot of the IoC history involves using dependency injection for services. This is great partly because it's a framework to isolate plain old objects from services...
Read More...
MEF Assembly Granularity
Sun, Mar 15 2009 10:25
I’ve been contemplating how to organize MEF assemblies. I think the processing I did establishing the first cut at organization, and the shake down of that strategy, may be interesting to other people designing MEF systems. As a quick review, MEF lets you throw parts into a MEF container and sort out how parts work together at runtime. Parts are recognized...
Read More...
Another View of Code Generation
Mon, Mar 3 2008 8:12
Karl on WPF posted this on code generators. Karl appears to be largely talking about issues within existing MS code generation tools. The underlying problem, is that Microsoft does not have a code generation group that understands code generation from an application perspective and acts as a core resource to demand standard metadata, force Visual Studio support...
Read More...
Rethinking “Nearly VB”
Thu, Feb 28 2008 9:56
Bill McCarthy added a comment to my blog which I wanted to answer: So why not use VB for the templates but C# for the initial output rather than some "Nearly VB" . Doesn't C# address every issue you've raised ? But I am curious as to what about issues that are language specific, such as declarative event wiring, optional parameters etc ? C#...
Read More...
Template Languages and "Nearly VB"
Mon, Feb 25 2008 8:12
The templates I’ve been talking about require very specific language features of the VB compiler and language neutral templates do not allow any ambiguity in the code output in the initial template. The template itself must be in VB because it’s required for embedded XML – the code blocks. The code blocks are essential for understanding which code to translate...
Read More...
Validation Information in Metadata
Tue, Feb 19 2008 8:17
Mike asks: Just curious if your metadata also contains validation rules or not? Things like property is required or range of valid values. It could include them in three possible ways – it currently uses one and I’ve had two others working in the past that may be resurrected. The metadata that the database inherently knows is automatically transferred - this...
Read More...
Runtime vs. Design/Compile Time
Thu, Feb 14 2008 11:21
Chris asks: At what point with code gen / templating do you start to think about doing all this codegen at runtime instead of compile time? And if we were to be doing it at runtime would be be better served by using a dynamic language such as ruby to program in? That's a good point. In a perfect world, there would be no need for code generation. We would...
Read More...
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...
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...
Why You Care About System.AddIn
Thu, Jan 3 2008 13:31
When I was fighting with AppDomains to support XML Linq code generation in my new Workflow based code generator, Bill McCarthy said “Hey did you look at System.AddIn” and I said “No, silly I’m not writing add-ins.” Well, a few months later, I’m still trying to make it work, and have come to think it’s worth the trouble. So, first, what System.AddIn namespace...
Read More...
What? No Code?!?
Sun, Oct 28 2007 16:26
When I say things like “writing code bad, other stuff good” it comes out sounding radical and there a couple natural points of pushback. The most significant one is “yeah right, we put our business information in something else and that changes too - so we’re trapped forever in technology and like being addicted to food we just can’t stop” Let’s nip this in the...
Read More...
More Posts
Next page »
Search
Go
This Blog
Home
Contact
Tags
.NET
.NET 4.5
Among Bytes
C#
Code Generation
Composition
Design
General
Language Embedded DSL
MEF
MVC 3
Personal
Roslyn
Silverlight
Sytem.AddIn
T4
Visual Basic
Visual Studio 2012
Visual Studio Tricks
Women in Tech
Workflow
Community
Home
Blogs
Media
Groups
Archives
May 2013 (2)
April 2013 (1)
March 2013 (2)
December 2012 (1)
November 2012 (3)
October 2012 (1)
September 2012 (1)
August 2012 (3)
July 2012 (2)
June 2012 (2)
May 2012 (1)
April 2012 (1)
March 2012 (2)
February 2012 (2)
July 2011 (2)
March 2011 (6)
November 2010 (2)
April 2010 (1)
March 2010 (3)
February 2010 (2)
December 2009 (2)
November 2009 (1)
October 2009 (1)
September 2009 (2)
August 2009 (1)
July 2009 (3)
June 2009 (1)
May 2009 (1)
April 2009 (1)
March 2009 (11)
February 2009 (3)
January 2009 (6)
December 2008 (3)
November 2008 (3)
October 2008 (1)
September 2008 (4)
August 2008 (4)
July 2008 (3)
June 2008 (4)
May 2008 (2)
April 2008 (2)
March 2008 (3)
February 2008 (24)
January 2008 (9)
December 2007 (4)
November 2007 (13)
October 2007 (7)
September 2007 (1)
Syndication
RSS for Posts
Atom
RSS for Comments
Email Notifications
Go
News
Check out www.gendotnet.com for my speaking schedule