weenhanceit / autism-funding

A Web App to Help Manage BC Autism Funding
MIT License
0 stars 0 forks source link

Preferences #30

Closed lcreid closed 8 years ago

lcreid commented 8 years ago

We've already identified that we should preserve the state of the collapsed or expanded panels, and the currently selected fiscal year for each child. There will almost certainly be other preferences that need to be captured, and this is something that we need for almost any application.

There are options for how to remember, with their different characteristics:

It's hard to predict what information will be needed for each preference, so ideally we'll use a fairly flexible format to represent the actual preference information. Given that we're working on web apps in Rails, JSON seems the obvious choice.

The other part is to define a Ruby interface to the preferences mechanism. Ideally this interface is relatively independent of the underlying implementation of persistence. Also, it would be nice to define the interface in such a way that it reduces the chance of different people using the same preference key. For example, the actual keys should be private to the class or module, so programmers have to go to that file to add new keys. This would increase the chance that they look at the old keys.

lcreid commented 8 years ago

A scarecrow (straw person) design:

lcreid commented 8 years ago

Of course, there are implementations out there:

lcreid commented 8 years ago

@philcarrillo had a great suggestion: Keep the defaults in the database so they can easily be changed. This fits the idea that you should be able to change things without a deploy, but may break the model that all system behaviour should be tracked in git and/or your deployment pipeline, depending on how you implement it.

I'm sure there are a myriad of blog posts out there about this, but I haven't tried to track any down. The discussion shares some characteristics with feature toggles (http://martinfowler.com/articles/feature-toggles.html).

Perhaps it's worthwhile proposing some criteria for evaluating the options:

philcarrillo commented 8 years ago

Actually, on reflection, the suggestion wasn't so great. The suggestion was that more than just defaults, but in fact, the behaviour of the 'preference' would be defined by data - as opposed to code. I think this suggestion would break far too many of the points raised above, including lack of simplicity, lack of traceability and may well be more difficult to implement.

philcarrillo commented 8 years ago

I have not completed anywhere near the research accomplished by the LJ Research Group - but I do get the sense that this little side track could threaten to become a major distraction and therefore I would express strong support for the criteria for evaluating options outlined above.

philcarrillo commented 8 years ago

It may be useful to list the present set of 'preferences', as they are fairly limited at this time.

These are:

(Note, since this comment represents the "specification" for preferences for this app, changes should be made by modifying this comment)

philcarrillo commented 8 years ago

Given the above immediate requirements, here are some comments: