Originally I defined AppDescriptor and AppFactory classes in the AppFramework module, and later I defined TaskDescriptor and TaskFactory interfaces in the EMR module, as a later iteration on a similar idea. (A key improvement is that the TaskDescriptor methods take an EmrContext argument, which is necessary for interesting implementations of the isAvailable method, for example.)
There's actually a generic idea that both App and Task both extend. For lack of a better term, we're calling this Extension.
We need to introduce interfaces in the App Framework module like:
I realize that as-written these may not support the client-side model well, so let's modify as necessary.
Later we'll want ways to let modules produce multiple extensions and extension points dynamically
I noticed that I've actually written implementations of a lot of this a few years back. These live here, but they're just illustrative, not intended to be used verbatim.
In the process of doing this we should remove some of the overly-optimistic methods I put on AppDescriptor (e.g. startApp, endApp) so we start off with a very simple idea of an App, and add onto this through the work we're doing here.