Saturday, July 14, 2007

Some of our exploratory work for EntitySpaces 2008 has led us to consider releasing our own pure ASP.NET code generation system, after all, ASP.NET pages are basically templates in that they allow you to toggle in and out of literal content and C# or VB.NET code. We have a prototype of this working already in-house. The UI in the prototype shown below is real and is served up via MyMeta of MyGeneration. The master template also calls a series of sub-templates to generate the mock EntitySpaces classes.

If you are an EntitySpaces fan you will recognize this screen, however, it is now a web page. The "Generate" button executes any number of sub-templates implemented as user controls or ASCX files. Sub-templates are quite simple to implement. Here is a sample of our mock esEntity.ascx page. 


<%@ Control Language="C#" AutoEventWireup="true"%>
<%@ Import Namespace = "MyMeta" %>

<%
//-----------------------------------------------------
// Gotta love it, full intellisense and you can debug
// your templates like a normal web site
//-----------------------------------------------------

MyMeta.dbRoot MyMeta = (MyMeta.dbRoot)this.input["MyMeta"];
table = (ITable)this.input["ITable"];
%>
public class <%=table.Name%>
{
<%foreach (IColumn col in table.Columns) {%>
public <%=col.LanguageType%> <%=col.Name%> { get; set; } <%}%>
}


This generates a simple mock class.

public class Categories
{
    public int CategoryID { get; set; }
    public string CategoryName { get; set; }
    public string Description { get; set; }
    public byte[] Picture { get; set; }
}

There are some real advantages to this approach. The first major advantage to this approach is the built in Intellisense both for MyMeta and for all of your other .NET namespaces as well. The second advantage is the ease of debugging. All you need to do is click the green arrow while in Visual Studio or Visual Web Developer 2005 Express Edition and you're debugging. You do not need to have IIS installed on your machine to use it either. Finally, you could even host this new code generation system on a server on your network and all of your development team could access it there.

EntitySpaces LLC is soon going to be opening up to facilitate 3rd party enhancements. We are going to be publishing the source code for one of our data providers as an example. This will allow 3rd party's to create data providers for database systems not currently supported by EntitySpaces, we will also supply guidelines for direction as well. We are also going to be opening up a template sharing area that will allow our customers to publish templates for the EntitySpaces architecture.

This new ASP.NET generation system (as yet unnamed) would also make it very easy for EntitySpaces developers to tweak templates and create and publish their own thus helping foster a wider reaching community. We really like the idea of this ASP.NET generator, it's so easy to use and debug. However, we need your feedback, please post your comments on this Thread in our forums.

EntitySpaces

From mobile devices to large scale enterprise solutions in need of serious transaction support, EntitySpaces can meet your needs. Whether you’re writing an ASP.NET application with medium trust requirements, or a Windows.Forms application, the EntitySpaces architecture is there for you. EntitySpaces is provider independent, which means that you can run the same binary code against any of the supported databases. EntitySpaces is available in both C# and VB.NET. EntitySpaces uses no reflection, no XML files, and sports a tiny foot print of less than 200k. Pound for pound, EntitySpaces is one tough, dependable .NET architecture.

The EntitySpaces Team
--

EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net