Lye - a COM to SOAP gateway...

Alex Martelli aleaxit at yahoo.com
Thu Sep 14 06:49:13 EDT 2000


"Andrew Dalke" <dalke at acm.org> wrote in message
news:8ppaio$u6d$1 at slb3.atl.mindspring.net...
    [snip]
> Thanks!  And of course, Python and its various libraries make it
> extremely simple.  There's no way I could have gone from zero (no
> COM server experience) to working gateway in a day using VB or C++.

Python IS truly awesome at times...!-)


> >You can take various tacks, but a read-only indexed property
> >is what I've found smoothest, rather than a factory-method.
> >
> >In VB, that would look like:
> >    set soap = factory.Soap("whatever")
>
> I think you are right.  That does appear more natural.  Plus,
> during development I was having problems remembering if it was
> "make" or "create", and having no name is easier to remember.

Yep... you still have a choice to make it a method, or a
read-only indexed property.  The difference is slight, and
minute.  A VB duffer (having connected to a, sadly hypotetical,
typelibrary:-) could mistakenly:

    call factory.Soap("foobar")

if Soap was a method, thinking, erroneously, that he does
not need the return-value -- which is actually the whole
point.  With a read-only indexed property, VB should be able
to steer him away from this error -- it knows it can't be
"call"'ed, but must be used to set a result.  Maybe VB would
be able to do that even without a typelibrary (I'm not sure),
at least in this case by giving an appropriate runtime error.


> Actually, I'm thinking of using the factory object as a simple
> service locater, so 'factory.Service("xmethods-Temperature")'
> returns, say, the SOAP interface to the weather lookup service
> mentioned at http://www.xmethods.com/ .  If I knew what it was
> talking about.  :)

A very good idea, it seems to me.


Alex






More information about the Python-list mailing list