|
From: Jeremy F. <jfi...@ma...> - 2002-11-01 15:45:57
|
I've offered this as an alternative to the objectType:
<contentType label=3D"Thread">
<fields>
<field name=3D"thread"
label=3D"Thread"
type=3D"org.bacfug.modus.fields.text">
<rules>
<rule type=3D"org.bacfug.modus.validation.full"/>
<rule type=3D"org.bacfug.modus.validation.maxlength" value=3D"100"/>
</rules>=20
</field>
<field name=3D"postid"
type=3D"org.bacfug.modus.fields.hidden"/>
<field name=3D"posts"
label=3D"Posts"
type=3D"org.bacfug.modus.fields.objectcollection"
key=3D"postid"/>=20
</fields>
</contentType>
"Just to clarify: the init() call would not instantiate/retrieve the =
subobjects, that would only happen on the call to getObjects(), yes?"
Right, no instantiation until the item is required. Of course this is =
not a problem if only one post is needed, but if all of the posts are =
requested (getObjects('posts')) then things become crunchingly slow. =
However, this would be the case whether the posts were wrapped inside of =
the thread component or if they were requested externally with the =
post.getAll() method which I've already said irks me.
In either case, CFMX just doesn't seem up to the task of instantiating =
dozens of objects on a single request. In my crude performance tests it =
took roughly 50ms per object to retrieve a collection of threads from =
the cache.
----- Original Message -----=20
From: Sean A Corfield=20
To: mod...@li...=20
Sent: Friday, November 01, 2002 10:26 AM
Subject: Re: [Modus-devs] Collections of content objects and =
performance
On Friday, Nov 1, 2002, at 06:48 US/Pacific, Jeremy Firsenbaum wrote:
Sean - I've jumped into this thing in midstream, so I'm wondering =
what you're referring to when you say "our system."
Oh, sorry. Macromedia. Well, my team at Macromedia. We prototyped a =
persistence mechanism that was pretty similar to what Modus tries to do =
(and was what Nathan was referring to in one of his earlier messages =
when he named me).
I appreciate your concern with the descriptor mixing display and =
data attributes. It seems like a few of the items in the descriptor =
right now are there just to make renderSimpleForm() work and may be =
superfluous to the actual object model.=20
Yes, I'm not convinced that it is possible to build a generic =
form-rendering engine (without a huge amount of machinery) and I feel - =
very strongly as y'all might gather! - that this sort of display =
machinery doesn't belong in a content model. What if your display is =
Flash? WML? XML?
As for clustering the XML descriptor for a group of objects I would =
say no. I think it's legitimate to reference other objects within a =
descriptor ( a forum has threads), but the descriptor should continue to =
describe one content type. It seems cleaner and much more manageable to =
have separate forum, thread, and message descriptors than to wrap them =
all together in one mega/meta-file.
OK, just wanted to get a sense of the folks here on that one.
<cfset forum =3D =
createObject("component","path.to.forum").init(attributes.forumID)>
<cfset threads =3D forum.getObjects('threads')>
Just to clarify: the init() call would not instantiate/retrieve the =
subobjects, that would only happen on the call to getObjects(), yes? =
That was part of the problem we had with performance: if the first =
init() call created the entire object (i.e., including nested =
subobjects) it became very slow very quickly.
<field name=3D"related"
label=3D"Related Press Releases"
type=3D"org.bacfug.modus.fields.contentObject"
multiple=3D"yes">
<objectType name=3D"modustest.contentObjects.pressRelease"/>
</field> =20
So this is an array of modustest.contentObjects.pressRelease? What =
has "type=3D..." got to do with this? What value has the type got to do =
with anything?
I'm still confused by this XML example - it seems very strange to =
have, effectively, two types specifies for this field... Nathan, can you =
elaborate?
|