<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:59:21 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-3331] InsertOneOptions and InsertManyOptions are final</title>
                <link>https://jira.mongodb.org/browse/JAVA-3331</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;These options class, unlike most/all of the others, are final.&#160; This makes it awkward for me to provide a consistent experience in Morphia.&#160; With the others, I can extend them and add things like WriteConcern and ReadPreference options to provide a single place for users to define various options.&#160; With these being final, i have to jump through certain hoops and it results in an inconsistent API and implementations.&#160; &apos;final&apos; should be removed from these types. I can work around it but it makes me sad.&lt;/p&gt;</description>
                <environment></environment>
        <key id="808071">JAVA-3331</key>
            <summary>InsertOneOptions and InsertManyOptions are final</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="-1">Unassigned</assignee>
                                    <reporter username="justin.lee">Justin Lee</reporter>
                        <labels>
                    </labels>
                <created>Wed, 19 Jun 2019 15:28:27 +0000</created>
                <updated>Wed, 16 Dec 2020 02:27:00 +0000</updated>
                            <resolved>Tue, 15 Dec 2020 18:05:36 +0000</resolved>
                                    <version>3.10.2</version>
                                                    <component>Query Operations</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3531792" author="jeff.yemin" created="Wed, 16 Dec 2020 02:27:00 +0000"  >&lt;p&gt;All the options classes ideally would be &lt;tt&gt;final&lt;/tt&gt; but doing so would break binary compatibility, so I&apos;m not inclined to make the change at this time.  We just have to live with it.  In practice, it&apos;s not likely that ordinary users would ever even think to extend any of these classes, so in practice it&apos;s not a big issue.&lt;/p&gt;</comment>
                            <comment id="3531778" author="heng.wang@jinmuinfo.com" created="Wed, 16 Dec 2020 02:16:33 +0000"  >&lt;p&gt;hi. jeffrey yemin&#160; &#160;,I create the PR for this issues.&#160; &#160;I found that the options are not uniform,&#160;&#160;not all of them were made final.&#160; such&#160; as&#160; updateOptions .&#160; I think&#160; they should be a unified standard.&#160; &#160;Please let me know your research direction .&lt;/p&gt;</comment>
                            <comment id="3530801" author="jeff.yemin" created="Tue, 15 Dec 2020 18:05:22 +0000"  >&lt;p&gt;OK, thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=justin.lee&quot; class=&quot;user-hover&quot; rel=&quot;justin.lee&quot;&gt;justin.lee&lt;/a&gt;.  &lt;/p&gt;</comment>
                            <comment id="3530792" author="jlee@antwerkz.com" created="Tue, 15 Dec 2020 18:02:43 +0000"  >&lt;p&gt;This is what I ended up doing and, honestly, it&apos;s probably a better choice.&#160; I added write concern and read preferences to the options, locally.&#160; That was my motivation and it&apos;s probably best to make a clean distinction between Morphia&apos;s and the driver&apos;s options.&#160; I was going for &quot;use either depending on your needs&quot; but perhaps it&apos;s just best to funnel everyone through the Morphia APIs.&#160; I might even generate those classes to better track the changes ( like `allowDiskUse` that just showed up in `FindOptions` ).&#160; Let&apos;s go ahead and close this as &quot;won&apos;t fix&quot; or &quot;invalid&quot; (whatever Jira calls it these days).&lt;/p&gt;</comment>
                            <comment id="3530028" author="jeff.yemin" created="Tue, 15 Dec 2020 12:56:07 +0000"  >&lt;p&gt;Just got a PR for this, but probably best to discuss the merits here instead of there.&lt;/p&gt;

&lt;p&gt;If an application were to subclass either of those classes and pass an instance of the subclass to the driver, the driver would not be aware of the subclass and so would ignore any additional fields from the subclass.  That&apos;s why the options classes should final, to indicate that they are not designed for extension.  It was a mistake that not all of them were made final.  &lt;/p&gt;

&lt;p&gt;For a wrapping driver like Morphia, I think it&apos;s best to wrap options rather than extend them.  It&apos;s a bit more work for Morphia, but the benefit is a clearer contract for everyday driver users.&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|huv8fr:</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>