WebAPI-DBIC icon indicating copy to clipboard operation
WebAPI-DBIC copied to clipboard

Generate Resource classes as .pm files to enable reuse

Open ungrim97 opened this issue 11 years ago • 1 comments

Currently all resources are created in memory as Web::Machine subclasses. There should likely be a Schema::Loader style option to output these for future use/modification into a specific directory.

So for a DBIC Schema: MyApp/Schema/Result/Artist

There would be a corresponding MyApp//Resource/Artist MyApp//ResourceSet/Artist

These could likely also provide some override features such as url path etc.

WAPID should then load all modules in this directory and create the required Dir assuming ResourceSet to be an extension of Resource with required defaults.

This should have the added side effect of reducing start up time in WAPID, though adding a "Load on the fly" option is probably desirable.

Relates to #18.

ungrim97 avatar Dec 05 '14 16:12 ungrim97

Resource classes should:

  • Extend a base class
  • Allow provision for:
    • path part
    • Resultsource
    • Writability
    • Invokability
    • Field mappings
  • Have api invokable methods?

Sensible defaults should be provided in the base class based on existsing behaviour

ungrim97 avatar Dec 07 '14 17:12 ungrim97