-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Split Specification
to data + view
#348
Comments
This was referenced May 3, 2022
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 9, 2022
Part of OpenAssetIO#335, and later OpenAssetIO#348. Removing the requirement for up-front knowledge simplifies the logic in many common applications, and will better support the 'view/builder' design of the upcoming Specification/TraitsData split. Signed-off-by: Tom Cowland <tom@foundry.com>
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 9, 2022
Part of OpenAssetIO#335, and later OpenAssetIO#348. Removing the requirement for up-front knowledge simplifies the logic in many common applications, and will better support the 'view/builder' design of the upcoming Specification/TraitsData split. Signed-off-by: Tom Cowland <tom@foundry.com>
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 12, 2022
The existing approach of Specification being a base class for custom views _and_ the container holding the data the views operate on created assorted problems: - It has too many responsibilities. - It was expected that default constructed Specification derived classes imbued the specification with their defined trait set. Yet, at the same time, passing a base class specification into derived one's constructor was meant to transparently 'wrap' this data to allow introspection without imbuing any new specifications. So the observed behaviour is divergent, and counterintuitive. - The above also implied that it was down-casting the specification which, is not the case as the data from resolve etc. is never going to be an instance of the more derived class. - Passing the specification instance into register opened up the possibility of someone wrapping resolved data in a view, modifying it, then passing this back to register. If the resolved data was missing any of the traits of that specification, they would never be imbued as they are only added to default constructed versions. This commit separates out the data from the view. - TraitsData is the transport-layer container for a trait set and any trait property values. - Specification becomes the base class for strongly-typed views on an a TraitsData instance. This resolves most the majority of the above concerns, and better reenforces the requirement for the low-level transport of API data to be simple and generic. We spent a suitable amount of time going around in circles, and naming wise, TraitsData won out over TraitData, TraitsInstance, SpecificationData and values as it best defines its applicability is limited to traits, and not all traits have values. Closes OpenAssetIO#348. Signed-off-by: Tom Cowland <tom@foundry.com>
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 13, 2022
Part of OpenAssetIO#335, and later OpenAssetIO#348. Removing the requirement for up-front knowledge simplifies the logic in many common applications, and will better support the 'view/builder' design of the upcoming Specification/TraitsData split. Signed-off-by: Tom Cowland <tom@foundry.com>
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 16, 2022
The existing approach of Specification being a base class for custom views _and_ the container holding the data the views operate on created assorted problems: - It has too many responsibilities. - It was expected that default constructed Specification derived classes imbued the specification with their defined trait set. Yet, at the same time, passing a base class specification into derived one's constructor was meant to transparently 'wrap' this data to allow introspection without imbuing any new specifications. So the observed behaviour is divergent, and counterintuitive. - The above also implied that it was down-casting the specification which, is not the case as the data from resolve etc. is never going to be an instance of the more derived class. - Passing the specification instance into register opened up the possibility of someone wrapping resolved data in a view, modifying it, then passing this back to register. If the resolved data was missing any of the traits of that specification, they would never be imbued as they are only added to default constructed versions. This commit separates out the data from the view. - TraitsData is the transport-layer container for a trait set and any trait property values. - Specification becomes the base class for strongly-typed views on an a TraitsData instance. This resolves most the majority of the above concerns, and better reenforces the requirement for the low-level transport of API data to be simple and generic. We spent a suitable amount of time going around in circles, and naming wise, TraitsData won out over TraitData, TraitsInstance, SpecificationData and values as it best defines its applicability is limited to traits, and not all traits have values. Closes OpenAssetIO#348. Signed-off-by: Tom Cowland <tom@foundry.com>
This was referenced May 18, 2022
foundrytom
added
decision record
on hold
Should not be merged
and removed
decision record
labels
May 18, 2022
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 20, 2022
The existing approach of Specification being a base class for custom views _and_ the container holding the data the views operate on created assorted problems: - It has too many responsibilities. - It was expected that default constructed Specification derived classes imbued the specification with their defined trait set. Yet, at the same time, passing a base class specification into derived one's constructor was meant to transparently 'wrap' this data to allow introspection without imbuing any new specifications. So the observed behaviour is divergent, and counterintuitive. - The above also implied that it was down-casting the specification which, is not the case as the data from resolve etc. is never going to be an instance of the more derived class. - Passing the specification instance into register opened up the possibility of someone wrapping resolved data in a view, modifying it, then passing this back to register. If the resolved data was missing any of the traits of that specification, they would never be imbued as they are only added to default constructed versions. This commit separates out the data from the view. - TraitsData is the transport-layer container for a trait set and any trait property values. - Specification becomes the base class for strongly-typed views on an a TraitsData instance. This resolves most the majority of the above concerns, and better reenforces the requirement for the low-level transport of API data to be simple and generic. We spent a suitable amount of time going around in circles, and naming wise, TraitsData won out over TraitData, TraitsInstance, SpecificationData and values as it best defines its applicability is limited to traits, and not all traits have values. Closes OpenAssetIO#348. Signed-off-by: Tom Cowland <tom@foundry.com>
foundrytom
added a commit
to foundrytom/OpenAssetIO
that referenced
this issue
May 20, 2022
The existing approach of Specification being a base class for custom views _and_ the container holding the data the views operate on created assorted problems: - It has too many responsibilities. - It was expected that default constructed Specification derived classes imbued the specification with their defined trait set. Yet, at the same time, passing a base class specification into derived one's constructor was meant to transparently 'wrap' this data to allow introspection without imbuing any new specifications. So the observed behaviour is divergent, and counterintuitive. - The above also implied that it was down-casting the specification which, is not the case as the data from resolve etc. is never going to be an instance of the more derived class. - Passing the specification instance into register opened up the possibility of someone wrapping resolved data in a view, modifying it, then passing this back to register. If the resolved data was missing any of the traits of that specification, they would never be imbued as they are only added to default constructed versions. This commit separates out the data from the view. - TraitsData is the transport-layer container for a trait set and any trait property values. - Specification becomes the base class for strongly-typed views on an a TraitsData instance. This resolves most the majority of the above concerns, and better reenforces the requirement for the low-level transport of API data to be simple and generic. We spent a suitable amount of time going around in circles, and naming wise, TraitsData won out over TraitData, TraitsInstance, SpecificationData and values as it best defines its applicability is limited to traits, and not all traits have values. Closes OpenAssetIO#348. Signed-off-by: Tom Cowland <tom@foundry.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What
Split
Specification
intoTraitsData
andSpecification
Why
The two being the same inadvertently creates a logical impossibility - in that, it is suggested that a specification can be constructed by wrapping around a base class, eg:
ImageSpecification(specificaion_from_resolve)
. This has assorted problems:Notes
imbuedData
method that returns a copy of the data with all traits imbued to be passed toregister
.Acceptance Criteria
Specification
toTraitsData
final classTraitsData
The text was updated successfully, but these errors were encountered: