Skip to content

New storage API#276

Merged
ForNeVeR merged 10 commits into
developfrom
feature/storage-refactor
Feb 18, 2015
Merged

New storage API#276
ForNeVeR merged 10 commits into
developfrom
feature/storage-refactor

Conversation

@ForNeVeR
Copy link
Copy Markdown
Member

I've created the more safe storage API. It uses the new flexible and safe paradigm: DAOs (now they're called "repositories") may implement any number of any methods they want (previously they have to implement predefined generic method set: store, read, delete). Callers should pass lambdas to the storage and it will execute these lambdas against newly created repository objects.

To bind repositories to DBSessions I've implemented all of them as case classes accepting DBSession as parameter. It also helps to better isolate query contexts and to eliminate any possible DAO pool poisoning.

This pull request also eliminates many compiler warnings on generic type casting.

Closes #139.

@ForNeVeR
Copy link
Copy Markdown
Member Author

cc @rexim, @folex

@ForNeVeR
Copy link
Copy Markdown
Member Author

And cc @ttldtor also :3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Several calls of .map in a row is discouraged and may lead to unexpected behaviour.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What kind of unexpected behavior may happen?

@rexim
Copy link
Copy Markdown
Member

rexim commented Feb 17, 2015

Nothing critical was noticed. I approve that shit! \o/

@ForNeVeR
Copy link
Copy Markdown
Member Author

Thanks for the review, guys, we're moving that shit to production!

ForNeVeR added a commit that referenced this pull request Feb 18, 2015
@ForNeVeR ForNeVeR merged commit 97946d8 into develop Feb 18, 2015
@ForNeVeR ForNeVeR deleted the feature/storage-refactor branch February 18, 2015 15:02
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

Successfully merging this pull request may close these issues.

Refactor storage

3 participants