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

Add View Types for mapping from the ICalSpec types #3

Open
danielPerez97 opened this issue Jun 15, 2020 · 0 comments
Open

Add View Types for mapping from the ICalSpec types #3

danielPerez97 opened this issue Jun 15, 2020 · 0 comments

Comments

@danielPerez97
Copy link
Owner

Currently, the view(namely QRDialog.java and CardsAdapter.java) are tightly couples with the ical types. The ical types are not necessarily View types, they can be used however. I can see us running into issues with this at the moment. I propose making types specifically meant for the View layer, and leaving the ical types for the implementation layer, and the viewmodel is to map them in between.

Consider QRDialog's constructor: It requires a context(perfectly fine), a QrBitmapGenerator(maybe fine), and a FileManager type(probably not fine). Internally, it has member variables that use ICalSpec and EventSpec types. Go ahead and make a ViewEvent/ViewICal that has ONLY the data you need to view, and keep it as a primitive type. Assume we can map over from the EventSpec and ICalSpec so as to leave things decoupled. This way, you don't have to assume the ICalSpec will have the data you need and you won't need to manually yank from implementation details( ical.getEvents().get(0) ).

I'll move the ical package into it's own library that addresses 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

1 participant