Closed etcimon closed 8 years ago
This works now by looking for methods that return a class
or interface
value. A special base class WebService
isn't needed, because this is unambiguous, at least for now. I'll close this for now, although I realize that this doesn't fully overload with everything above. Please reopen if you feel that this needs further discussion.
In theory it would be possible to have a recursive loop inside
registerWebInterface
that registers every member that inherits a common class such asWebService
, and create unique instances of the members while visiting the tree from the bottom up.router.registerWebInterface!(settings, Blogs)
-> createsArticles
,Users
,OAuth
,MongoDB
,Categories
object instances following class members recursively, registers them to route,settings
could have an opIndex that loads from (SDLang-D? JSON/w comments?) files in a config folder with opIndexAssign to override the values.e.g.
class Articles : WebService
will have its members checked forWebService
objects and recursively loop to register them using unique instances for the entire member tree.