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

Implement This As A Strategy Pattern #57

Open
phidias51 opened this issue Jul 15, 2016 · 2 comments
Open

Implement This As A Strategy Pattern #57

phidias51 opened this issue Jul 15, 2016 · 2 comments

Comments

@phidias51
Copy link

Since the development process often starts by using static JSON files before migrating to other forms of storage, it would be useful if this were implemented as a strategy pattern, with the ability for the developer to switch back and forth between implementations. Something like:

<app-storage config-name="cache+firebase" config="myapp-config.js"></app-storage>

The config file would let you have different named configurations.

[{
  "name":"cache+firebase",
  ... caching config
  ... firebase config
},
{
  "name":"cache+file",
  ... caching config
  ... file config
}
]
@cdata
Copy link
Contributor

cdata commented Jul 20, 2016

Hi, thanks for the suggestion. Could you provide a more detailed description of the strategy pattern, or perhaps link to some relevant literature that you think speaks to how it could be applied here?

@phidias51
Copy link
Author

@cdata Here's some information on Strategy Patterns. https://en.wikipedia.org/wiki/Strategy_pattern

In a nutshell, I want to be able to easily switch between different storage strategies. For example, suppose I have a configuration called "dev" that lets me use local JSON files for early development work. Once I'm satisfied with that, I might switch to "stage" mode, where I use a firebase database. What the modes are called should be completely configurable, and there should be some way of a doing a global switch from one mode to the other. Perhaps there might be some global application parameters for this.

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

2 participants