[LibX] Questions about libx

Godmar Back godmar at gmail.com
Fri Apr 28 09:24:26 EDT 2006

[ some of my reply is related to arcane Firefox/Javascript issues,
LibX users may want to skip those parts.  Other parts relate to
strategy issues for LibX. ]

On 4/28/06, Jeremy Dunck <jdunck at gmail.com> wrote:
> I'm not sure if I'm the intended audience for LibX, so tell me if I'm
> charging in the wrong direction.
> (Who is LibX for?)

LibX is for people using a library who frequently need access to that
library's resources: students, professors, and the general public.

> I can see that libx is useful, but I don't have a strong affiliation
> with any particular library.
> Would you be open to enhancements allowing libx to use any and all of
> a list of libraries?

See also http://libx.org/faq.html#QL1a

2.  Why not let users adapt the toolbar themselves?

We felt that an extension that supports a community of library users
should be offered by that community's library.

That said, since LibX is open source, developers can add this
functionality if they wish. In addition, end users can create their
own editions without consulting with their library.

You should look at the homepage libraries have created for their
editions of LibX. Go to libx.org -> Editions and click on those pages.

> This would take the config-file-compiled-to-xpi design in a different
> direction.  I think a runtime catalog of config files, with 1 or more
> selected as active, would be nice.
> No?

That's certainly possible, but would require a near-total rewrite.
We'll put our energy into the web interface, I think, because it will
look nearly
identical from a user's perspective.  (There's isn't much difference
between your idea: download libx, scroll through a list of catalogs,
press ok; vs. ours: scroll through a list of catalogs, press ok,
download libx.)  The only difference is when someone frequently wants
to change their entire configuration - an infrequent case.

Also, we'd like libraries to test their edition and give the user a
reasonable degree of assurance that what they're running was vetted by
someone who knows how the library catalog should behave. As an
example, you may wish to download a test edition, say MIT's:
http://libx.org/libx/src/editions/libxtestedition.php?edition=mit and
go through the check list (or at least some of it) shown on that page.
True, this could be accomplished by having a checkmark next to a
configuration, however, this would be fragile in the face of other
code changes. In the current approach the edition is complete, tested
snapshot of all of LibX's code.
This would not be the case if new configurations could be loaded into
an existing installation, because new configurations are not tested
with the code base a user may have installed.

> ---
> Seperately, it looks like you're putting a lot of functions into the
> global chrome namespace.  All extensions share the same space, so LibX
> will not play nicely with other extensions that include, for example,
> a function named newpage.
> (This also means that two installed editions of LibX may not work well
> together, depending on what replacements you're making based on the
> edition configs.)

Yes, see FAQ:

# Can I have two editions installed simultaneously?

No, technical limitations in Firefox 1.0 and 1.5 prevent that. You can
however create different profiles if you wish to use different

> This is commonly addressed by either using a unique-y prefix, nested
> namespaces or closures.
> ...I haven't done any testing on this, so feel free to tell me to take a hike.

I didn't intend Firefox would be broken like this forever, I truly
expected them to adopt a modern extension model where each extension
would be given its own namespace for its javascript.

But this doesn't appear to be happening, so we've started giving a
libx prefix to new functions we added, e.g.
function libxGetProperty(prop, args) {
function libxInitializeCatalog(cattype, catprefix)
function libxInitializeCatalogs()
function libxInit()

There's still some legacy, as in many older (> 6 months) extensions.

Some functions already live in closures, such as the DoForURL actions
in libxdfu.js.

I didn't know JavaScript supported nested namespaces, could you tell
me how do use them? Or do you mean I should attach my functions to
some Object I create?

Is there an easy way to put multiple .js files in their own, nested namespace?

> --
> Lastly, regarding agressive AJAX when injecting cues, this goes back
> to expected common uses.  If you hope for LibX to become very commonly
> used, I'd say no, don't go too rich since you'll burden people.  And
> local caching won't do much good since repeated lookups of the same
> piece won't happen a lot.  You -could- have a central caching proxy
> service, but that'd have privacy concerns.
> ...BookBurro solved this nicely by only fetching upon user action, but
> making it -very- easy to invoke that action.

I too have doubts that the "this book is due on" entry in Amazon would
be of much benefit. It has a certain coolness factor, true, but users
don't browse Amazon and constantly ask the question whether the book
is on the shelves. If they need to know, they can click; there's also
the question of screen real-estate.

However, there are other places where AJAX will be more appropriate. 
For instance, in OpenURL resolution, you often have OpenURL resolvers
that simply place a link to some other database (say Infogale) in
their results. The next thing the user will invariably do is click on
that link, we may as well ajax the result for them.

 - Godmar

More information about the Libx mailing list