at4dx icon indicating copy to clipboard operation
at4dx copied to clipboard

Update Application class based on changes to fflib_Application

Open ImJohnMDaniel opened this issue 5 years ago • 4 comments

The fflib_Application class has been enhanced so that an extension is possible. Changes are needed to Application to account for this

see fflib-apex-common #257 for more information

ImJohnMDaniel avatar Dec 28 '19 17:12 ImJohnMDaniel

@ImJohnMDaniel So I have investigated this, and from initial observation I don't believe we will be able to leverage extending the fflib_Application class. The current issue is that there is not a 0-arg constructor defined on the Factory inner classes in the fflib_Application class.

The only way I see us being able to do this currently, would be to super the existing constructors and pass empty/null values to them. This seems a little.....silly.

I would think the better solution would be to implement 0-arg constructors on the fflib_Application Factory inner classes, but that would obviously require a change to the fflib_Application class.

Additionally, the current setMock methods are private virtual, which cannot be overridden by the extending class. These would need to be updated to be protected virtual so that we could override the setMock behavior on the extended class.

ClayChipps avatar May 02 '21 06:05 ClayChipps

@ctchipps

These seem like reasonable changes for Apex Commons, since extending the Application Class is a much needed feature. Do y'all have the bandwidth to PR that to Commons? I'm in favor of it.

cc @ImJohnMDaniel

stohn777 avatar May 03 '21 15:05 stohn777

@stohn777 Already in progress, should be up this evening. :)

ClayChipps avatar May 03 '21 15:05 ClayChipps

@ImJohnMDaniel @stohn777 PR open over on the apex commons repo

ClayChipps avatar May 03 '21 18:05 ClayChipps