• Like

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Java 5 PSM for DDS: Revised Submission (out of date)

  • 719 views
Uploaded on

Presentation given to the Object Management Group's MARS Task Force in September, 2010 about a proposal to improve the Java API for the OMG's Data Distribution Service (DDS). See also …

Presentation given to the Object Management Group's MARS Task Force in September, 2010 about a proposal to improve the Java API for the OMG's Data Distribution Service (DDS). See also http://code.google.com/p/datadistrib4j/.

This presentation is obsoleted by a later one: http://www.slideshare.net/rickbwarren/java-psm-revisedsubmission2presentationmars20101222.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
719
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Benefits of “close” instead of factorymethod:Familiar from java.io, javax.jmsCan’t get it wrong by using wrong factory
  • Write a normal-looking Java class with no DDS dependencies, then use it to pub and sub
  • Decision matrix: * Need maximum performance? Want to share type definitions across languages? Generate code. * Want maximum convenience? Working mostly in Java? Use this new Representation.

Transcript

  • 1. Java 5 PSM for DDS:Revised SubmissionMARS – Cambridge, MA – September 2010
    Presenter: Rick Warren, RTI
    Submitting POCs:
    • Rick Warren, RTI:rick.warren@rti.com
    • 2. Angelo Corsaro, PrismTech:angelo.corsaro@prismtech.com
    document number: mars/2010-09-05
  • 3. Agenda
    Specification Overview
    Mostly review from last time
    Specification changes since Minneapolis
    Full DDS-XTypes support
    Java Type Representation
    Other minor changes
    In depth: Java Type Representation
    TODO for the next meeting
    Review: This will impact many of us; needs to be right
    Copyright © 2010 RTI - All rights Reserved
    2
  • 4. Goals & Design Principles
    Improve user experience
    standardNamingConvention
    Standard containers (e.g. java.util.List)
    Standard enumerations
    Error conditions reported with exceptions
    Serializable, Cloneable value types
    Simplified method overloads
    Improve type safety
    Generics
    Improve performance
    Loanable memory
    No critical-path memory allocation (unlike IDL PSM)
    Improve portability
    Build apps against standard interfaces; decide at run time which impl to use
    Host multiple implementations (or versions) within same JVM
    Dynamic loading and unloading
    Play nicely with containers, e.g. Java EE and OSGi
    Don’t require non-constant static state
    Copyright © 2010 RTI - All rights Reserved
    3
  • 5. State of the Proposal
    First revised submission
    Process moving quickly and efficiently
    Submitters have joined
    All mandatory requirements satisfied
    User vetting process begun
    Private conversations with Java power users
    Publicly available code repository at http://code.google.com/p/datadistrib4j/
    So far, reviewers enthusiastic
    Still to go:
    Review within submission team and with our customers
    Review with your own stakeholders!
    Next submission will be ready for a vote
    Copyright © 2010 RTI - All rights Reserved
    4
  • 6. Hello, World
    import org.omg.dds.*;
    Topic<Foo> t = …;
    DataWriter<Foo> dw = myPub.createDataWriter(t);
    Foo data = …;
    dw.write(data);
    dw.close();
    DataReader<Foo> dr = mySub.createDataReader(t);
    Sample.Iterator<Foo> it = dr.take();
    Foo data2 = it.next().getData();
    it.returnLoan();
    dr.close();
    • OMG package
    • 7. Typical naming convention
    • 8. Overloaded methods
    • 9. Generics for type safety
    • 10. Close like JMS, I/O stream
    • 11. Standard collections
    Copyright © 2010 RTI - All rights Reserved
    5
  • 12. Since Initial Submission: DDS-XTypes
    Dynamic Language Binding
    TypeObject for type propagation
    Built-in data types:
    Types: String, KeyedString, Bytes, KeyedBytes
    Added overloads to Publisher, Subscriberto create statically type-safe readers and writers of these types
    New QoS policies
    Standard annotations
    Copyright © 2010 RTI - All rights Reserved
    6
  • 13. Since Initial Submission: Java Type Rep’n
    Publish and subscribe to POJOs without code generation
    Based on Java reflection
    More on this later
    Copyright © 2010 RTI - All rights Reserved
    7
  • 14. Since Initial Submission: Misc. Details
    Improved static type safety of topic creation
    Improved static type safety of topic, reader, and writer listeners
    Improved portability of TypeSupport creation
    Improved Context loading
    Miscellaneous alignments with C++ PSM
    “Hello World” code example
    Automated generation of binary jar and source zip files
    Copyright © 2010 RTI - All rights Reserved
    8
  • 15. Java Type Representation: Intro
    Goal: Write the following code:
    public class MyPojo/*extends/implements…*/ {
    private intfoo;
    private Bar[] baz;
    public void doStuff() { … }
    }

    Topic<MyPojo> t = dp.createTopic( "My Topic", MyPojo.class);
    Copyright © 2010 RTI - All rights Reserved
    9
  • 16. Java Type Representation: Intro
    Does not replace, modify existing standard Language Bindings
    Interoperable at wire level
    …with generated or dynamic types
    …in Java or any other language
    Convenience feature for non-real-time Java systems
    “Representation” is run-time, reflection-based: no Java source code parsing or code generation
    Implication: Reflection slower than compiled generated code
    Implication: If other languages are used, type definitions must be “duplicated”
    Copyright © 2010 RTI - All rights Reserved
    10
  • 17. Java Type Representation: Approach
    Leverage the knowledge of Java developers
    Leverage the code they already have
    Observations:
    JRE already provides type definition constructs
    Primitive types, strings, lists (sequences), classes (structures), enumerations, annotations
    Types to be sent over network already indicate that
    …by implementing java.io.Serializable
    …including which fields should not be sent
    …with the transient keyword
    Copyright © 2010 RTI - All rights Reserved
    11
  • 18. Java Type Representation: Approach
    What this Representation has to do:
    Define mappings between JRE concepts and DDS concepts
    intInt32 (IDL long)
    doubleFloat64 (IDL double)
    java.util.ListSequence
    Serializable class Structure
    Allow customizability to support non-Java DDS concepts
    e.g. unsigned primitives, narrow vs. wide strings, unions
    Mechanism: @SerializeAs annotation
    Copyright © 2010 RTI - All rights Reserved
    12
  • 19. Java Type Representation: Example
    Java
    IDL
    package com.acme;
    class Fooimplements Serializable {
    @Key inttheInt;
    transient float theFlt;
    String theStr;
    @SerializeAs(UINT_64)BigIntegertheUInt;
    String[] theArr;
    }
    module com { module acme {
    @Extensibility(MUTABLE)struct Foo {
    @Key long theInt;
    string theStr;
    unsigned long theUInt;
    sequence<string> theArr;
    };
    }}
    Copyright © 2010 RTI - All rights Reserved
    13
  • 20. Still TO DO
    We will ask for a vote at the December meeting
    Review the PSM with your stakeholders
    API
    Implementation: Context.createInstance(only non-trivial implementation in the PSM)
    Specification document
    Review the code license, copyrights
    (Will want AB, SMC guidance too)
    OMG and submitters (RTI, PrismTech) have joint copyright
    OMG-standard Java source files have BSD-style license
    Does not constrain licenses or biz models of impl’s
    Vendors redistributing these files must:
    Document license terms
    Acknowledge copyright holders
    Will be further alignment within submission team, including consideration of C++ PSM
    Copyright © 2010 RTI - All rights Reserved
    14
  • 21. Still TO DO
    Copy specification into JavaDoc?
    Friendly for IDE users
    myWriter.setQos|
    More examples? (non-normative)
    e.g. Application code examples
    e.g. No-op reference implementation
    You tell us!
    Copyright © 2010 RTI - All rights Reserved
    15
    void setQos(DataWriterQosq)
    Set the QoS of this DataWriter. The result of subsequent calls to getQos will be equal to the value set by this method.
  • 22. Summary
    DDS will have a first-class Java API.
    That looks and behaves like a typical Java API.
    That performs well.
    Soon.
    Copyright © 2010 RTI - All rights Reserved
    16
  • 23. Q & A
    Copyright © 2010 RTI - All rights Reserved
    17