TCPConnection

Issue #54 closed
Soo Han created an issue

I know the code is tested and is functional. So this is awkward for me to say.

The constructor for TCP connection is doing alot here, creating the object itself and registering compression managers by creating a closure. Perhaps a Factory pattern is better suited here. I know Java 8 allows cool syntactic sugar, but creation and registration are two different actions and should be written as such. I see the convenience of scoped variable inputStream, and outputStream but it may be better of as a parameter to be passed within a Factory pattern, where Connection and registration of compression manager is done.

Comments (4)

  1. Markus KARG

    Does it really make any sense to be able to create uninitialized TCPConnections? I would assume that it actually just opens the possibility to induce hard to track failures by uninitialized connections.

  2. Christian Schudt repo owner

    Compression and Stream Management are optional anyway. Furthermore this is all package-private stuff, so I don't see any harm here.

  3. Log in to comment