Wednesday, September 17, 2008



EntitySpaces has teamed up with Justin Greenwood (shown left) of MyGeneration Software to create a brand new code generation engine for EntitySpaces 2009. Because of Justin's code generation expertise we contacted Justin and asked him to create a very simple, lightweight code generation engine whose only job is to execute templates. (There is no user interface support by design.) The code generation engine makes the EntitySpaces MetdataEngine available as an intrinsic object available to all templates through the "esMeta" property. We already have a working version of the code generation engine and thought we would share our progress with you.

We have created a test form that invokes the code generation engine for testing. Here is the button click event that kicks the whole thing off.

using EntitySpaces.MetadataEngine;
using EntitySpaces.CodeGenerator;

namespace Test
{
    public partial class Form1 : Form
    {
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            EntitySpaces.MetadataEngine.Root esMeta = new EntitySpaces.MetadataEngine.Root();
            esMeta.Connect("SQL", this.txtConnectionString.Text); // I'm Connection to Northwind
            esMeta.LanguageMappingFileName = @"esLanguages.xml";
            esMeta.UserMetaDataFileName = @"esUserData.xml";
            esMeta.esPlugInSettingsFileName = @"esSettings.xml";
            esMeta.Language = "C#";

            Template template = new Template();
            template.Execute(esMeta, "Master.est");

        }
    }
}

Master Template

Here is what the "Master.est" template looks like. In the code above the connection string was set to the Microsoft SQL Northwind database and we have hard-coded the "Employees" table in the master template shown below.

image 

Sub Template

Notice in the code above we execute a sub template named "Sub.est" and append it's output to our currently running template. We also show how you can have separate "pure code blocks" via the <script> tag. Below is the Sub.est template which is passed the "esMeta" object from the Master template and then runs through all of the columns in the Orders table.

image

The Output

The output from the execution of the master template looks like this:

    EmployeeID
    LastName
    FirstName
    Title
    TitleOfCourtesy
    BirthDate
    HireDate
    Address
    City
    Region
    PostalCode
    Country
    HomePhone
    Extension
    Photo
    Notes
    ReportsTo
    PhotoPath

<START|-|Wow, very cool|-|END>

--> Sub.est

    OrderID
    CustomerID
    EmployeeID
    OrderDate
    RequiredDate
    ShippedDate
    ShipVia
    Freight
    ShipName
    ShipAddress
    ShipCity
    ShipRegion
    ShipPostalCode
    ShipCountry

Summary

At this point we have everything in place to provide a Beta version of EntitySpaces 2009 in a very short time frame. By having this all in house our code generation will be extremely easy for EntitySpaces 2009 and will not rely on third party tools. This also allows for our new code snippet model where a template is nothing more than a collection of code snippets which can be tweaked and replaced by our customers.

Take a look at this mock master template.

image

All the master does is execute a set of sub templates that make up, for example, the single esEntity object. Now imagine a very cool UI that allows you to manage, edit, and customize these snippets and replace or tweak our properties, INotify support, or just add other methods and properties to your entities. And the best thing is you will not need to be a code generation expert, not by a long shot. We are very excited about EntitySpaces 2009. This is only a part of what is coming in 2009. Domain modeling and much more are on tap.

For more on EntitySpaces 2009 take a look at our roadmap HERE.

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, a Mono application, 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

posted on Wednesday, September 17, 2008 2:46:31 PM (Eastern Standard Time, UTC-05:00)  #   
 Sunday, September 14, 2008

We are pleased to announce that the official EntitySpaces 2008 0915 release is now available for download. This will be the final EntitySpaces 2008 release. Work is already underway on EntitySpaces 2009 and we will make a blog post filling you in on the some of details very shortly.

New Features, Fixes, Enhancements

  1. Major Performance Improvements which all users will realize. See this blog post.
  2. The VistaDB provider now supports NEWID() and GUID() on inserts.
  3. IsDirty logic improvements (see below).

    Employees emp = new Employees();
    if (emp.LoadByPrimaryKey(1))
    {
        // At this point LastName = "'Smith"

        emp.LastName = "Crazy"; // emp.es.IsDirty = true
        emp.LastName = "Smith"; // emp.es.IsDirty = false
    }

  4. Added ExecuteReader and ExecuteScalar to the esDynamicQuery class. See this blog post. This can be very useful for retrieving large results sets for display purposes.
  5. Fixed the exception handling in FillDataTable and FillDataSet.
  6. Add Oracle FLOAT support.
  7. Added GetConnectionName() to allow classes to be configured to use a predefined connection string. See this blog post.
  8. Fixed the AcceptChanges/RejectChanges logic such that it always clears the ModifiedColumns.

 

We will be publishing a new Trial Version later on this evening for the 0915 release.

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, a Mono application, 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

posted on Sunday, September 14, 2008 11:58:32 AM (Eastern Standard Time, UTC-05:00)  #   
 Saturday, September 13, 2008

We have pushed up what we hope is our final beta for our 2008.1.0912.0 maintenance release. We need you to help us test. If you are able to upgrade your ES2008 application to our final beta, we ask you to do so. We plan on publishing the RTM late Sunday night. You will need to regenerate your classes. There is no trial version of this beta release available. Please report in your findings in our forums, positive or negative.

Thank you

- The EntitySpaces Team

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, a Mono application, 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

posted on Saturday, September 13, 2008 7:08:33 AM (Eastern Standard Time, UTC-05:00)  #   
 Thursday, August 28, 2008
image 

Besides performance enhancements we are adding some much sought after database connection flexibility. The "Generated Master" templates now have a "Connection Name" textbox which if left blank indicates that the generated objects should use the default connection (as they do now). However, by providing a connection name you can generate different sets of objects that target a particular connection in our connection list. In the example on the right we are generating a set of classes that will use the "Capricorn" connection from our config file (or configless setup).

<EntitySpaces>
    <connectionInfo default="Taurus">
        <connections>

            <add name="Taurus"
                providerMetadataKey="esDefault"
                sqlAccessType="DynamicSQL"
                provider="EntitySpaces.SqlClientProvider"
                providerClass="DataProvider"
                connectionString="... Data Source=Taurus;"
                databaseVersion="2005" />

            <add name="Capricorn"
                providerMetadataKey="esDefault"
                sqlAccessType="StoredProcedure"
                provider="EntitySpaces.SqlClientProvider"
                providerClass="DataProvider"
                connectionString=" ... Data Source=Capricorn;"
                databaseVersion="2005" />

        </connections>
    </connectionInfo>
</EntitySpaces>

Notice that "Taurus" is registered as our default connection. However, by providing "Capricorn" in the "Connection Name" edit box during the code generation process we can generate any number of entities that will automatically use the "Capricorn" connection with no extra coding on our part.

We are also adding an additional approach that will be great for ASP.NET developers that need to have different connections on a per user or per client basis. We are adding an Interface that you can implement which will serve up all connection names as EntitySpaces requests them. This will allow you to authenticate a user and store that users connection name such as "Capricorn" in the session (or wherever you choose). Then each time EntitySpaces needs a connection it will ask you for the connection name. You can simply pull the name right out of the session and return it. Using this approach you will be able to serve up connection names in any way you can possibly think of.  This will be available in our next ES2008 maintenance release and we should be pushing up a beta in a few days. We will do another blog post showing how to use provide the Interface and serve up connection names very soon.

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, a Mono application, 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

posted on Thursday, August 28, 2008 8:20:04 PM (Eastern Standard Time, UTC-05:00)  #   
 Sunday, August 24, 2008

There have been quite a few questions about performance lately on our forums, that is, new users coming to our site and asking "How fast is EntitySpaces" or "How does it compare to architecture 'X' " and it's been our plan to do some investigation into this. Then we saw a POST on DotNetKicks regarding SubSonic's performance tests and wondered how EntitySpaces stacked up. We ran some tests and found an issue in that we were creating a needless transaction in some cases when saving single entities. A transaction was blindly being created to cover the case of a hierarchical save. However, we now detect whether or not we have other objects to save, and if not, we don't create a transaction. This really increased our performance along with a few other changes. We also made some performance enhancements in how our collection saves work. Now, it's important to state that you can not get these performance numbers in the current release. However, the performance enhancements have been made and will be in the next maintenance release to be pushed in less than two weeks. The good news is the performance enhancements will be realized no matter what database you are running against.

We decided to take the SubSonic examples from the post above and literally recreate them in the EntitySpaces syntax and do a comparison. The tests were performed on a single computer with SQL 2005 hosting the Northwind database. Both the SubSonic and EntitiySpaces tests were run on the same machine, against the same database, and both using dynamic SQL (and not stored procedures). Here are the tests and timings. We loaded a single entity from the database before the timings began to eliminate any first time startup issues such as assembly loads and configuration file reads.

All times are in mm:ss (minutes and seconds)

Test 1

This test creates an order and an order detail record saving them both. This is done in a loop for a given number of iterations.

Test 1 Results (at different iterations)

     10,000 Iterations     100,000 Iterations   1,000,000 Iterations
EntitySpaces             0:14               2:20               24:10
SubSonic             0:20               3:21               33:21

 

TEST 1 Source













EntitySpaces ==>

// Let's save a million items shall we?
for (int i = 1; i < 1000000; i++)
{
    Orders o = new Orders();
    o.CustomerID = "ALFKI";
    o.EmployeeID = 5;
    o.Freight = 10;
    o.OrderDate = DateTime.Now;
    o.RequiredDate = DateTime.Now;
    o.ShipAddress = "Somwhere, Someday";
    o.ShipCity = "City";
    o.ShipCountry = "US";
    o.ShipName = "Shipper";
    o.ShippedDate = DateTime.Now;
    o.ShipPostalCode = "99999";
    o.ShipRegion = "KS";

    o.Save();

    //OrderDetail detail = new OrderDetail();
    OrderDetails detail = new OrderDetails();
    detail.OrderID = o.OrderID;
    detail.ProductID = 13;
    detail.Quantity = 1;
    detail.UnitPrice = 100;

    detail.Save();
}









SubSonic ==>

// Let's save a million items shall we?
for (int i = 1; i < 1000000; i++)
{
    Order o = new Order();
    o.CustomerID = "ALFKI";
    o.EmployeeID = 5;
    o.Freight = 10;
    o.OrderDate = DateTime.Now;
    o.RequiredDate = DateTime.Now;
    o.ShipAddress = "Somwhere, Someday";
    o.ShipCity = "City";
    o.ShipCountry = "US";
    o.ShipName = "Shipper";
    o.ShippedDate = DateTime.Now;
    o.ShipPostalCode = "99999";
    o.ShipRegion = "KS";

    o.Save("me");

    OrderDetail detail = new OrderDetail();
    detail.OrderID = o.OrderID;
    detail.ProductID = 13;
    detail.Quantity = 1;
    detail.UnitPrice = 100;

    detail.Save("me");
}

 

Note that on the above test at 1 million iterations with 2 inserts per iteration EntitySpaces was inserting 1,379 records per second.

2,000,000 (inserts) / 1,450 (seconds) = 1,379 (inserts per second)

 

Test 2

This test loops through a million objects loading them one by one using the single entity class.
We are reading a million records with ids 7080773 through 8080773.

Test 2 Results

                          1,000,000 Entity Reads
EntitySpaces                                       6:18
SubSonic                                       7:05

 

TEST 2 Source



EntitySpaces ==>

for (int i = 7080773; i < 8080773; i++)
{
    Orders o = new Orders();
    o.LoadByPrimaryKey(i);
}


SubSonic ==>

for (int i = 7080773; i < 8080773; i++)
{
    Order o = new Order(i);
}

 

Test 3

This test loops through a million objects loading them 10 at a time into a collection class.
We are reading a million records with ids 7080773 through 8080773.

Test 3 Results

                          1,000,000 Collection Reads
EntitySpaces                                        08:53
SubSonic                                        13:47

 

TEST 3 Source



EntitySpaces ==>

for (int i = 7080773; i < 8080773; i++)
{
    int nextTen = i + 10;

    OrdersCollection oc = new OrdersCollection();
    oc.Query.Where(oc.Query.OrderID.Between(i, nextTen));
    oc.Query.Load();
}


SubSonic ==>

for (int i = 7080773; i < 8080773; i++)
{
    int nextTen = i + 10;
    OrderCollection coll = new Select().From<Order>().Where("orderid")
        .IsBetweenAnd(i, nextTen).ExecuteAsCollection<OrderCollection>();
}

 

EntitySpaces has always stacked up well in reports sent to us by users and upon our next release our customers will have even better performance. We have also added the ability to turn our Dynamic Query's into DataReaders for even higher performance in certain scenarios as outlined in this blog post. We know it's controversial to publish performance results but we believe we have treated each architecture fairly and will publish the testing harness when we publish our next ES2008 maintenance release. SubSonic, NHibernate, and other architectures are fine architectures, this post was merely to head off the inevitable questions heading our way.

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, a Mono application, 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

posted on Sunday, August 24, 2008 10:31:57 AM (Eastern Standard Time, UTC-05:00)  #   
 Monday, August 18, 2008

We thought we'd tell you about two nice enhancements to our DynamicQuery API. We added two new methods to the esDynamicQuery class, ExecuteScalar and ExecuteReader. These will be available in our next ES2008 maintenance release when it comes out.

ExecuteScalar:

This query simply fetches the total table count. Of course, I could have used a Where clause to reduce it to a certain set of records.

EmployeesQuery query = new EmployeesQuery();
query.es.CountAll = true;
int count = (int)query.ExecuteScalar();

ExecuteReader:

This query selects the FirstName and LastName columns where the LastName is like "Gri%" and then gets an IDataReader on the result set.

EmployeesQuery query = new EmployeesQuery();
query.Select(query.FirstName, query.LastName);
query.Where(query.LastName.Like("Gri%"));

using (IDataReader reader = query.ExecuteReader())
{
    while (reader.Read())
    {
        string s = reader.GetString(0);
    }
}

Notice that neither of these approaches is used to populate a collection or an entity. This is similar to the already existing Query.LoadDataTable() method.

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, a Mono application, 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

posted on Monday, August 18, 2008 8:30:58 PM (Eastern Standard Time, UTC-05:00)  #   
 Saturday, August 16, 2008

EntitySpaces 2009 Q1 is all about streamlining our code generation process.  We are creating our own code generation engine, just as we created our own metadata engine for the ES2008 release. Having our own code generation engine will allow us to break our reliance on third party code generators and eliminate needless complexities thereby improving usability for our customers. This will allow us to have our own project files of pre recorded template settings for playback. Additionally, we will provide a totally new approach for declaring template user interfaces. All of these enhancements focus on one of our main goals for EntitySpaces 2009 Q1 … simplification of the code generation process. However, there are more enhancements.

Visual Studio 2008 users will be pleased to know that we will provide a Visual Studio 2008 Shell version with ES2009. The Visual Studio Shell is part of the new Visual Studio Extensibility (VSE) system. Visual Studio 2008 users will never need to leave Visual Studio when using EntitySpaces. We will also provide a very nice command line application that will allow you to regenerate your code during your build processes’, including continuous integration builds. The command line application will be able to take code generation project files on the command line as arguments. If you are feeling left out because you do not use Visual Studio 2008, or are using one of the Express versions, you are not going to be left behind. We will also provide a stand-alone Windows Forms application to handle template execution and code generation. The stand alone Windows form application may be written so that it will run under Mono as well (still in debate).


image

 

Furthermore, we will be adding support for SQLite, which we feel is important in order to open even more mobile markets for our customers. We have very good Windows .NET Compact Framework support. We also plan to add support for IBM’s DB2 database engine. Our SQLite support will most likely come before the IBM DB2 support. Finally, we will be adding a Domain Modeler that will allow users to completely customize their domain modal. However, EntitySpaces will not require any XML files, nor use reflection for this purpose as other ORM systems often use.

This is an aggressive feature set. Not all of the features mentioned above will be available in the ES2009 Q1 release. Not covered in this post are changes planned for the architecture itself, those will follow in another post. Our plan is to have an ES2009 beta out near the end of 2008.

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, a Mono application, 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

posted on Saturday, August 16, 2008 7:38:37 PM (Eastern Standard Time, UTC-05:00)  #   
 Sunday, August 10, 2008
Download the Trial version

EntitySpaces 2008 was originally released on June 23rd and it has proven to be very solid, as have our past releases. We decided to put out a maintenance release to make some minor tweaks we have made available. We have also upgraded the ASPX Admin Suite to run under ES2008. The ASPX Admin suite is only available under MyGeneration as the UI technique it uses is not compatible with CodeSmith. You can install this release right over the top of your current ES2008 installation.

 

  • Upgraded our C# and VB.NET Web ASPX Admin Grid templates for ES2008 (MyGeneration Only).
  • Fixed Oracle SEQ double-quotes in MyGeneration VB Metadata and MetadataMap templates.
  • Add support for Oracle FLOAT data type.
  • We no longer use the deprecated Oracle Precision and Scale in parameters for NUMERIC data types.
  • Fixed a casting issue for esDataSource TotalRowCount with MySQL and Oracle.
  • Add Property Changed Notification to all four hierarchical properties.
  • Fixed exception handling in FillDataTable and FillDataSet for all providers.
  • Updated template UI and "Getting Started" PDFs to state framework requirements for LinqToSql(3.5) and WCF(3.0) options.

 

The Trial version is available as well for 2008.1.0811.

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, a Mono application, 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

posted on Sunday, August 10, 2008 9:08:24 PM (Eastern Standard Time, UTC-05:00)  #