hi!
there are three things about the way RemoteStorageJs 0.7 is set up,
that i guess i didn't document very well so far:
1) pretend there is no server. when writing an app or module, you
should not think about what goes on on the wire or at the remote
storage server. The data source you are interacting with directly is
the local cache. The binding to the remote copy is only asynchronous,
and does not even necessarily exist.
2) public data is just web data, on URLs. after me resisting this for
a long time at first, we made a decision to make a remote storage
server act as a read-write web server that allows you to publish
content on proper URLs on the web. So when you read public data from
some other user's remote storage, this is just like reading data from
any other web server, and it should be addressed by URL. There will be
a function getCurrentUrl() on the baseClient, so that modules can
easily convert public paths to URLs whenever they are connected,
online, and synced. Also note that the public baseClient is specific
per module, e.g. if module 'my-module' publishes item 'my-item', then
it will be published as {storageRoot}/public/my-module/my-item (with
the module name in there) and not as {storageRoot}/public/my-item
3) all reusable business logic belongs in the module, not outside it.
If your app adds a 'hair colour' attribute to contacts, with a method
getHairColour() etcetera, then that code belongs in the contacts
module. If your app does something that isn't covered by any of the
existing modules, then you should add a new module. we should probably
make it easier to add and extend modules, e.g. provide a web form
where you can squat a module name or method name, and then probably
allow people to maintain modules outside the central repo. I guess we
should look at how npm and other numerous module/package management
systems do it. We can devote a session to this next week at
http://2012.unhosted.org/
Looking forward to seeing some of you in Unhost in a few days! I hope
to cycle there tomorrow if it stops raining. I talked to someone of
Pension Irena
http://www.penzion-irena-unhost.az-ubytovani.net/accommodation.htm
(i guess it was Irena herself), and she said there would be enough
room for us, and free wifi, so if we traffic some ClubMate there from
Berlin, we should have a very enjoyable and unorganized Unhosted Web
Apps Summit 2012, unhosted in Unhost next week! :)
Ciao,
Michiel