{"id":47,"date":"2008-08-27T12:26:00","date_gmt":"2008-08-27T12:26:00","guid":{"rendered":"http:\/\/www.odbms.org\/odbmsblog\/2008\/08\/27\/linq-is-the-best-option-for-a-future-java-query-api\/"},"modified":"2008-08-27T12:26:00","modified_gmt":"2008-08-27T12:26:00","slug":"linq-is-best-option-for-future-java","status":"publish","type":"post","link":"https:\/\/www.odbms.org\/blog\/2008\/08\/linq-is-best-option-for-future-java\/","title":{"rendered":"LINQ is the best option for a future Java query API"},"content":{"rendered":"<p><strong>A conversation with Mike Card.<\/strong><\/p>\n<p><em>I have interviewed <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/About\/Contributors\/card.aspx');\"  href=\"http:\/\/www.odbms.org\/About\/Contributors\/card.aspx\">Mike Card<\/a> on the latest development of the <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/ODMG\/ng.aspx');\"  href=\"http:\/\/www.odbms.org\/ODMG\/ng.aspx\">OMG working group which aims at defining a new standards for Object Database Systems.<\/a><\/em><\/p>\n<p>Mike works with Syracuse Research Corporation (SRC) and is involved in object databases and their application to challenging problems, including pattern recognition. He chairs the ODBT group in OMG to advance object database standardization.<\/p>\n<p><strong>R. Zicari: <\/strong><em>Mike, you recently chaired an OMG ODBTWG meeting, on June 24, 2008 What kind of synergy do you see outside OMG in relation to your work?<\/em><\/p>\n<p><strong>Mike Card<\/strong>: We think it is likely that the OMG would need to participate in the Java Community Process (JCP) in order to write a Java Specification Request (JSR) to add LINQ functionality to Java.<\/p>\n<p><strong>R. Zicari:<\/strong> <em>There has been a lot of discussion lately on the merit of SBQL vs. LINQ as a possible query API standard for object databases . Did you discuss this issue at the meeting?<\/em><\/p>\n<p><strong>M. Card<\/strong>: I began the technical part of our meeting by reviewing Professor Subieta\u2019s comparison of SBQL and LINQ. It was my understanding from this comparison that LINQ was technically capable of performing any query that could be performed by SBQL, and I wanted to know if the participants saw this the same way. They agreed in general, and believed that even if LINQ were only able to do 90% of what SBQL could do in terms of data retrieval that it would still be the way to go.<\/p>\n<p><strong>R. Zicari<\/strong>: <em>Could you please go a bit more in detail on this?<\/em><\/p>\n<p><strong>M. Card<\/strong>: Sure. At the meeting it was pointed out that Prof. Subieta had noted in his comparison that he had not shown queries using features that are not a part of LINQ, such as fixed-point arithmetic, numeric ranges, etc.<\/p>\n<p>These are language features that would be familiar to users of Ada but which are not found in languages like C++, C#, and Java so they would likely not be missed and would be considered esoteric.<\/p>\n<p>It was also pointed out that the query examples chosen by Prof. Subieta in his comparison were all \u201cprojections\u201d (relational term meaning a query or operation that produces as its output table a subset of the input table, usually containing only some of the input table\u2019s columns).<\/p>\n<p>A query like this by definition will rely on iteration, and this will show the inherent expressive power of SBQL since the abstract machine contains a stack that can be used to do the iteration processing and thus avoid the loops, variables, etc. needed by SQL\/LINQ.<\/p>\n<p><strong>R. Zicari<\/strong>: <em>Did you agree on a common direction for your work in the group?<\/em><\/p>\n<p><strong>M. Card<\/strong>: The consensus at this meeting and at ICOODB conference in Berlin was that LINQ was the best option for a future Java query API since it already had broad support in the .Net community. We will have to choose a new name for the OMG-Java effort, however, as LINQ is trademarked by Microsoft.<\/p>\n<p>It was also agreed that the query language need not include object update capability, as object updates were generally handled by object method invocations and not from within query expressions.<\/p>\n<p>Now, since LINQ allows method invocations as part of navigation (e.g. \u201cmy_object.getBoss().getName()\u201d) it is entirely possible that these method calls could have side effects that update the target objects, perhaps in such a way that the changes would not get saved to the database.<\/p>\n<p>This was recognized as a problem, ideas kicked around for how to solve it included source code analysis tools.<br \/>\nThis is something we will need a good answer for as it is a potential \u201copen manhole cover\u201d if we intend the LINQ API to be read-only and not capable of updating the database (especially unintentionally!)<\/p>\n<p><strong>R. Zicari<\/strong>: <em>What else did you address at the meeting?<\/em><\/p>\n<p><strong>Mike Card<\/strong>: The discussion then moved on to a list of items included Carl Rosenberger\u2019s ICOODB presentation.<br \/>\nOther items were also reviewed from an e-mail thread in the <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org');\"  href=\"http:\/\/www.odbms.org\">ODBMS.ORG forum<\/a>that included comments from both Prof. Subieta and Prof. William Cook.<\/p>\n<p>The areas discussed were broken down into 3 groups:<br \/>\ni) <em>those things there was consensus on for standardization<\/em>,<br \/>\nii) <em>those things that needed more discussion\/participation by a larger group<\/em>, and<br \/>\niii)<em> those things that there was consensus on for exclusion from standardization.<\/em><\/p>\n<p><strong>R. Zicari<\/strong>: <em>What are the areas you agree to standardize?<\/em><\/p>\n<p><strong>Mike Card<\/strong>: <strong>The areas we agree to standardize are:<\/strong><\/p>\n<p>1. <strong>object lifecycle (in memory): <\/strong>What happens at object creation\/deletion, \u201cattached\u201d and \u201cdetached\u201d objects, what happens during a database transaction (activation and de-activation), etc. It is desirable that we base our efforts in this area on what has already been done in existing standards for Java such as JDO, JPA, OMG, et. al. This interacts with the concurrency control mechanism for the database engine, may need to refer to Bernstein et. al. for serialization theory \/ CC algorithms.<\/p>\n<p>2. <strong>object identification: <\/strong>A participant raised a concern here RE: re-use of OID where the OID is implemented as a physical pointer and memory is re-cycled resulting in re-use of an OID, which can corrupt some applications. He favored a standard requiring all OIDs to be unique and not re-used<\/p>\n<p>3. <strong>session:<\/strong>: what are the definition and semantics of a session?<br \/>\na. <em>Concurrency control<\/em>: again, we should refer to Bernstein et. al. for proven algorithms and mathematical definitions in lieu of ACID criteria (ACA: Avoidance of Cascading Aborts, ST: Strict, SR: Serializable, RC: Recoverable for characterizing transaction execution sequences)<br \/>\nb. <em>Transactions<\/em>: semantics\/behavior and span\/scope<\/p>\n<p>4. <strong>Object model: <\/strong>what OM will we base our work upon?<\/p>\n<p>5. <strong>Native language APIs: <\/strong>how will we define these? Will they be based on the Java APIs in ODMG 3.0, or will they be different? Will they be interfaces?<\/p>\n<p>6. <strong>Conformance test suite: <\/strong>we will need one of these for each OO language we intend to define a standard for. The test suite, however, is not the definition of the standard; the definition must exist in the specification.<\/p>\n<p>7. <strong>Error behavior: <\/strong>exception definitions etc.<\/p>\n<p><strong>R. Zicari<\/strong>: <em>What are the areas where no agreement was (yet) found?<\/em><\/p>\n<p><strong>Mike Card<\/strong>: <strong>Areas we need to find agreement on are:<\/strong><\/p>\n<p>1. <strong>keys and indices: how do you sort objects? <\/strong>How do you define compound keys or spatial keys? Uniqueness constraints? Can this be handled by annotation, with the annotation being standardized but the implementation being vendor-specific? This interacts with the query mechanism, e.g. availability of an index could be checked for by the query optimizer.<\/p>\n<p>2. <strong>referential integrity: <\/strong>do we want to enforce this? Avoidance of dangling pointers, this interacts with object lifecycle\/GC considerations.<\/p>\n<p>3. <strong>cascaded delete: <\/strong>when you delete an object, do you also delete all objects that it references? It was pointed out that this has issues for a client\/server model ODBMS like Versant because it may have to \u201cpush\u201d out to clients that objects on the server have been deleted, so you have a distributed cache consistency problem to solve.<\/p>\n<p>4. <strong>replication\/synchronization: <\/strong>how much should we standardize the ability to keep a synchronized copy of part or all of an object database? Should the replication mechanism be interoperable with relational databases? Part or all of this capability could be included in an optional portion of the standard.<\/p>\n<p>a. Backup:<br \/>\nthis is a specialized form of replication, how much should this be standardized? Is the answer to this<br \/>\nquestion dependent upon the kind of environment (DBA or DBA-less\/embedded) that the ODBMS is operating in?<\/p>\n<p>5. <strong>events\/triggers: <\/strong>do we want to standardize certain kinds of activity (callbacks et. al.) when certain database operations occur?<\/p>\n<p>6. <strong>update within query facility: <\/strong>this is a recognition of the limitations of LINQ, which does not support object update it is \u201cread-only.\u201d Generally, object updates and deletes are performed by method invocations in a program and not by query statements.<br \/>\nThe question is, since LINQ allows method invocations as part of navigation, e.g. \u201cmy_employee_obj.getBoss().getName(),\u201d is it possible in cases like this that such method calls could have side effects which update the object(s) in the navigation statement? If so, what should be done?<\/p>\n<p>7. <strong>extents: <\/strong>do we expose APIs for extents to the user?<\/p>\n<p>8. <strong>support for C++: <\/strong>how will we support C++\/legacy languages for which a LINQ-like facility is not available? We could investigate string-based QL like OQL and\/or we could use a facility similar to Cook\/db4o \u201cnative queries\u201d<\/p>\n<p><strong>R. Zicari<\/strong>: <em>And what are the areas you definitely do not want to standardize?<\/em><\/p>\n<p><strong>Mike Card<\/strong>: <strong>Areas we do not want to standardize are:<\/strong><\/p>\n<p>1. <strong>garbage collection<\/strong>: issue here is behavioral differences between \u201cembedded\u201d (linked-in) OODBMS vs. client\/server OODBMS<\/p>\n<p>2. <strong>stored procedures\/functions\/views<\/strong>: these are relational\/SQL concepts that are not necessarily applicable to object-oriented programming languages which are the purview of object databases.<\/p>\n<p><strong>R. Zicari<\/strong>: <em>How will you ensure that the vendor community will support this proposal?<\/em><\/p>\n<p><strong>Mike Card<\/strong>: We plan on discussing this list and verify that others not present agree with the grouping of these items. We should also figure out what we want to do with the items in the \u201cmiddle\u201d group and then begin prioritizing these things. It appears likely that a next-generation ODBMS standard will follow a \u201cdual-track\u201d model in that the query mechanism (at least for Java) will be developed as a JSR within the JCP, while all of the other items will be developed within the OMG process.<\/p>\n<p>For C# (assuming C# is a language we will want an ODBMS standard for, and I think it is), the query API will be built into the language via LINQ and we will need to address all of the \u201cother\u201d issues within our OMG effort just as with Java. In the case of C# and Java, most of these issues can probably be dealt with in the same manner.<\/p>\n<p>How much interest there is in a C++ standardization effort is unclear, this is an area we will need to discuss further.<br \/>\nA LINQ-like facility for C++ is not an option since unlike C# and Java there is no central maintenance point for C++ compilers.<\/p>\n<p>There is an ISO WG that maintains the C++ standard, but C++ \u201cculture\u201d accepts non-conformant compilers so there are many C++ compilers out there that only conform to part of the ISO standard.<\/p>\n<p>The developers present who work with C++ mentioned that their C++ code base must be \u201ctweaked\u201d to work with various compilers as a given set of C++ code might compile fine with 7 compilers but fail with the compiler from vendor number 8.<br \/>\nIn general, the maintenance of C++ is more difficult than for Java and C# due to inconsistency in compiler implementation and this complicates anything we want to do with something as complex as object persistence.<br \/>\n##<\/p>\n<p>Some Useful Resources:<br \/>\n&#8211; <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/About\/News\/20080602.aspx');\"  href=\"http:\/\/www.odbms.org\/About\/News\/20080602.aspx\">Panel Discussion &#8220;ODBMS: Quo Vadis?<\/a><\/p>\n<p>&#8211; <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/About\/News\/20080515.aspx');\"  href=\"http:\/\/www.odbms.org\/About\/News\/20080515.aspx\">Java Object Persistence: State of the Union PART II<\/a><\/p>\n<p>&#8211; <a onclick=\"javascript:pageTracker._trackPageview('\/outgoing\/www.odbms.org\/About\/News\/20080401.aspx');\"  href=\"http:\/\/www.odbms.org\/About\/News\/20080401.aspx\">Java Object Persistence: State of the Union PART I<\/a><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>A conversation with Mike Card. I have interviewed Mike Card on the latest development of the OMG working group which aims at defining a new standards for Object Database Systems. Mike works with Syracuse Research Corporation (SRC) and is involved in object databases and their application to challenging problems, including pattern recognition. He chairs the [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[298,346,427,432,439,553],"_links":{"self":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":0,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.odbms.org\/blog\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}