<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:57:22 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-2495] Provide a more extensible DecoderContext and EncoderContext</title>
                <link>https://jira.mongodb.org/browse/JAVA-2495</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;It would be nice to have a decoder and encoder context, that can be used externally, to pass options to the decoder and encoder.&lt;/p&gt;

&lt;p&gt;Right now I see no possibility to modify the existing context, overwrite it with some custom attributes, or even a possibility to hand over a own context implementation.&lt;/p&gt;

&lt;p&gt;The suggestion would be to ether make both contexts and there builders public and extensible or to provide a options map, that can be used and set for each child context.&lt;/p&gt;

&lt;p&gt;Either way would require some handover at the collection class as well, like find(&amp;lt;the findparameters&amp;gt;, DecoderContext) or find(&amp;lt;the findparameters&amp;gt;, Map&amp;lt;Object, Object&amp;gt;)&lt;/p&gt;

&lt;p&gt;&quot;What is the usecase?&quot;&lt;/p&gt;

&lt;p&gt;We have generic Decoder and Encoder, that works with an EMF model as a schema, with can take a couple of options, like a flag to serialize default values or not. Right now we have to instantiate a CodecProvider for every find we make in order to hand some options to the codec we want to use. &lt;/p&gt;

&lt;p&gt;Furthermore we call the codec registry and decode for every containment reference. We know the type for every containment reference and what type to expect, this we need to hand to our child decoder that is generic as well. Right now our Codec is not stateless and we have a instance for every find operation, which is kind of bad. With the above mentioned mechanism we could get rid of it.&lt;/p&gt;</description>
                <environment></environment>
        <key id="375043">JAVA-2495</key>
            <summary>Provide a more extensible DecoderContext and EncoderContext</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="ross@mongodb.com">Ross Lawley</assignee>
                                    <reporter username="ungeildodger">J&#252;rgen Albert</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Apr 2017 12:42:36 +0000</created>
                <updated>Tue, 29 Jan 2019 12:23:02 +0000</updated>
                            <resolved>Tue, 29 Jan 2019 10:04:30 +0000</resolved>
                                    <version>3.4.2</version>
                                                    <component>Codecs</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2130394" author="ungeildodger" created="Tue, 29 Jan 2019 12:23:02 +0000"  >&lt;p&gt;PojoCodec is nice, but we can&apos;t use it. We use EMF and thus a model driven approach. This means 2 Things:&#160;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;We don&apos;t necessarily have a POJO for the Objects we are decoding/encoding.&lt;/li&gt;
	&lt;li&gt;Event If we have generated code, the EMF Objects should not be used via the normal java reflections.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In Addition to this, we have a couple of things we want/need to pass to the codec. This are e.g. the above mentioned options, factories and model repositories.&#160;&lt;/p&gt;

&lt;p&gt;We could get rid of a lot of code, if we could simply provide our own context as an extension to the Decoder-/EncoderContext. Additionally, we could finally make our Codec stateles.&#160;&lt;/p&gt;

&lt;p&gt;We don&apos;t need anything fancy. It wou&#246;ld suffice, if we would be able to extend the contexts themself. You are using the context for yourself in the PojoCodec and it would be nice to give us the same possibility.&lt;/p&gt;</comment>
                            <comment id="2130303" author="ross@10gen.com" created="Tue, 29 Jan 2019 10:04:30 +0000"  >&lt;p&gt;Having discussed internally, we&apos;ve decided to mark this ticket as &quot;Won&apos;t Fix&quot;. &lt;/p&gt;

&lt;p&gt;I understand the motivations for the ticket but since this ticket was filed, the Java driver has introduced a PojoCodec implementation.  As the PojoCodec and the rest of the driver don&apos;t need to extend these contexts, we&apos;ve decided not to add it into the driver.&lt;/p&gt;

&lt;p&gt;If you or any others reading this ticket, feel strongly that this is the wrong decision, then please comment and if there is enough interest we will reconsider.&lt;/p&gt;</comment>
                            <comment id="1989616" author="michael.weber@bild.de" created="Thu, 30 Aug 2018 08:34:06 +0000"  >&lt;p&gt;I also need to &quot;loop through&quot; some context when decoding nested structures.&lt;/p&gt;

&lt;p&gt;I like the idea of having a map inside DecoderContext that can be used to hold context.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsy9nj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>