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

Consider supporting multiple models for the same AR viewmodel #85

Open
chrisandreae opened this issue Jan 18, 2018 · 0 comments
Open

Consider supporting multiple models for the same AR viewmodel #85

chrisandreae opened this issue Jan 18, 2018 · 0 comments

Comments

@chrisandreae
Copy link
Member

This could be useful in cases where we entities that can provide substantially the same view type spread across two different models. Consider the new content system: we have both Sentence and LocalSentence, and both Word and LocalWord. Both the global and local forms have translations etc, but unless we want to deal with polymorphic associations they need to be in separate tables. It might be nice for the views to abstract over this structural difference that's only necessary for storage.

In principle we could specify the possible models for the viewmodel as a hash from parent view to model class - something like { WordView => WordTranslation, LocalWordView => LocalWordTranslation }.

We could then use deserialization parent context to select the appropriate model to deserialize a new instance into.

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

1 participant