You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this really qualifies as a bug, so filing as a feature request.
Which AWS Services is the feature request for?
Not a particular service, but AWSCore/Mantle (related to AWSMTLValueTransformer / NSValueTransformer)
Is your feature request related to a problem? Please describe.
While reviewing the SDK for integration into our application, we noticed there is use of the +load method within AWSCore. The implementation of +load here ensures these transformers are registered with NSValueTransformer in time for usage; however +load runs as soon as the framework is loaded into the application's process memory, so this code will be run on (pre-)launch of the app and take up some time there, even if the user never interacts with, e.g., a specific feature that actually uses the SDK within the app. While this specific code is pretty minimal, it's not ideal to have it run on every launch, even if the SDK is never actually used. As of iOS 15, the system may load dependencies/frameworks well before the user even tries to launch the app, so this is even less ideal in more recent iOS versions.
Describe the solution you'd like
A different/lazier approach to registering these value transformers; maybe using +initialize on some central AWSCore class.
This doesn't seem quite as trivial as changing +load->+initialize, since the first usage of custom transformers could be within that same method, and +initialize is lazily called on the first message to the class.
That said, it looks like AWSMTLValueTransformer is used in many of the model classes, so maybe having an +[AWSMTLValueTransformer initialize] method would suffice for cases where having the transformer registered would actually matter (I think this only wouldn't work if the SDK uses NSValueTransformer itself instead of AWSMTLValueTransformer at some point where the custom transformers would be needed).
Otherwise, if there happens to be some class within AWSCore that would always be messaged before the SDK did anything with the transformers (perhaps a model base class like AWSMTLModel), an +initialize method there could work too; or perhaps some other 'lazy registration' approach not involving load or initialize at all exists.
Describe alternatives you've considered
N/A
Additional context
Some relevant links/documentation:
"Value transformers are typically registered by an application’s delegate class, in response to receiving a initialize: class message. This allows registration to occur early in the application startup process, providing access to the value transformers as nib files load." - Value Transformer Programming Guide
"For example, NSValueTransformer or NSURLProtocol subclasses can't use +initialize to register themselves with their superclasses, because you set up a chicken-and-egg situation." - mikeash.com
Thanks for opening this feature request @bdfreese. We appreciate the thorough details and considerations you included. We'll respond here with any updates.
Not sure if this really qualifies as a bug, so filing as a feature request.
Which AWS Services is the feature request for?
Not a particular service, but
AWSCore/Mantle
(related toAWSMTLValueTransformer
/NSValueTransformer
)Is your feature request related to a problem? Please describe.
While reviewing the SDK for integration into our application, we noticed there is use of the
+load
method withinAWSCore
. The implementation of +load here ensures these transformers are registered withNSValueTransformer
in time for usage; however+load
runs as soon as the framework is loaded into the application's process memory, so this code will be run on (pre-)launch of the app and take up some time there, even if the user never interacts with, e.g., a specific feature that actually uses the SDK within the app. While this specific code is pretty minimal, it's not ideal to have it run on every launch, even if the SDK is never actually used. As of iOS 15, the system may load dependencies/frameworks well before the user even tries to launch the app, so this is even less ideal in more recent iOS versions.Describe the solution you'd like
A different/lazier approach to registering these value transformers; maybe using
+initialize
on some centralAWSCore
class.This doesn't seem quite as trivial as changing
+load
->+initialize
, since the first usage of custom transformers could be within that same method, and+initialize
is lazily called on the first message to the class.That said, it looks like
AWSMTLValueTransformer
is used in many of the model classes, so maybe having an+[AWSMTLValueTransformer initialize]
method would suffice for cases where having the transformer registered would actually matter (I think this only wouldn't work if the SDK usesNSValueTransformer
itself instead ofAWSMTLValueTransformer
at some point where the custom transformers would be needed).Otherwise, if there happens to be some class within
AWSCore
that would always be messaged before the SDK did anything with the transformers (perhaps a model base class likeAWSMTLModel
), an+initialize
method there could work too; or perhaps some other 'lazy registration' approach not involvingload
orinitialize
at all exists.Describe alternatives you've considered
N/A
Additional context
Some relevant links/documentation:
The text was updated successfully, but these errors were encountered: