[
https://issues.apache.org/jira/browse/GEOMETRY-3?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16522129#comment-16522129
]
Gilles commented on GEOMETRY-3:
-------------------------------
I've filed a report in order to get the notifications: INFRA-16679.
{quote}parse strings with the format "(r=1, az=2)"
{quote}
The flexibility goes beyond the ValJO requirement (simple one-to-one conversion
{{Object}} <-> {{String}}). For example, allowing the above representation,
there would be no argument to not also allow "(az=2, r=1)" and so on.
We should be careful not to mix the ValJO's {{String}} representation with
data interchange considerations (where flexible input/output has its place of
course).
Here, IMHO, flexibility should be reduced to its minimum, and handled by the
calls to {{Double.parseDouble}} method; the rest of the format should be fixed,
and thus the name of the parameters "r" and "az" are redundant.
What must be implemented is similar to the code in {{Complex}}: an opening
"(", several numbers separated by a "," and a closing ")".
Code that converts geometrical objects built by this library to useful data
formats should be defined in a different module so that those implementations
can evolve independently. Moreover, data interchange codes could depend on
external libraries e.g. to produce platform-independent binary representations.
> Make Points and Vectors VALJOs
> ------------------------------
>
> Key: GEOMETRY-3
> URL: https://issues.apache.org/jira/browse/GEOMETRY-3
> Project: Apache Commons Geometry
> Issue Type: Improvement
> Reporter: Matt Juntunen
> Assignee: Matt Juntunen
> Priority: Minor
>
> Ensure that all Point and Vector classes meet the requirements for being
> VALJOs as described here:
> [http://blog.joda.org/2014/03/valjos-value-java-objects.html]. Some of this
> work has already been done as part of GEOMETRY-2. The classes to update are:
> * o.a.c.geometry.euclidean.oned.Point1D/Vector1D
> * o.a.c.geometry.euclidean.twod.Point2D/Vector2D
> * o.a.c.geometry.euclidean.threed.Point3D/Vector3D
> * o.a.c.geometry.spherical.oned.S1Point
> * o.a.c.geometry.spherical.twod.S2Point
> Required changes include the following:
> * Create static factory methods for creating instances using the "of" naming
> convention.
> * Make constructors private
> * Add parse methods to return instances from "canonical" toString
> representation
> * Update all uses of the class to use the factory methods instead of the
> constructor
>
> Pull request: https://github.com/apache/commons-geometry/pull/4
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)