doc/book/en/development/entityclasses/interfaces.rst
branchstable
changeset 5144 5a09bea07302
parent 4936 a4b772a0d801
equal deleted inserted replaced
5143:43afbdd5c8b4 5144:5a09bea07302
     1 Interfaces
     1 Interfaces
     2 ----------
     2 ----------
     3 
     3 
     4 Same thing as object-oriented programming interfaces.
     4 This is the same thing as object-oriented programming `interfaces`_.
       
     5 
       
     6 .. _`interfaces`: http://java.sun.com/docs/books/tutorial/java/concepts/interface.html
     5 
     7 
     6 Definition of an interface is quite trivial. An example from cubicweb
     8 Definition of an interface is quite trivial. An example from cubicweb
     7 itself (found in cubicweb/interfaces.py):
     9 itself (found in cubicweb/interfaces.py):
     8 
    10 
     9 .. sourcecode:: python
    11 .. sourcecode:: python
    15 
    17 
    16         def children(self):
    18         def children(self):
    17             """returns the item's children"""
    19             """returns the item's children"""
    18 
    20 
    19         def children_rql(self):
    21         def children_rql(self):
    20             """XXX returns RQL to get children"""
    22             """returns RQL to get children"""
    21 
    23 
    22         def iterchildren(self):
    24         def iterchildren(self):
    23             """iterates over the item's children"""
    25             """iterates over the item's children"""
    24 
    26 
    25         def is_leaf(self):
    27         def is_leaf(self):