[Grok-dev] Having objects appear in more than one place in the Application Hierarchy

Ali Afshar aafshar at gmail.com
Sun Nov 25 21:15:29 EST 2007


Hi,

The best I can do is give a concrete example, and hope you understand
what I mean:

I have an application that has Courses (imagine e-learning), and each
course contains Lessons. Now I want to be able to share these lessons
amongst different courses, but I am not sure what the best way to
proceed is.

I have this:

myapp['courses'] is a container containing all the Course objects
myapp['lessons'] is a container containing all the Lesson objects

Now each Course object could have ['lessons'] which reference objects
in the application lessons container, or it could use some alternative
indexing such as being a list of paths like 'courses/foo'.

I can see potential pros/cons with both methods, but I imagine that
this problem is very common and has been addressed. Please advise.

Thanks,

Ali


More information about the Grok-dev mailing list