What’s coming in LightSpeed 1.2

With LightSpeed 1.1 freshly baked we have been working away hard on the next release for your coding pleasure. Previously we have been rather tight lipped about the upcoming additions and changes however as we move to tighter release cycles we believe it’s important to keep people up to date on our changes.

Lazy Loaded Values

Previous versions of LightSpeed supported both eager and lazy loaded associations (lazy by default) however in LightSpeed 1.2 you’ll also be able to mark up a simple field or _ValueObject_ as being lazy by default.

Lazy loaded simple field:

[EagerLoad(AggregateName = "Detail")]
private byte[] _data;

Lazy loaded value object example:

[ValueObject]
[EagerLoad(AggregateName = "Detail")]
private Resolution _resolution;

We integrated this new functionality into our _Named Aggregate_ system which is why the aggregate names are specified. The fields above are now lazy-loaded unless we explicitly request the “Detail” aggregate.

Tidier properties

We’ve made some progress on reducing the code footprint of properties by removing the need to specify the name of the property in your entity classes. This resolves the issue of renaming the property and forgetting to update the string name of the property being passed to the Set() method, not to mention reducing the amount of code you need to maintain which is always a good thing!

LightSpeed 1.1 property example:

public DateTime AddedOn
{
  get { return _addedOn; }
  set { Set(ref _addedOn, value, "AddedOn"); }
}

LightSpeed 1.2 property example:

public DateTime AddedOn
{
  get { return _addedOn; }
  set { Set(ref _addedOn, value); }
}

Big thanks goes to John Rusk who provided some of the thinking around how this change could be implemented.

Projections

We now provide some simple support for projections like so:

Query query = new Query(typeof(Contribution));
query.Order = Order.By("Title");
query.Page = Page.At(3, 5);
query.Projection.Add("Id");
query.Projection.Add("Description");
 
using (IDataReader reader = Repository.Project(query))
{
  // work with Id and Description
}

Auto-increment identities for PostgreSQL, MySQL & SQLite

Previously LightSpeed only supported auto-incrementing identities for SQL Server however we’ve extended this functionality to PostgreSQL, MySQL and SQLite for developers working with those databases. We still suggest that developers should use other identity generation methods as highlighted in this earlier post about how LightSpeed handles identity generation.

Try it now?

Most of these additions are already available in the nightly builds of LightSpeed. If you’re interested in trying a nightly build I suggest that you read our previous post about the availability of nightly builds.

Feedback?

LightSpeed is upgraded and changed based on the feedback that we get from our users. If there is something you think would make LightSpeed better or you would simply like some more information then drop a comment as feedback on this post.

John-Daniel

Tagged as LightSpeed

2 Responses to “What’s coming in LightSpeed 1.2”

  • John-Daniel

    I’m interested in the implementation that you’ve used to support the Tidier Property Setters. I’ve used another ORM (XPO) that supported the same short-hand syntax but they have recommended against using this approach as they ran into problems with their algorithm that analysed the call stack to find the property being used “because the .NET 2 compiler employs improved mechanisms of inlining method calls.” See http://community.devexpress.com/blogs/xpo/archive/2007/02/01/701.aspx for the details.

    Are you aware of such issues and will your implementation avoid these kinds of pitfalls? Also is the 1.2 version just as performant as the 1.1 version?

    Thanks
    Carel

  • Hi Carel,

    We’re not using the call-stack based approach for the reasons you state.

    With respect to performance 1.2 should be on par with 1.1 – There have been few, if any, changes to performance critical sections of the code. Additionally, the additional lazy loading features in 1.2 offer more potential performance improvements to the application developer.

    Cheers,

    Andrew.

  • Leave a Reply

Archives

Join our mailer

You should join our newsletter! Sent monthly:

Back to Top