From 94e7d4cb63ee5650e9b650a0f4e1978a2f8c4887 Mon Sep 17 00:00:00 2001 From: Leevi Graham Date: Mon, 21 Oct 2013 01:07:33 +1100 Subject: [PATCH] Update README.md --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c46eef3..a30cc3f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ Naming conventions ================== -A collection of abstract naming conventions so I don't have to think about this kind of stuff anymore. +A collection of abstract thoughts and naming conventions. + +Objects +------- * `Collection`: A group of `CollectionItems`. Example: `BlogPostCollection` has many `BlogPost`s https://github.com/doctrine/collections/blob/master/lib/Doctrine/Common/Collections/ArrayCollection.php * `CollectionItem`: Belongs to a `Collection`: @@ -9,3 +12,26 @@ A collection of abstract naming conventions so I don't have to think about this * `Interval`: A repeating unit in a `Period`. Example: `P2W` http://php.net/manual/en/class.dateinterval.php * `Range`: An array of elements with a predefined set of steps * `Criteria`: Any kind of condition / clause for searches, where statements etc + +Relationships +------------- + +* Access major relationships through repository methods rather than getters. + * Smaller joins on initial object load + * Allows filtering on relationship +* Consider [preloading loading `many to one` and `one to one`](http://whitewashing.de/2013/02/19/extending_symfony2__paramconverter.html) + +URLS +---- + +* *BREAD* is preferable to CRUD. Browse, Read, Edit, Add, Delete + * Browse: GET `/projects` + * Read: GET `/projects/1` + * Edit: PATCH `/projects/1` + * Add: POST `/projects` + * Delete: REMOVE `/projects/1` +* `?page=` & `?perPage=` for url pagination params. Example: `?page=2&perPage=10` +* `?orderBy=` for sort / ordering. Example: `?orderBy=submittedAt:ASC,totalPrice:DESC`. +* `?select=` for partial responses. Example: `?select=Project.{id,title}` + * https://developers.google.com/youtube/2.0/developers_guide_protocol_partial + * http://docs.doctrine-project.org/en/latest/reference/partial-objects.html