Hi Sanjiva:
Um, did you mean to say ResourceImpl above? Otherwise how do the setter
methods below come into existence on the registry interface?
resource.setContent("hi there");
resource.setMediaType("text/plain");
resource.setDescription("A simple greeting");
registry.put("/helloWorld", resource);
Look carefully - the setters for the stuff that users need (content,
properties, etc) are there in the interface, that's the point. As a
client, you can mutate what you "own", and you can't touch what the
implementation "owns" for you.
Will rsource.getPath() return "/helloworld" after this operation?
I think so - and the various dates should be updated too.
Can I put the same resource into another location? That is, can I say
immediately after above, registry.put("/foo", resource)?
Unclear. I guess my predilection would be to say yes - it's understood
when you do a put() that things will probably change, except the "user
controllable" stuff like content and properties.
* We'd then have "ResourceImpl implements Resource", and ResourceImpl
would have all the setters - that's what gets used by JDBCRegistry.
I hate the idea of exposing a thing with the name of "*Impl" being
exposed to users. Can we come up with a better model?
Does it make more sense now? The Impl would not be exposed to users,
except those writing extensions.
--Glen
_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev