In an effort to help others (and ourselves) write cleaner, happier, more eco-friendly code, we have added optional argument count and signature checking to OpenSRF. To make using this facility as simple and unobtrusive as possible there are three implementation levels (well, four if you count “a short note without parameter information”), each one more descriptive than the previous, so developers can choose how much (if any) time they will invest in documenting method signature and use and whether runtime argument checks are appropriate for that method. The other part is the argc setting that can be passed along with the signature. This specifies how many arguments are required, and the code will check their type and class against the actual parameters supplied if the signature gives that much information. Eventually, signature level 3 will allow individual parameters to be marked as required, and it will allow the handling of named (instead of positional) parameter description and validation. I’ll go ahead and lay out the structure of each method signature level here, and wait patiently for my thrashing to ensue.
[Read more…] about Code, document thyself!
Throwing down the gauntlet
- Alternative OPACs
- Personal Card Catalogs
- Bookbags
- Record Tagging
- Reading Lists
- User built RSS Feeds of reading lists and searches
- Interactive searches
- Saved searches
- Search history
- … tons of other things we’ve collectively imagined …
What do they conceptually have in common? [Read more…] about Throwing down the gauntlet
OpenSRF Jabber: A Technical Review
As has been mentioned before on this blog, OpenSRF relies on Jabber for it’s communication layer. Jabber is an instant messaging service much like AIM, Yahoo messenger, and the like. The advantage of Jabber, of course, is that it’s an open spec (see xmpp.org) and there are a number of open source server implementations, allowing us to run servers localy and write our own server code if we feel so inclined.
Like most chat frameworks, a Jabber client is distinguished by its username on the network. So a unique Jabber “account” would consist of something like bill@gapines.org. Jabber also adds an additional component which is called the “resource”. This allows a single account to have multiple open connections to a jabber server. A full client login would be something like bill@gapines.org/home, bill@gapines.org/work, etc. A single user may be logged into a given server as many times as they want so long as the resources are unique for each connection.