Skip to content

Commit

Permalink
Lazy load the Unit of Work, so it doesn't get built when it isn't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-baillie-ortoo committed Apr 20, 2022
1 parent bac4ce7 commit f10210a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion framework/default/ortoo-core/default/classes/Application.cls
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ public inherited sharing class Application {

public class InvalidApplicationConfigurationException extends Exceptions.DeveloperException {}

public final static ortoo_UnitOfWorkFactory UNIT_OF_WORK = new ortoo_UnitOfWorkFactory(); // is created with no default since that needs to be defined by the consumer
public final static ortoo_UnitOfWorkFactory UNIT_OF_WORK {
get {
if ( UNIT_OF_WORK == null )
{
UNIT_OF_WORK = new ortoo_UnitOfWorkFactory(); // is created with no default since that needs to be defined by the consumer
}
return UNIT_OF_WORK;
}
set;
}

public static ortoo_SelectorFactory SELECTOR; // NOPMD: want to give the impression that this is final, even though it isn't.
public static ortoo_DomainFactory DOMAIN; // NOPMD: want to give the impression that this is final, even though it isn't.
Expand Down

0 comments on commit f10210a

Please sign in to comment.