[TransWarp] PEAK binding & naming howto

alexander smishlajev alex at ank-sia.com
Thu Mar 6 12:49:51 EST 2003


hello!

are there any recommended readings that may cast some light on the PEAK 
binding and naming techniques while the tutorial is incomplete?

if not, i would appreciate comments on the following two cases:

1. suppose i have a (global) service Spam implementing interface ISpam:

     class ISpam(Interface.Interface):
          """Spam interface"""
          def eggs():
              """provide eggs"""

      class Spam(binding.Component):
           __implements__ = ISpam
           def eggs(self):
               return "eggs"

how and when do i instantiate the Spam service object?

how do i register this service so that all components know that eggs may 
be got from that object?

2. consider application-wide utility Foo:

     class Foo(binding.Component):
          bar = "bar"
          def baz(self):
              return "baz"

is it rational to bind this utility to "/foo"?

other application components may then use the utility like this:

     class FooBar(binding.Component):
          foo = naming.lookup("/foo")

... am i right?

what bindinding function should be used in class Foo?

should foo be a property of application object?  say,

     class FooBarApp(binding.component):
          foo = binding.New(Foo)

if not, then how and when the utility object should be instantiated?

thanks in advance!

best wishes,
alex.






More information about the PEAK mailing list