In this case I agree with Yegor's approach. Most of the times when dealing with I/O you have a Reader class and a Writer class (like Java does: FileReader, FileWriter). I think it is the best approach in terms of separation of concerns.
What I would expect from the class AwsOcket is to be some kind of simplified interface that actually dellegates the implementation of the read() and write() methods in proper classes.
Maybe you're right. However, if the reading and write operations are separated into two classes, the overall dependency degree of a client will be increased without any reason.
This fact makes me prefer the solution that uses a single type that exposes both the reading and write operations.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In this case I agree with Yegor's approach. Most of the times when dealing with I/O you have a Reader class and a Writer class (like Java does: FileReader,
FileWriter). I think it is the best approach in terms of separation of concerns.
What I would expect from the class AwsOcket is to be some kind of simplified interface that actually dellegates the implementation of the read() and write() methods in proper classes.
Good post! Thank you
Maybe you're right. However, if the reading and write operations are separated into two classes, the overall dependency degree of a client will be increased without any reason.
This fact makes me prefer the solution that uses a single type that exposes both the reading and write operations.