[dev] Wild thoughts on relationships, Was: Adding contact to nag
task
Michael Häusler
michael at akatose.de
Tue Jan 28 16:18:02 PST 2003
Zitat von Hans Lellelid <hans at appliedsec.com>:
> I think everyone is arguing for a pretty loose model that would hook
> into the registry & would accommodate the directionality (& possible
> bi-directionality) you mention. This model would not, however, in
> itself handle UI stuff...
Of course, the model would not handle UI itself, but it could give hints
to the application, that actually builds the UI. What I really wanted to
say, is that the interface should be open for extensions:
array getRelations (string $app) // returns a array of Relationship objects
So an application should be able to get a list of all relationships it is
involved in - even if this app is only "target" of some sort of
unidirectional relation. A look at the relationships properties would now
reveal, _wether_ it should show some UI. How to render such UI is a
different question.
> Seems like there are a few options:
> (1) don't worry about UI at all, but simply provide a link to a page
> (e.g. to 'new event' page in this example) where content of related type
> can be entered, (2) leave UI to the app that needs UI & simply have the
> "sponsoring" application return imporatant info needed to build UI (e.g.
> available locations, categories, etc. for an event) and (3) have the
> sponsoring application actually build the UI, using Horde_Form or some
> sort of system that uses widgets that can inherit any customizations
> implemented for the relationship-requesting application.
>
> I think in the long run that option 3 would make most sense, but in the
> short-term I would be very happy with option 1.
I concur.
> >2. relationships, that connect more than two modules:
> What do you mean by this? Do you mean that some piece of content may
> need to be related to more than one different type of content?
Yes, a relationship object could have a method:
array getPartners() // returns the list of involved partners
> Or do you simply mean that you'd like the API to be able to fetch
> indirectly related items ... something like:
> $Rel->getRelated('document_author')->getRelated('author_homepage')
> // obviously not PHP :-)
Though especially helpful in the homepage/URL example, I think this could
be overkill in many other situations. But the user would always be able to
reach indirectly linked items with few mouse clicks.
Anyway, I am writing this, because I always felt, that it is helpful to
discuss interfaces. So these are just comments ...
Regards,
Michael
More information about the dev
mailing list