EntityLoadType for IEntitySource.GetAsync in Composition API

Hello,

what is the effect of using the different EntityLoadTypes? I can't see any difference on the IEntity object returned when using GetAsync:

var query = Query.From("Person").Select("FirstName", "LastName").Where("CentralAccount = 'xyz'");
var entityDefault = await request.Session.Source().GetAsync(query, EntityLoadType.Default, ct).ConfigureAwait(false);
var entityDelayed = await request.Session.Source().GetAsync(query, EntityLoadType.DelayedLogic, ct).ConfigureAwait(false);
var entityInter = await request.Session.Source().GetAsync(query, EntityLoadType.Interactive, ct).ConfigureAwait(false);
var entityRead = await request.Session.Source().GetAsync(query, EntityLoadType.ReadOnly, ct).ConfigureAwait(false);

So EntityLoadType.Interactive has to be used in order to be able to manipulate the object, but what is the difference of the other 3 types since even with limiting by a Select("...") the complete object is returned anyway. Do the other 3 types have any significant difference in regard to the performance on huge tables?

thanks in advance, best regards

Parents
  • First of all, the difference in regards to the load time is none, as you are speaking about single entities in your example.

    Second, the select clause comes into play, when you would deal with entity collections. There, you can limit the columns that should be loaded directly into the collection. The missing ones would be loaded ad-hoc when you create an entity object from this collection.

    But nevertheless, here a short summary of the EntityLoadType.

    The EntityLoadType determines the execution of the business logic of an entity.

    EntityLoadType.ReadOnly
    Read-only entity without any business logic.

    EntityLoadType.DelayedLogic
    The delayed logic mode runs any business logic rules and methods when the entity is saved. This mode is the default if no EntityCreationType is specified

    EntityLoadType.Interactive
    Interactive entities run business logic already on PutValue. Their primary application are user interfaces where users want to see the outcome of business logic directly.
    The downside of interactive entities lays in their greater resource usage, especially on application servers.

Reply
  • First of all, the difference in regards to the load time is none, as you are speaking about single entities in your example.

    Second, the select clause comes into play, when you would deal with entity collections. There, you can limit the columns that should be loaded directly into the collection. The missing ones would be loaded ad-hoc when you create an entity object from this collection.

    But nevertheless, here a short summary of the EntityLoadType.

    The EntityLoadType determines the execution of the business logic of an entity.

    EntityLoadType.ReadOnly
    Read-only entity without any business logic.

    EntityLoadType.DelayedLogic
    The delayed logic mode runs any business logic rules and methods when the entity is saved. This mode is the default if no EntityCreationType is specified

    EntityLoadType.Interactive
    Interactive entities run business logic already on PutValue. Their primary application are user interfaces where users want to see the outcome of business logic directly.
    The downside of interactive entities lays in their greater resource usage, especially on application servers.

Children