Visualising eager load graphs in the LightSpeed designer

Understanding what gets loaded when is important to the efficient use of an object-relational mapper. Load too little, and you can end up making lots and lots of round trips to the database. Load too much, and you can end up hauling in dozens of entities when you only wanted one or two.

LightSpeed’s eager loading and named aggregate features provide a great way of controlling aggregate loading, and you can easily set up these aggregates via the LightSpeed designer. However, in complex models it’s not always easy to see the aggregates once they’re set up.

We’ve now added a feature to the designer’s filtering capability which allows you to see which entities are participating in a named aggregate, and to display the eager load graph of any given entity. Here’s a simple model for an order management application:

Order management model

In this case, the Pickup entity eager-loads its associated Warehouse and its associated Shipments collection. That’s not obvious from the display. But if we go to the LightSpeed Model Explorer, filter on the Pickup entity and choose Show load graph, we can see exactly what is going to get loaded along with a Pickup:

LightSpeed designer eager load graph from Pickup

The load graph feature chases cascading eager loads, so if you have a chain of entities you will be able to see the entire load graph.

Another feature we’ve added is the ability to see which entities participate in a named aggregate (that is, an aggregate which is only conditionally loaded). This doesn’t show the load graph per se, but it enable you to rapidly zero in on which entities are involved in a named aggregate. To do this, select Aggregate from the Filter By menu or enter the aggregate name prefixed by the @ symbol. For example:

LightSpeed designer showing participants in WithAccount named aggregate

We hope that these features will be useful to you in visualising what will get brought in when you load a particular entity. Download the latest build of the free Express edition (or get a full copy from the store) and let us know what you think!

Tagged as General, LightSpeed

One Response to “Visualising eager load graphs in the LightSpeed designer”

  • […] You can include multiple tags in the filter, again by comma-separating them. And of course you can still also filter by entity name as previously discussed; and we’re adding eager load graph visualisation. […]

  • Leave a Reply

Archives

Join our mailer

You should join our newsletter! Sent monthly:

Back to Top