serializable object references
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Sun Apr 22 20:27:13 EDT 2007
En Sun, 22 Apr 2007 12:47:10 -0300, Martin Drautzburg
<Martin.Drautzburg at web.de> escribió:
> I was thinking that it would be nice if a web application could talk to
> real objects. The client side does not need to know the internals of an
> object, it acts as a "view" for server-side models. All it has to be
> able to do is invoke methods on "its" model. So a view could just
> store "its" object-reference in an instance variable and pass it to the
> server, where my problem of looking it up comes in.
This is more or less what several web frameworks do. You publish objects;
URLs are mapped to method objects; URL parameters become method
parameters. See http://wiki.python.org/moin/WebFrameworks
> I am currently learning about web services but my feeling is
> that "state" is not an integral part of this concept, rather an add-on,
> but I may be mistaken here.
>
> But for any reasonable web application you have to introduce state one
> way or the other. My impression is, that this is achieved with "session
> objects", which hold all the state of a session (again I may be
> mistaken). But this would be a strange concept in an OO world. You
> might as well put "ALL" state into a global "state" state object, where
> all the class methods deposit their state and classes would hold
> behavior only and no state. This is of course nothing an OO programmer
> would want to do.
You can have a "persistent" state (stored in a backend database) and
"transitory" state (kept in session objects).
--
Gabriel Genellina
More information about the Python-list
mailing list