[ 
https://issues.apache.org/jira/browse/GEOMETRY-23?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16662097#comment-16662097
 ] 

Gilles commented on GEOMETRY-23:
--------------------------------

{quote}conciseness of the API
{quote}
It is a valid argument, but up to a point: Java's API and coding conventions 
have been verbose from the outset; hence shortening {{CartesianVector3D}} to 
{{Vector3D}} is not going to have a noticeable impact, proportionately.
{quote}keep {{Vector3D}} as-is but document that it represents points and 
vectors in Cartesian coordinates.
{quote}
This is suboptimal from all POVs (except the keystroke saving one); what 
bothers me most, as noted already, is that it is not correct: The name does not 
correspond to the mathematical concept.
 Clarity of the purpose is quite important in the long term (you don't even 
want to have to direct everyone to the documentation for an explanation as to 
why confusion was deemed acceptable...). ;)

A compromise would be to rename {{Vector3D}} to {{Cartesian3D}}. Indeed,
 * it is shorter
 * it is correct (for both "vector" and "point")
 * it is self-documenting
 * it leaves room for other implementations/representations as first-class 
citizens (a potential {{Spherical3D}} would be on the same footing, code-wise, 
as it is mathematically)

> Remove Euclidean Point Classes
> ------------------------------
>
>                 Key: GEOMETRY-23
>                 URL: https://issues.apache.org/jira/browse/GEOMETRY-23
>             Project: Apache Commons Geometry
>          Issue Type: Improvement
>            Reporter: Matt Juntunen
>            Priority: Major
>              Labels: pull-request-available
>
> Based on discussion of the current Point/Vector API in GEOMETRY-14 and 
> research into other geometric libraries, I think we should remove the 
> Euclidean Point?D classes and make Vector?D also implement Point. This will 
> end up being similar to the previous commons-math design but avoids the issue 
> raised in MATH-1284 since the Point and Vector interfaces are not related. 
> They just happen to be implemented by the same class, which we're calling 
> Vector?D since a vector can be used to indicate a point (by adding it to the 
> origin).
> In the course of trying this out this design, I ended up removing 7 classes 
> and simplifying several methods. I think that's a good indicator that this is 
> a good design choice.
>  
> Pull request: https://github.com/apache/commons-geometry/pull/15



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to