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

Architectural refactor to move Storage behind Model #37

Merged

Conversation

thomastanck
Copy link

@thomastanck thomastanck commented Mar 2, 2019

Part of #22. We need to expose Storage to Model so that pages can be saved.

This is because we want to use the filesystem state as the canonical
representation sometimes, i.e. for article storage, which we don't want
to store in memory as the articles can be quite large.

We could simply expose the Storage to the Model as well, but doing so
results in Storage being referenced both from the outside at Logic,
and also from the inside whenever articles have to be added.

Instead we move the entire Storage behind Model for a cleaner
architecture -- now Storage should be an "implementation detail"
that the Model uses to persist itself.

This is because we want to use the filesystem state as the canonical
representation sometimes, i.e. for article storage, which we don't want
to store in memory as the articles can be quite large.

We could simply expose the Storage to the Model as well, but doing so
results in Storage being referenced both from the outside at Logic,
and also from the inside whenever articles have to be added.

Instead we move the entire Storage behind Model for a cleaner
architecture -- now Storage should be an "implementation detail"
that the Model uses to persist itself.
@coveralls
Copy link

coveralls commented Mar 3, 2019

Pull Request Test Coverage Report for Build 152

  • 42 of 42 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 94.024%

Totals Coverage Status
Change from base Build 140: 0.03%
Covered Lines: 1479
Relevant Lines: 1573

💛 - Coveralls

@thomastanck thomastanck requested a review from qjqqyy March 3, 2019 06:22
@thomastanck thomastanck added this to the v1.1 milestone Mar 3, 2019
Copy link

@epicfailname epicfailname left a comment

Choose a reason for hiding this comment

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

LGTM

@thomastanck thomastanck merged commit e7bf62d into CS2103-AY1819S2-W10-1:master Mar 3, 2019
@thomastanck thomastanck deleted the storage-to-model branch March 3, 2019 18:51
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.

None yet

4 participants