Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Commit

Permalink
provide some documentation on interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed Jan 9, 2017
1 parent 643001e commit 42428ff
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Contents:
applications
addons
services
interfaces
migrations
behavior
commands
Expand Down
22 changes: 22 additions & 0 deletions docs/source/interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Interfaces

`plone.server` uses interfaces to abstract and define various things including
content. Interfaces are useful when defining api contracts, using inheritance,
defining schema/behaviors and being able to define which content your services
are used for.

In the services example, you'll notice the use of `context=ISite` for the service
decorator configuration. In that case, it's to tell `plone.server` that the
service is only defined for a site object.

## Common interfaces

Interfaces you will be interested in defining services for are:

- `plone.server.interface.IDatabase`: A database contains the site objects
- `plone.server.interface.ISite`: Site content object
- `plone.server.interface.IResource`: Base interface for all content
- `plone.server.interface.IContainer`: Base interface for content that can contain other content
- `plone.server.interface.IRegistry`: Registry object interface
- `plone.server.interface.IDefaultLayer`: Layers are an interface applied to the
request object. IDefaultLayer is the base default layer applied to the request object.

0 comments on commit 42428ff

Please sign in to comment.