[
https://issues.apache.org/jira/browse/SSHD-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14386285#comment-14386285
]
Goldstein Lyor commented on SSHD-436:
-------------------------------------
I have reviewed the proposed change
(https://github.com/gnodet/mina-sshd/commit/b24b3a23552d67202d8087e207a4dc1374cade81).
My reservations are as follows:
- The names of the factories should be literal constants - e.g.,
{code:java}public static final String SOME_NAME="aes256-ctr"{code}. This is so
that others may use the names (do-not-repeat-yourself principal). If we use a
straight _Enum_ I don't see how we can achieve this easily (it is possible with
some "gymnastics" but the code would look ugly...)
- While it is unlikely, someone might want to override one of the factories or
the implementation classes. It is much easier to do so using the current
classes than if they are encapsulated in _Enum_(s) since _Enum_(s) are
*final*...
- The changes as I proposed them are more backward compatible...
That being said, if we find some good solution for the above (especially the
literal constant issue) I am not against it...
> Use as much as possible common code for client and server KEX
> -------------------------------------------------------------
>
> Key: SSHD-436
> URL: https://issues.apache.org/jira/browse/SSHD-436
> Project: MINA SSHD
> Issue Type: Improvement
> Affects Versions: 1.0.0
> Reporter: Goldstein Lyor
> Attachments:
> 0038-SSHD-436-Use-as-much-as-possible-common-code-for-cli.patch,
> SSHD-436.patch
>
>
> The idea is that the basic KEX mechanism is almost the same for client and
> server - there are some differences in the messages they send and the way
> they choose the KEX parameters (_p_, _g_ values). The attached patch contains
> the following changes:
> * The common code has been moved to _org.apache.sshd.common.kex_
> * The respective _org.apache.sshd.client.kex_ and
> _org.apache.sshd.server.kex_ packages contain only the *differences*
> * The built-in KEX mechanisms have been encapsulated into an _enum_, and the
> logic of whether they are supported by default has been attached to each
> specific enum value
> * The setup of the client/server now uses a *common* initializer in order to
> avoid code duplication.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)