[Zope-dev] Declaring interfaces for Products

Dario Lopez-Kästen dario@ita.chalmers.se
Mon, 10 Sep 2001 16:24:33 +0200


Hello!

I am making a product using the Interface approach described in the ZDG.

As I understand it, Interfaces should expose all methods that provide
funtionality for my product, with the possible exception of internal methods
used as utility methods in the class itself. Is this correct?

Apart from using security declarations, I want to make some of the methods
available thru the web (TTW), and some of the methods not publishable TTW.
In order to be able to publish a method TTW, they need to have a docstring,
right?

Now, in my interface defintion I want to provide doc-strings for all methods
that are exposed (the interface), but not all them are to be publishable
TTW. Can I achieve this by using docstrings for my methods in the Interface,
but not in the Implementation, or do I need to omit the doc-string in both
the Interface and the Implementation?

Example of what I mean:

--<begin sample code>--

<<<file: ya_UserFolder.py>>>

class ya_UserFolder(Base):
    "Yet another User Folder Interface"

    def getUserName(self):
        "Provide a lusername"
    ...
    def authenticate(self, password, request):
        "Authenticate a luser"
    ...

<<<file: ya_UserFolderProduct.py>>>

from ya_UserFolder import ya_UserFolder

class ya_UserFolderProduct(...):
    "Yet another User Folder Product Implementation"

    __implements__ = ya_UserFolder

    def getUserName(self):
        "Provide a lusername - has doc-string TTW Callable"
    ...
    def authenticate(self, password, request):
        # No doc-string, not callable TTW
    ...

--<end sample code>--


Thanks,

/dario

- --------------------------------------------------------------------
Dario Lopez-Kästen     Systems Developer  Chalmers Univ. of Technology
dario@ita.chalmers.se  ICQ will yield no hits    IT Systems & Services