LightSpeed 1.2 Released
We’re pleased to announce the release of LightSpeed 1.2. This is a major update and includes many new features, tools, optimizations and fixes to hopefully make your LightSpeed development experience easier and even more enjoyable! Here are the highlights and keep reading for a sneak peak of what’s coming in LightSpeed 2.0
h3. Property Name Inference
For performance reasons and ease of debugging (as well as our own general penchant for simplicity) LightSpeed forgoes the use of dynamic proxies. Before 1.2 this meant that you would have to specify property names inside getters and setters so that the framework could keep track of property changes. However, after some help from one of New Zealand’s smartest devs, we now have an approach that means the string property names are no longer required.
Before the code looked like this:
public string Surname { get { return _surname; } set { Set(ref _surname, value, "Surname"); } }
Now it just looks like this:
public string Surname { get { return _surname; } set { Set(ref _surname, value); } }
We still expose an overload that takes a property name which can be used from code gen and will be slightly faster than omitting the property name.
h3. Value Object Lazy Loading
LightSpeed now supports lazy-loading value objects (in LightSpeed a value object is either a simple value type field or a field decorated with the _ValueObject_ attribute). This is particularly useful for blob attributes or other expensive or infrequently accessed fields. We implemented this by integrating into our _Named Aggregate_ system like so:
public class Contribution : Entity<int> { [EagerLoad(AggregateName = "ContributionDetail")] public byte[] _data; public byte[] Data { get { return Get(ref _data); } set { Set(ref _data, value); } } }
By applying the _EagerLoad_ attribute with a _Named Aggregate_ we’re effectively making the field lazy (unless, of course, we specify the aggregate name as part of our query). Additionally, note the use of the _Get_ method in the property getter. This ensures that the field will be lazy loaded on first request.
h3. One-to-One Associations
By popular demand 1.2 includes support for one-to-one associations. We spent a bit of time getting this to work without any API changes and so we simply end up with our standard ValueHolder pattern:
public sealed class Car : Entity<int> { private readonly EntityHolder<Engine> _engine = new EntityHolder<Engine>(); public Engine Engine { get { return Get(_engine); } set { Set(_engine, value); } } } public sealed class Engine : Entity<int> { private int? _carId; private readonly EntityHolder<Car> _car = new EntityHolder<Car>(); public int? CarId { get { return Get(ref _carId); } set { Set(ref _carId, value); } } public Car Car { get { return Get(_car); } set { Set(_car, value); } } }
h3. More Mapping Options
We’ve included a couple of new attributes that provide more fine-grained control over class to table mapping. _TableAttribute_ and _ColumnAttribute_ allow custom table and column names to be specified respectively, Additionally, _TableAttribute_ also allows a custom primary key column name to be declared. Be clear, LightSpeed is still very much a convention-over-configuration style framework and it was a conscious decision to only add these configuration points now. Use judiciously.
[Table("GadgetsTable", IdColumnName = "Code")] public class Gadget : Entity<int> { [Column("Name")] private string _title; //... }
h3. More Load Hooks
A couple of customers wanted some more hooks around object load. You ask and we deliver! Override _BeforeLoad_ and _AfterLoad_ to have your way with an Entity as it’s being loaded.
h3. CreatedOn and UpdatedOn
We also added a couple more “convention fields”: _CreatedOn_ and _UpdatedOn_ provide simple client-side timestamping – Great for keeping your database clean of application logic.
// MyClass.cs private readonly DateTime _createdOn = DateTime.MinValue; public DateTime CreatedOn { get { return _createdOn; } } private readonly DateTime _updatedOn = DateTime.MinValue; public DateTime UpdatedOn { get { return _updatedOn; } }
h3. Postgres, MySQL and SQLite Auto-Increment Columns
Even though some consider identity columns to be about as evil as The Spawn of Xenu, we at Mindscape aim to cater to all denominations. So LightSpeed 1.2 improves support for identity columns by enabling the various flavours offered by Postgres, MySQL and SQLite. Be aware: using Identity columns in .NET is slower than other approaches.
h3. Debugger Visualizer
LightSpeed 1.2 includes a new Debugger Visualizer allowing easy viewing of query SQL. Just drop _Mindscape.LightSpeed.DebuggerVisualizer.dll_ into one of your Visual Studio visualizers folders and you can bask in the beauty of queries such as this bad boy:
Don’t worry, this is just one from our test suite. Your results may vary.
h3. Localization Sample
Finally, we created a small sample illustrating how to override LightSpeed’s default resource set. Great for multi-language or even just customizing some of the framework’s validation and error messages.
h3. Roadmap
We’re hard at work on our LightSpeed LINQ provider which we’ll be releasing as a core feature of LightSpeed 2.0. Other features that might make it into 2.0 include: Migrations, Nested Sets, Code Generation, N-Level Undo and more. We would also love to know what you’d like to see so feel free to tell us. We’re very keen to get LightSpeed 2.0 out sooner rather than later so expect to see this in the next few months.
Cheers,
The Mindscape Team.
5 Responses to “LightSpeed 1.2 Released”
Leave a Reply
![]()
BrainDump (1)
Community Code (1)
Events (6)
General (31)
Lab Samples (2)
LightSpeed (132)
MegaPack (3)
News (48)
Products (64)
Projects (4)
Screencast (6)
SharePoint (1)
Silverlight (5)
Silverlight Elements (12)
SimpleDB Management Tools (11)
Visual Studio (4)
VS File Explorer (5)
WPF (31)
WPF Diagramming (14)
WPF Elements (22)
WPF Property Grid (24)
![]()
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007



Tagged as 


Posted by John-Daniel Trask on 4 February 2008



[...] LightSpeed 1.2 Released – MindScape announce the latest release of their ORM software [...]
[...] LightSpeed 1.2 Released (John-Daniel Trask) [...]
How would nested sets and migrations possibly be implemented in LS.
[...] Many more small feature additions – see here for more [...]
@KShaban,
Nested sets would be implemented as an optimized query generation path for eager loaded hierarchical associations.
Migrations would be provided as some separate tooling.
Cheers,
Andrew.