Everyone! I have a question - what if i don't want what kind of objects i will get? One day it is Accounts, next day - Opportunities, etc. Can I write Application.cls something like this?
{
// Configure and create the UnitOfWorkFactory for this Application
public static final fflib_Application.UnitOfWorkFactory UnitOfWork =
new fflib_Application.UnitOfWorkFactory(
new List<SObjectType> {
SObject.SObjectType });
// Configure and create the ServiceFactory for this Application
public static final fflib_Application.ServiceFactory Service =
new fflib_Application.ServiceFactory(
new Map<Type, Type> {
ISObjectService.class => SObjectsServiceImpl.class});
// Configure and create the SelectorFactory for this Application
public static final fflib_Application.SelectorFactory Selector =
new fflib_Application.SelectorFactory(
new Map<SObjectType, Type> {
SObject.SObjectType => SObjectsSelector.class });
// Configure and create the DomainFactory for this Application
public static final fflib_Application.DomainFactory Domain =
new fflib_Application.DomainFactory(
Application.Selector,
new Map<SObjectType, Type> {
SObject.SObjectType => SObjects.Constructor.class });
}
So all other layers will be only for SObject, as I can understand. Is it real life decision or not? Thanks)