Skip to content

A proposed SQLite data access layer (DAL)#2

Open
mahmoud wants to merge 5 commits intomasterfrom
bad_sql_dal
Open

A proposed SQLite data access layer (DAL)#2
mahmoud wants to merge 5 commits intomasterfrom
bad_sql_dal

Conversation

@mahmoud
Copy link
Owner

@mahmoud mahmoud commented Nov 22, 2015

NB: This is a staged pull request, full of bad code (hence the branch name), so that we can see how some Python antipatterns manifest. I'll be playing the part of both the submitter and the reviewer, but the submitter (starting with the message following the italics) will write in quotes.

"I really like the LineDAL's JSONLines approach, and saw there was a stubbed out version of a SQLite implementation, so I am submitting this proposed implementation. I'm new to Python, so please let me know what you think."

@mahmoud
Copy link
Owner Author

mahmoud commented Nov 22, 2015

Wow! Thank you! Unfortunately, as it stands, I see many issues with this code. The interface is correct, but there are many antipatterns in play that would hurt immediate usability, as well as long-term maintainability. Please see my comments inline.

Overall a good effort, though, and if you make the changes in future PRs, your code is sure to be accepted! Thanks again!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be an unused import, and while built-in, can set the wrong expectation for the following code.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike Java and C++, class instance members do not need class-level declarations. extension is a true class-level attribute, but this attribute is destined to be overridden in __init__. This line should be removed.

@mahmoud mahmoud changed the title A proposed SQLite DAL A proposed SQLite data access layer (DAL) Apr 14, 2016
Repository owner locked and limited conversation to collaborators Apr 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant