General mailing list for discussions and development of PeerLibrary and related software.

List archive Help


Re: [PeerLibrary dev] PeerDB vs. Meteor collection queries


Chronological Thread 
  • From: André Gaul < >
  • To:
  • Subject: Re: [PeerLibrary dev] PeerDB vs. Meteor collection queries
  • Date: Wed, 06 Aug 2014 14:02:59 +0200

Hey Mitar,

thx for your reply!

Am 05.08.2014 um 01:03 schrieb Mitar:
> Many things are easy in Meteor, but because of that the main
> complications is how you define publish endpoints (what you push to the
> client) and then how and when you subscribe to that. Most of complicated
> logic is then there. For example, it becomes really complicated when you
> have multiple related documents and you have to publish based on them.
> One typical example is, pushing publications based on person's
> permissions. As permission changes, you have to push different publications.
...
> The question of what is available on the client side you solve with
> publish endpoints and subscriptions and is orthogonal to the question of
> queries. You probably have some other issue in between why first query
> works for you and second does not.
...
> Server pushes two types of documents to the client. One is a list of
> publication documents, that is, search results themselves. Each of those
> publications have a special additional client-only (not stored in the
> database) field searchResult which points to the second pushed document,
> SearchResult instance. SearchResult instance is used on the client to
> determine which of all publications available on the client belong to
> the given search query.

I've been using REST APIs for a while. With such an API, it's very
simple to make an ad hoc query: you start an HTTP request and feed the
answer into your model/collection (which is rendered).

How's the corresponding work flow for an ad hoc query with
Meteor/PeerDB? For example: how would you implement a search of Persons
with a given name?

The code you mentioned for the publication search is >200 lines and
appears to be very complex (given the quite simple task). I really hope
that Meteor provides an easier way for implementing a simple ad hoc
Person search. :)

>> > 4) Are the global variables (such as Publication) defined for debugging
>> > purposes or are they actively used?
> They are actively used all around the code. This is the main way how you
> access data, through documents classes.

Aren't global variables the root of all evil? ;) They definitely make
the code unstructured and hard to read...


cheers from Berlin,
André


--
Homepage http://page.math.tu-berlin.de/~gaul
github https://github.com/andrenarchy
Twitter https://twitter.com/#!/andrenarchy
Diaspora https://diasp.org/u/andrenarchy
(you won't find me on facebook!)
Jabber

PGP Key 0x0FA9170E



Archive powered by MHonArc 2.6.18.

Top of page