|
From: Sandro M. <naa...@gm...> - 2006-02-03 21:27:54
|
On 2/3/06, Sandro Magi <naa...@gm...> wrote:
>
>
> Unfortunately, it's not an entirely clear intro to the web-calculus for
> beginners; it hits you with too much at once (dynamically generated
> "objects" and the "missing" classes, revocation, deputization and authori=
ty
> management, etc.). We need a "hello world!" type example. I suggest an
> incrementing counter:
>
> public class Counter {
> int current;
> public int getCurrent() {
> return current;
> }
> public void add(int i) {
> current +=3D i;
> }
> }
>
> As useless as this really is, it focuses on the core fundamentals:
>
> 1. web-calculus doc serialization of a class
> 2. generating a schema from a class definition
> 3. generating a custom stylesheet for a schema
> 4. invoking a method via POST
> 5. idempotency of GET and non-idempotency of POST
> 6. how the waterken server marshals arguments for you
>
> These strike me as the fundamentals that need to be grasped in order to d=
o
> anything in the web-calculus. Thoughts?
>
So I've created the above class and loaded it from the class loader page,
ie. "java:magi.Counter" and that brings me to the following page:
https://waterken.naasking.homeip.net/wwwsandro/?key=3Dnsrd-wduu-6qll
On this page is a link to "
https://waterken.naasking.homeip.net/http/localhost/magi/Counter-class"
(which resolves to a 404), and a "new" link (which I presume is a link to
the constructor).
Clicking on "new" brings me to a page with "
http://localhost/magi/Counter-class-new<https://waterken.naasking.homeip.ne=
t/http/localhost/magi/Counter-class-new>"
and a single submit button. I presume this is the interface to invoke the
constructor.
Clicking "submit" does not appear to create any new objects on the
filesystem, though a new transient Counter appears to be created with the
appropriate 'current' value of 0.
However no additional 'permanent' object appears to be created, nor can I
invoke the "add" method on this instance. Does this object need to be
explicitly inserted into the database for any further operations?
Sandro
|