Re: Method for accessing SQL databases



On Wed, 2005-01-26 at 17:00 +0100, Magnus Bergman wrote:
> I'm about to write a Gnome-VFS module for accessing SQL databases
> (primary MySQL and Oracle). And I was wondering if there is some kind of
> standard related to mapping a URL to an SQL query. And if I'm forced to
> hack something myself I would appreciate opinions from others.

While it might technically be possible to make this work, and in fact
you might have specific reasons to do something like this it is not
something I recommend.

Gnome-vfs is meant to expose filesystems of various forms to
applications to use for saving documents and other forms of files. It
tries its best to provide what i might call "mostly posixly, to the
extent we can" semantics. For many backends posix semantics isn't quite
possible, so we get to "weaken" the semantics of gnome-vfs incrementally
as we add backends that cannot support it. 

By semantics I mean what behaviour applications loading, saving and
managing files can assume from the gnome-vfs filesystem. Some posix
behaviours such as atomic renames and cache coherency are just
impossible to implement for most backends, and I don't think app authors
expect them. However, we already have backends that break extremely
simple assumptions like "if i create a file with the name 'foo', a file
named 'foo' will appear". This is broken by e.g. the vfolder backend and
the fonts backend and requires hacks inside nautilus (and all other
applications that make this assumption) to make it work.

Incrementally adding "weird" gnome-vfs backends makes the semantics of
gnome-vfs incrementally weaker, making it harder to use and creates bugs
in existing applications. 

Furthermore, most weird backends are created for the primary purpose of
"listing stuff in a window, using nautilus", something which I think is
wrong. Pretending that some object is a file and generating desktop
files or whatnot to handle opening them, and then weakening the
semantics of the vfs for all applications for normal use is not only
bad, it also results in a (imho) worse user experience. A custom dialog
showing the list of whatever object you wanted to show is both much
easier to implement, and allows you to get all the details exactly right
without worrying about what the file manager will do with your objects.

Anyway, thats my gnome-vfs backend rant. You're of course free to
implement whatever backend you want, but unless its something that a
user would feel natural to save a file to in gedit or OpenOffice then I
don't recommend it.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a jaded alcoholic ex-con with a robot buddy named Sparky. She's a 
chain-smoking snooty barmaid who hides her beauty behind a pair of 
thick-framed spectacles. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]