levibostian/Wendy-Android

Improve `PendingTask` developer experience when overriding.

levibostian opened this issue · 3 comments

When you extend PendingTask, it is not easy to tell what you need to add to get it to work (some fields are optional, some do not force you to override, etc).

I want to make creating PendingTasks really easy by extending a class and get up and running fast.

The problem with this class is that I cannot mark it as abstract because of SQLite.

Maybe there is a way for me to create a PendingTask class that is saved into SQLite, have an abstract subclass of PendingTask that is designed for the improved functionality that users of the library extend instead. Anyone can extend PendingTask if they need that power but you should not need to.

Ways to improve this class:

  • Empty constructor. It's confusing having a constructor that has fields in it such as id and created_at that are only there for sqlite purposes but not used by the user.
  • [ ] Abstract functionality such as helping the user determine if their task manually runs or not. Help the subclasses understand what info Wendy needs to know about the class. You should be able to extend PendingTask and instantly get helped into creating the task. runTask() should be abstract as well.

Done. Will be added to project in the next PR from the branch big-refactor