LightSpeed 3.0 Beta Release

I’m pleased to announce the immediate availability of LightSpeed 3.0 Beta 1 to existing LightSpeed customers.

Huge querying enhancements

LightSpeed has undergone a massive overhaul of its internal querying capabilities. With 2.0 we included a LINQ provider that had support for most of the capabilities included in the core LightSpeed querying API. With 3.0 we’ve beefed up both the core querying capabilities and the LINQ API to support grouping, joining, and other such goodness.

Schema migrations support

LightSpeed now has its own Migrations framework! Chances are that if you’re working with a database then you’re having to manage your change scripts so we’ve tried to make this process more manageable.

And it just wouldn’t be a Mindscape product if it didn’t integrate into Visual Studio!

Create LightSpeed Migration

The reason for the integration is because of the great schema round tripping features in the LightSpeed Designer. If you’re making changes to your model then you’ll want to be capturing those changes into a migration to run on various other machines such as Test and Production machines. All you need to do is work as you normally would with the designer and when you’re ready select “Create Migration” from the Migrations menu and we’ll pick up all your changes and give you a choice of what schema changes you’d like to include in the migration.

Create new migration from code changes dialog

When it comes time to deploy you can use the lsmigrate.exe utility to run your migrations when Visual Studio is not available. Alternatively, when you elect to run the migrations you can select the option to generate SQL instead.

Visual Studio Migrations runner dialog

Oh, and the migrations framework works with SQL Server, Oracle, MySQL, PostgreSQL, SQLite, SQL Server CE, VistaDB and DB2! Moving between database engines just got a lot easier!

Designer enhancements

We’ve made a load of improvements and fixes to the LightSpeed designer. In addition to handy ease-of-use features such as making it easier to zoom, importing common attribute namespaces, and copying a picture of your model for use in a Word or PowerPoint document, some of the major features are:

  • Refactoring. You can perform a solution-wide rename of an entity or property, with the option to retain the existing database mapping. You can also have the designer create partial classes and convert generated property implementations to manual ones ready for customisation.
  • XML documentation support for entities, properties and associations.
  • Filtering the designer view. You can choose to view just a particular entity and its associated entities, or a particular subdomain, inheritance hierarchy or aggregate. This reduces the clutter on very large models and makes it easy to locate a particular entity with just a few keystrokes.

We’ve also rounded out support for the full range of LightSpeed modelling capabilities including designer support for through associations and database synchronisation support for inheritance hierarchies, plus a variety of smaller features that we’ll talk about in more detail in a later post.

Better support for legacy databases

Composite key lovers rejoice! LightSpeed now includes support for composite keys across the board – from the designer through to the core framework. This was one of the last remaining constraints that prevented some developers from using LightSpeed with a legacy database they couldn’t alter.

For environments where database access is restricted to stored procedures, LightSpeed also now supports CRUD procedures so you can specify how your entities are loaded and saved using stored procedures.

Testing enhancements

We’ve taken feedback on the testability of LightSpeed models and based improvements in 3.0 off that feedback.

Creating entities for testing has been more frustrating than it should be due to the restrictions on assigning the Id property. To resolve this LightSpeed now provides an EntityFactory class as part of the testing namespace.

Here’s an example of how to create an entity of a given state with a provided Id:

var entity1 = EntityFactory.Create(EntityState.Deleted, 15);
var entity2 = EntityFactory.Create(EntityState.Default, 16);
var entity3 = EntityFactory.Create(EntityState.Modified, 17);
var entity4 = EntityFactory.Create(EntityState.New, 18);

Keep in mind that this is entirely for testing purposes and you should not use this code in your actual solution.

To help use these entities in a testing scenario we also now provide a TestUnitOfWork implementation. This is like mocking out a unit of work to return specified results when a query is run and is especially helpful if you’re not working with the Repository pattern. Each query method (e.g. Find()) has the ability to have the result set for it and therefore allows for testing completely in memory.

We will be pushing out blog posts on this soon + some new screen casts.

Granular change tracking

LightSpeed users have been asking for the ability to inspect that changes made to entities for some time and now they can. Entities now contain a public ChangeTracker. This change tracker can be used to examine what fields have been changed, what the original value was and what the new value is.

Change tracking is disabled by default due to the extra memory weight it can add to each entity however you can easily opt in an entity to be tracked:

  customer.ChangeTracker.TrackingMode = ChangeTrackingMode.ChangesOnly;
  foreach(var change in customer.Changes)
    Console.WriteLine("Property: {0}", change.Name);
    Console.WriteLine("Original value: {0}", change.OriginalValue);
    Console.WriteLine("Modified value: {0}", change.ModifiedValue);

Database provider improvements

Support for SQL Server 2008: LightSpeed now provides first class support for SQL Server 2008 allowing users to leverage new data types such as SqlGeography. Previously developers could re-use the SQL2005 provider when targetting a SQL 2008 database however this didn’t allow for the use of user defined types such as the spatial types.

Support for IBM DB2: Complete designer and core support for DB2 comes out of the box with 3.0.

Support for VistaDB 4.0: VistaDB 4.0 is fresh out of the oven and LightSpeed 3.0 supports this new version along with VistaDB 3.x. This includes our rich designer integration for working with your VistaDB models.

We’ve also made numerous improvements to the other providers to ensure we’re shipping with the latest provider assemblies.

Much much more

This is an absolutely huge release and this blog post could go on for many more pages listing all the enhancements. Over the coming weeks we will be posting more details about all the changes that have been made to help you develop faster and improve the robustness of your solutions.

Where can I get it?

LightSpeed 3 Beta 1 is available to existing customers through the store. Take it for a spin and let us know what you find – we appreciate all the feedback you have!


Join our mailer

You should join our newsletter! Sent monthly:

Back to Top