Daniel
How about this
it's with parent/children structur
ClassMethod addToQ(inID,inData1,inData2,inData3....) as %Status
{
set o=..%New()
//link to the parent queue
set o.rParentSetObjectId(inID)
set o.p1=inData1
set o.p2=inData2
set o.p3=inData3
...
quit o.%Save()
====
also be aware that there is no guarantee with the object exposure for
the order of retreival
ie
for 1:1:..rItems.Count() {
process ..rItems.GetAt(i)
}
Does not guarantee the order !!!!!!!!!!!!!!
u need some SQL
to get the first item
&sql(select %ID into :xID from class.QueueItems
where rParent=:inQueueID
order by childsub
)
is the only guaranteed method !!!
Peter
On Wed, 04 Aug 2004 09:09:38 -0400, Daniel Santa Cruz
<[EMAIL PROTECTED]> wrote:
>Peter,
>
>Thank you for your thoughts! I guess my confusion is a bit between when
>to use Cache as just tables holding my data, and when to view it as an
>OO system. For instance, once the MyQueue items are processed, I'd like
>to keep them around. This can be accomplished by having another
>collection type (parent-child again I imagine) of already processed
>items, or just by adding a mProcessed flag to the MyItem class.
>
>The deal with adding the mProcess property is that then there is no
>straight forward way to get to them directly from OO. What I've done in
>a test case has been to have a query, and then have a method that goes
>through the query %Ids returned and builds a ListOfObjects to return.
>Nasty.
>
>What are your thoughts on this?
>
>Thanks again.
>
>Daniel.
>
>Peter Cooper wrote:
>
>> Daniel
>>
>> To my mind there is a rational need for the MyQueue class - I would
>> place methods here that operate on the whole queue eg empty queue
>>
>> Also you can implement many different independent queues each with
>> it's own OBJID - separate instances of the MyQueue class
>>
>> Just a comment on ListOfQueue items being held as a List collection
>> I am not sure that this is a good idea
>> a list collection has a limited length (depends on the length of
>> individual items)
>> also if there are many items in the queue I am not sure of the
>> efficency of inserting/shuffling the queue
>>
>> Better IMO is child classes
>>
>> Peter