-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow Polymorphic persistenence #70
Comments
I've added a branch and a first Testcase to accelerate your kickoff: https://github.com/ppi-ag/deep-sampler/tree/polymorphic-feature Line 1201 in 34c07ff
|
Test fails now |
The test was intended to fail until the polymorphic feature is implemented. It should throw an InstantionationError because it is trying to instantiate the interface Animal. Or is it something else? I think the branch is quite old, maybe dev needs to be merged into polymorphic-feature. The test doesn't use PersistentSampler yet. |
* +Test first: New Testcase for Issue #70 * Intermediate state * Intermediate state * Cleanup for new annotations * Additional tests and fixes * +javadoc * -sonar code smells * -sonar code smells * -instantiation of inner classes in non public classes is possible now * Dublicated paths refeactored * Increased precision in tests * BeanConverterExtensions can be configured using annotations * Cleaning and Javadoc * CodeSmells beseitigt * linting * Polymorphic persistence ist now possible. Deserializing works in minimal testcases * Review * +Test first: New Testcase for Issue #70 * Polymorphic persistence ist now possible. Deserializing works in minimal testcases * Update README.md * Update README.md * Update README.md * Removed some typos * Update README.md * New graphics and explanations * Update README.md * Update README.md * Refactoring * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * transparency * transparency reverted * text revised * Refactoring * Refactoring * Refactoring * Refactoring * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Additional tests * Refactorings * Generic properties of Beans can be deserialized using PolymorphicPersistentBean * The class was moved to the new branch refactoring_simplified_bean_extension. The class is not used yet, and it messes up the test coverage * Refactoring * The class was moved to the new branch refactoring_simplified_bean_extension. The class is not used yet, and it messes up the test coverage * Housekeeping * Even more tests * Added javadoc in PolymorphicPersistentBean.java Co-authored-by: JanSchankin <jas@treeno.de> Co-authored-by: chb <chb@ppi.de> Co-authored-by: jas <jan.schankin@ppi.de>
When DeepSampler wants to deserialize an Object, the concrete type of the object must be known, so that a new instance of that type can be created.
There are two cases where different deserialization approaches are used:
PersistentBean
s by DeepSamplers
PersistentBeanConverter`.In the first case type information is completely handled by the persistence framework (Jackson).
In the second case DeepSampler uses the declared return type of the method that is supposed to return the persistent object. Now, there are circumstances where this doesn't work. In general, this is always the case if the actually returned object is a sub type of the declared return type. E.g. in many cases this happens if the declared return type is an interface.
That's why we need to add a type information to
PersistentBean
in all cases where the original type cannot be determined by the declared return type of the sampled method.The text was updated successfully, but these errors were encountered: