propelorm/propelorm.github.com

Behavior Documentation

gossi opened this issue · 0 comments

Hey guys,

I slipped through the behavior documentation to find some information, which I didn't find at the end. I realized, there is information for two different types of people. Behavior consumers and behavior developers. However, these information are mixed up and there is no clear structure (e.g. "How to write your own Behavior" at two different locations). So I thought a little bit about restructuring this part and would also be willing to contribute some of the parts. Here is my idea on how to structure them:

Basics > Behaviors (this is for consumers) and should contain the following contents:

  • Hooks
  • Introduction to behaviors
  • Available Behaviors

    Which lists the bundled behaviors (not just the name, also a short description of what it does, the tagline) and a description on how to find more behaviors, e.g. link to user contributed behaviors (that work with propel2) and a link to search packagist (hint: https://packagist.org/search/?type=propel-behavior)
  • Using Behaviors

    Which als contains a section of customizing and applying them on a database level
  • Write your own Behavior

    A short introduction test, this is easy and a link to the "How to write your own Behavior" doc (see below).

How to write your own Behavior
This can and should be split into three parts:

  1. Explaining the API and terminology

    An explanation to all the basics and the Propel API that is available to write your own behavior. Which classes to use and to extend, getting parameters, setting defaults and also best practices, such as Object- and QueryModifier classes. Stuff that currently is available at http://propelorm.org/documentation/06-behaviors.html#writing-a-behavior. And also how to use composer for your behavior and how to publish it, to make it searchable through packagist (see link above).
  2. How to use the Propel API

    Basically stuff from here: http://propelorm.org/documentation/cookbook/writing-behavior.html
  3. Test your behavior

    That was the part I was looking for. From setting up over local development to a test-matrix on travis.

Maybe, extract the part of how to publish your behavior, give also help for the documentation and probably provide a markdown template for documentation (that can be easily used e.g. as the readme for a github-project) - see below.

This part should be located under the cookbook and the behavior section should be used to document available behaviors.

Behavior Documentation
Can there be a consistent structure, that is used across all documented behaviors to establish a reliable (and would also be part of the documentation template as mentioned above).