Issue 16536: QoS DSL Needed (dds-psm-java-ftf) Source: PrismTech (Dr. Angelo Corsaro, PhD., angelo.corsaro(at)prismtech.com) Nature: Revision Severity: Significant Summary: The absence of a DSL for facilitating the correct creation of QoS (in QoS classes such as: TopicQos, DataWriterQos, etc.) in the dds-psm-java not only makes QoS manipulation cumbersone, but it also introduces potential for errors. [Resolution] Define a QoS DSL for the dds-psm-cxx which might look like this: TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable(), Durability.Transient()); This is also legal: TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable()) .with(Durability.Transient()); - These class should implement the Comparable interface as they need to provide a total order... Otherwise how can one do RxO? Resolution: Revised Text: Actions taken: September 7, 2011: received issue Discussion: [Angelo] Proposal: Define a QoS DSL for the DDS-PSM-Java, which might look like this: TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable(), Durability.Transient()); This is also legal: TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable()) .with(Durability.Transient()); Resolution: Defer this issue. It was filed after the comment deadline, and its resolution will be coupled to those of issues #15966 and #16529. Because of this complexity and the short time available, it is not possible to resolve it effectively at this time. Disposition: Deferred End of Annotations:===== m: Angelo Corsaro Subject: [DDS-PSM-JAVA ISSUE]: QoS DSL Needed Date: Wed, 7 Sep 2011 18:56:35 +0200 Cc: Juergen Boldt To: dds-psm-java-ftf@omg.org, issues@omg.org X-Mailer: Apple Mail (2.1084) [Name] Angelo Corsaro [Employer] PrismTech [eMail] angelo@icorsaro.net [Specification] DDS PSM for Java5 (DDS-PSM-Java) [Version] Beta 1 [Title] QoS DSL Needed [Nature] Architectural [Severity] Major [Description] The absence of a DSL for facilitating the correct creation of QoS (in QoS classes such as: TopicQos, DataWriterQos, etc.) in the dds-psm-java not only makes QoS manipulation cumbersone, but it also introduces potential for errors. [Resolution] Define a QoS DSL for the dds-psm-cxx which might look like this: TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable(), Durability.Transient()); This is also legal: TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable()) .with(Durability.Transient()); - These class should implement the Comparable interface as they need to provide a total order... Otherwise how can one do RxO? -- Angelo Corsaro, PhD Chief Technology Officer PrismTech 4 rue Angiboust | 91460 Marcoussis | France T +33 1 69 01 53 54 | M +33 6 42 30 75 65 ------------------------------------------------------------------------------------------------------------------ http://icorsaro.net | http://twitter.com/acorsaro | http://slideshare.net/angelo.corsaro ------------------------------------------------------------------------------------------------------------------ X-Virus-Scanned: amavisd-new at rti.com From: Sumant Tambe To: Angelo Corsaro CC: "dds-psm-java-ftf@omg.org" Date: Tue, 9 Oct 2012 23:03:58 -0700 Subject: Clarification needed on Issue #16536 QoS DSL Thread-Topic: Clarification needed on Issue #16536 QoS DSL Thread-Index: Ac2mqh2sqc+KxiaCSqmqYSlOB/7tDA== Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Hi Angelo, I.m looking for some clarification on this issue. You are proposing to add a QoS DSL like below. TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable(), Durability.Transient()); TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable()) .with(Durability.Transient()); My questions to you are: 1. Reliability, Durability, etc. are interfaces. Interfaces don.t have static methods so the above syntax won.t work. 2. It is not clear how the TopicQoS (in general EntityQoS) object is created in this context. Did you mean to call the with(...) method on a qos object obtained from an entity? For instance, domainParticipant.getDefaultTopicQoS.with(.)? 3. If an object is intended instead of the class, the overall result looks quite verbose. For instance, TopicQos defaultTopicQoS = domainParticipant.getDefaultTopicQoS(); TopicQos topicQos = defaultTopicQos.with(defaultTopicQos.getReliability().Reliable()); Is that intended? The DSL provides next to no help for syntax completion when .with(.) is used. Thanks, Sumant Sumant Tambe, Ph.D. Senior Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to:x-mailer:x-gm-message-state; bh=V1HHMs9NO/kJj6XRaayJibCRYRzi6diHFTNtc/1hPLY=; b=M0IG/4FBOIjRNZ2bvWJp9fArSc/RQOBqwUqVsRlg7Rh6edaOMqoUJHwZ5iSbnfNLr4 LmYjpZhkubwbPDObTxMyc8P56UClUiLqcjtkAuadThorveYPznQ6HSatTczQ5vlie8xU RPNggEY5mq9hWE571Z0JathrRQP5kKGqnNJmXAjWrZu+ISLMTPffzSufPwEFdFYsyf48 +moBhLLsfF5xrxqP2GKMc4R6ht5vIrqGBWnkHjoPqime0jL8RfWNMRr9NHHO3Dplw5V6 o7Cc0n4tf1OLaDGsUNt60cOG6UvNnI4SV5KhNJmw+HfYMcvegmBxZr1Hc3Nf0uwRBSi3 vLRA== Subject: Re: Clarification needed on Issue #16536 QoS DSL From: Angelo Corsaro Date: Wed, 10 Oct 2012 10:03:53 +0200 Cc: "dds-psm-java-ftf@omg.org" To: Sumant Tambe X-Mailer: Apple Mail (2.1499) X-Gm-Message-State: ALoCoQmocsT7tU+JvyghnMM7JGSnoUYApRhVv7spwoT9R8h6Jd1VPrx9fbwf1q5Xw7e5aMq47CeO Hello Sumant, On Oct 10, 2012, at 8:03 AM, Sumant Tambe wrote: Hi Angelo, I.m looking for some clarification on this issue. You are proposing to add a QoS DSL like below. TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable(), Durability.Transient()); TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable()) .with(Durability.Transient()); My questions to you are: 1. Reliability, Durability, etc. are interfaces. Interfaces don.t have static methods so the above syntax won.t work. This was assuming that we would get rid of the horrifying Bootstrap. You can take a look at simd-java on https://github.com/kydos/simd-java to for an example implementation of this DSL. 2. It is not clear how the TopicQoS (in general EntityQoS) object is created in this context. Did you mean to call the with(...) method on a qos object obtained from an entity? For instance, domainParticipant.getDefaultTopicQoS.with(.)? The default ctor constructs a default QoS as per the DDS spec. If you want to get the QoS settings from a specific entity you would do as follows: dp.getDefaultTopicQos().with(Durability.Transient) Notice that the QoS are values, thus cannot be muted. 3. If an object is intended instead of the class, the overall result looks quite verbose. For instance, TopicQos defaultTopicQoS = domainParticipant.getDefaultTopicQoS(); TopicQos topicQos = defaultTopicQos.with(defaultTopicQos.getReliability().Reliable()); Not sure what you are trying to do above. Recall that QoS as well as policies are values thus immutable. As such you could just be using the default topic QoS. Is that intended? The DSL provides next to no help for syntax completion when .with(.) is used. Not sure, take a look at simd-java on Eclipse, the syntax completion works quite well. Cheers, Angelo -- Angelo Corsaro, PhD Chief Technology Officer PrismTech 4 rue Angiboust | 91460 Marcoussis | France T +33 1 69 01 53 54 | M +33 6 42 30 75 65 ------------------------------------------------------------------------------------------------------------------ http://icorsaro.net | http://twitter.com/acorsaro | http://slideshare.net/angelo.corsaro ------------------------------------------------------------------------------------------------------------------ X-Virus-Scanned: amavisd-new at rti.com From: Sumant Tambe To: Angelo Corsaro CC: "dds-psm-java-ftf@omg.org" Date: Thu, 11 Oct 2012 15:18:41 -0700 Subject: RE: Clarification needed on Issue #16536 QoS DSL Thread-Topic: Clarification needed on Issue #16536 QoS DSL Thread-Index: Ac2mvdAWJAPuXBmVSWKlJM4xgzYpJgBPI0uQ Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Hi Angelo, I looked at simd-java. Creating instances of qos policies is possible only when concrete implementations are provided (as in simd-java). However, the approach taken by in the Java PSM is to provide interfaces only. For example, Reliability is an interface and not a concrete class. Therefore, no objects can be created unless a factory or getDefaultQoS method is used. The specification forbids direct creation of Qos policies. According to section 7.2.5.2: .The contents of a QoS object are only meaningful in relation to the current QoS or default QoS of some Entity or group of Entities. Therefore, these objects cannot be created directly; they can only be cloned from pre-existing state maintained by the Service implementation.. OMG point of view it makes sense to provide only the interfaces so that vendors are free to implement the interfaces as they like. However, I don.t see how the QoS DSL could be implemented with just interfaces. I don.t think OMG would be interested in standardizing implementations of Qos policies because that would thwart innovation. It also makes using vendor-specific extensions difficult. Thanks, Sumant Sumant Tambe, Ph.D. Senior Software Research Engineer 408.990.7429 sumant@rti.com www.rti.com From: Angelo Corsaro [mailto:angelo.corsaro@prismtech.com] Sent: Wednesday, October 10, 2012 1:04 AM To: Sumant Tambe Cc: dds-psm-java-ftf@omg.org Subject: Re: Clarification needed on Issue #16536 QoS DSL Hello Sumant, On Oct 10, 2012, at 8:03 AM, Sumant Tambe wrote: Hi Angelo, I.m looking for some clarification on this issue. You are proposing to add a QoS DSL like below. TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable(), Durability.Transient()); TopicQos topicQos = (new TopicQos()) .with(Reliability.Reliable()) .with(Durability.Transient()); My questions to you are: 1. Reliability, Durability, etc. are interfaces. Interfaces don.t have static methods so the above syntax won.t work. This was assuming that we would get rid of the horrifying Bootstrap. You can take a look at simd-java on https://github.com/kydos/simd-java to for an example implementation of this DSL. 2. It is not clear how the TopicQoS (in general EntityQoS) object is created in this context. Did you mean to call the with(...) method on a qos object obtained from an entity? For instance, domainParticipant.getDefaultTopicQoS.with(.)? The default ctor constructs a default QoS as per the DDS spec. If you want to get the QoS settings from a specific entity you would do as follows: dp.getDefaultTopicQos().with(Durability.Transient) Notice that the QoS are values, thus cannot be muted. 3. If an object is intended instead of the class, the overall result looks quite verbose. For instance, TopicQos defaultTopicQoS = domainParticipant.getDefaultTopicQoS(); TopicQos topicQos = defaultTopicQos.with(defaultTopicQos.getReliability().Reliable()); Not sure what you are trying to do above. Recall that QoS as well as policies are values thus immutable. As such you could just be using the default topic QoS. Is that intended? The DSL provides next to no help for syntax completion when .with(.) is used. Not sure, take a look at simd-java on Eclipse, the syntax completion works quite well. Cheers, Angelo -- Angelo Corsaro, PhD Chief Technology Officer PrismTech 4 rue Angiboust | 91460 Marcoussis | France T +33 1 69 01 53 54 | M +33 6 42 30 75 65 ------------------------------------------------------------------------------------------------------------------ http://icorsaro.net | http://twitter.com/acorsaro | http://slideshare.net/angelo.corsaro ------------------------------------------------------------------------------------------------------------------