[Dbix-class] Representing directory structures

Bill Moseley moseley at hank.org
Mon Apr 8 14:02:34 GMT 2013


On Mon, Apr 8, 2013 at 1:30 AM, Dave Howorth <dhoworth at mrc-lmb.cam.ac.uk>wr=
ote:

> Bill Moseley wrote:
> > Anyone using DBIC to represent hierarchal directory (folder) structures?
> >
> > Essentially just like a file system, except users each have their own
> root.
> >  To add to the complexity, I need to be able to "share" folders and all
> > child elements to other users.
>
> Just a thought, and most likely irrelevant to your application, but file
> system hierarchies are frequently a poor match to the users'
> requirements. The user would often really prefer multiple parents (i.e.
> a DAG) and/or classification tags for 'files'. Those features would lead
> to a different implementation.
>

Yes, I prefer the tag system as a user, too. And I find it is easier to
model as a set of normalized tables.  Especially if the leaf nodes are well
defined like an email message.   Then tables are "message" and "tag" plus
link tables to associate them together "tag_message", as well as
"user_message", "user_tag" which can carry access permissions to facility
rights and sharing, for example.

Usage patterns are hard to predict -- especially when the same model is
used for web, mobile, and API users.   We have some API users that add tens
of thousands of items in a single folder, and others that create a huge
number of folders with just a few entries in each.   Things to keep in mind
when designing the UI.


-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20130408/88c=
d0fc3/attachment.htm


More information about the DBIx-Class mailing list