Object Relatedness Vs. Container Objects: Pros and Cons

Author Message

Massimiliano Bariola

Monday 10 October 2005 4:30:12 am

Hi,

I am about to design the information structure of a rather big and complex project. I wanted to take advantage of this opportunity to inestigate in depth pros and cons of the 2 main features eZ publish offers to relate content: Object Relations and Container Objects.

I don't want to give details of the specific project because this would bias the discussion of the two approaches, while what I am looking for, is to have the community's feedback on strenghts and weaknesses of both, and leaving a "document" that everyone can use to assist in design decisions.

Pros and cons should be evaluated from the points of view of:
- user admin interface management
- content management (scalability, expandability)
- programmatical issues (PHP code of extension which will interface with the data)

My first seed:

Container objects:
Pros: easy to understand for untrained content editors, "all stuff in one place". Easy to do hierarchical operations (section assigning, moving, etc)
Cons: Rigid.

Object Relations:
Pros: flexible.
Cons: scattered info, difficult to get an idea of how information is interdependent "at a glance".

This is a really skimpy list, everyone is welcome to add to it.

Gabriel Ambuehl

Monday 10 October 2005 6:30:33 am

On one side, it's a matter of taste and style. Personally I prefer EOR (as if anyone was surprised by that) as it more closely remembers a link or even a join like in the relational model. The container stuff is more aking to a traditional hierarchical filesystem which is often not flexible enough for those uses.

What I can say for sure: objects that need to live in different places generally are best done as some sort of relation as the relations have a much easier interface than the multiple location system.

> Relations: difficult to get an idea of how information is interdependent "at a glance".

True. But you're invited to write some graph algorithm to graph the interdependencies on a site if you care ;)

I'm not quite sure if the idea of container objects is easy to understand. In my mind, easy drop down boxes for selections are much easier to grasp than the correct placement of children.

Visit http://triligon.org

Massimiliano Bariola

Monday 10 October 2005 8:45:35 am

>> Relations: difficult to get an idea of how information is interdependent "at a glance".

>True. But you're invited to write some graph algorithm to graph the interdependencies on a site if you care ;)

It's not my intention to extend the mechanism, but rather examining what's out-of-the-box, though yes ... it could be a feature for when a chain of relations grows too much.

Something to be said for containers is that it's easy to determine and set section of belonging / visible / not visible. so just because it resembles a filesystem, it is also more akin to an user's experience. especially if he is hierarchically-minded.

Gabriel Ambuehl

Monday 10 October 2005 11:13:18 am

Truth to be told, most users store documents *in Word* and *in Powerpoint* and can't be saved from that idea... Filesystem hierarchies are totally lost on them. Explaining them relations as "like links in the Web" might even make more sense to some.

Visit http://triligon.org

Massimiliano Bariola

Tuesday 11 October 2005 1:49:05 am

Following the paradigm of "links in the web", let's assume we are talking of relating objects via a dataype and not through the admin interface. I still have not used them that way. From the point of performance and simple working-out, where does it make sense to put the datatype? In a scenario where you cannot decide which kinds of objects will be related to which other, i.e. If object A is related to B, would we put an object-relation datatype in object A, object B, or both? I suppose it is better to put it in both places and maybe use it only if needed. i.e. if usually class A is related to class B, it would make sense to keep the object-relation datatype in class A and work from B to A with reverse relation. To ease management and make the system more flexible, an object realtion datatype in B would be a good idea. right ?

Xavier Dutoit

Tuesday 11 October 2005 5:56:41 am

I'd say that using the enhanced object relation would be a better idea, but I'm slighly biased ;)

I've been able to explain the difference between locations and related objects, some of my customers even understood it, but the reverse relation has always proved be a nightmare.

I know you can use either relations or relations, that you can have more than one location to confuse them a wee bit more, but from a conceptual point of view, they don't address the same need, and that isn't that complicated to explain that.

locations= "belongs to", relations = "see also".

On most of the cases, it works well: "staff" goes under "about us" and that's easy to understand.

For the 10% more complex where you can have several ways of categorizing a page, you decide of what's the main one and you force them to stick to it.

On the real live, lots of things have more that one way to be stored (eg a book could be stored by its author name, by topic, by title...). If they are able to find a book on a library shelf, they should be able to understand how it works on ez!

On some cases, the choosen classification system is better than the others only because it's the choosen one and everyone is going to apply it.

Coherency is the key for everyone. Use the location for the main classification, related objects for the rest and after a lot of scream, pain and cry, you are going to have a fucking mess of a website ;)

Good luck...

X+

http://www.sydesy.com

Fraser Hore

Thursday 27 October 2005 2:23:49 pm

I'm wrestling with the same question of locations versus relations.

One of the challenges with object relations is that objects can't be filtered or sorted when fetching reverse relations (as far as I'm aware). Filtering has to be done at the time of printing the content with IF statements, which is cumbersome, and i have no idea how you can sort. Any suggestions here would be very helpful.

A challenge to both approachs is the need to allow the user to relate two objects while creating/editing EITHER object. You can put a relation datatype in both classes but then you have to get rid of duplicate objects in your template code. I've tried using the Unique operator and that hasn't worked too well. Any suggestions here?

Another challenge to both approaches is when you need to select locations or related objects from a very large list. For example, if you were to editing a contant person object and you wanted to associate that contact with a company. If you have hundreds of companies it's pretty difficult to find the one you want. The browse approach could be ok because i suppose you could override the browse template and add things like letter tabs or even a search function. BUT, you can't pick a top node with either of the built in object relations datatypes, which is frustrating. The enhanced object relation is awsome, but it doesn't include the browse function. Any suggestions for this problem?

I hope this raises some challenges that others are struggling with as well and leads to so good solutions suggestions!

Cheers,

Fraser

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:15:54
Script start
Timing: Jan 18 2025 19:15:54
Module start 'layout'
Timing: Jan 18 2025 19:15:54
Module start 'content'
Timing: Jan 18 2025 19:15:54
Module end 'content'
Timing: Jan 18 2025 19:15:54
Script end

Main resources:

Total runtime0.6980 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 589.5859152.6563
Module start 'layout' 0.00580.0023 742.242239.5078
Module start 'content' 0.00810.6884 781.7500676.3047
Module end 'content' 0.69650.0015 1,458.054720.1094
Script end 0.6980  1,478.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4719160.0002
Check MTime0.00140.1984160.0001
Mysql Total
Database connection0.00080.113010.0008
Mysqli_queries0.621789.0664730.0085
Looping result0.00080.1138710.0000
Template Total0.665795.420.3329
Template load0.00230.335820.0012
Template processing0.663495.034320.3317
Template load and register function0.00010.013610.0001
states
state_id_array0.00110.163310.0011
state_identifier_array0.00100.146920.0005
Override
Cache load0.00210.2965580.0000
Sytem overhead
Fetch class attribute can translate value0.00070.101540.0002
Fetch class attribute name0.00160.2295100.0002
XML
Image XML parsing0.00170.236840.0004
class_abstraction
Instantiating content class attribute0.00000.0040120.0000
General
dbfile0.00110.1590290.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs