Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JdbcSession.java:141-143: Refactor this class to avoid too much... #61

Open
0pdd opened this issue May 11, 2017 · 3 comments
Open

JdbcSession.java:141-143: Refactor this class to avoid too much... #61

0pdd opened this issue May 11, 2017 · 3 comments

Comments

@0pdd
Copy link

0pdd commented May 11, 2017

The puzzle 51-55acd5db in src/main/java/com/jcabi/jdbc/JdbcSession.java (lines 141-143) has to be resolved: Refactor this class to avoid too much coupling. For instance, CRUD operations could be performed by another class. Don't forget to remove the suppressions that become obsolete afterwards.

The puzzle was created by amihaiemil on 17-Aug-16.

Estimate: 30 minutes, role: IMP.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and
about me.

@0crat
Copy link

0crat commented May 11, 2017

@yegor256 please, pay attention to this issue

@catdog905
Copy link

@yegor256 I have a suggestion! What if we introduce new interface named Query. It will have only one method execute.

public interface Query<T> {
    T execute();
}

So Query<T> will represent some sql (or maybe nosql) query that returns some result no matter what query it is: select, insert, update or anything else.

When Query will have all implementation to cover JdbcSession functionality, we can just delete JdbcSession

@yegor256
Copy link
Member

yegor256 commented Dec 1, 2024

@catdog905 removing JdbcSession entirely sounds like a very dangerous change, since many users rely on this design. I believe, this particular puzzle is about refactoring of the class, to reduce its complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants