Design
====================

.. raw:: html

        <div class="mxgraph" style="position:relative;overflow:hidden;width:1006px;height:496px;"><div style="width:1px;height:1px;overflow:hidden;"> </div></div>
        <script type="text/javascript" src="https://www.draw.io/embed.js?s=flowchart"></script>


Key Design Aspects
------------------

Leverage plugin pattern to provide implementations for Tasks and Database. All plugins are registered as entry points within
python setup for the project.


Tasks
^^^^^

:class:`seedbox.tasks.base.BaseTask` provides the base implementation for a Task. All Tasks must implement the following methods

        * is_actionable
                if the result is True then the Task will be executed
                else skip executing the Task.
        * execute
                provides the Task specific implementation; all exceptions are handled by the BaseTask to guarantee consistent
                error handling.

The BaseTask provides the ability to include additional media files for processing, and captures telemetry (execution time)
for each Task execution.


Database
^^^^^^^^

:class:`seedbox.db.base.Connection` provides the abstract definition for the interacting with a specific database implementation.
The base capabilities include

        * connection / session creation
        * create
        * update
        * delete
        * read
        * wipe data
        * backup data
        * upgrade model/schema


.. seealso::

        * `Dynamic Code Patterns Extending Your Applications with Plugins`_
        * `SQLAlchemy`_



.. _Dynamic Code Patterns Extending Your Applications with Plugins: http://stevedore.readthedocs.org/en/latest/essays/pycon2013.html
.. _SQLAlchemy: http://www.sqlalchemy.org/
