Ed Leafe wrote:
> On May 11, 2009, at 11:42 AM, Paul McNett wrote:
> 
>> I just wanted to highlight the fact that this commit is potentially  
>> dangerous, as I
>> know you are aware. I don't understand, at first glance at least,  
>> why you want
>> _fieldStructure to be the same dict for all cursors descended from  
>> dCursorMixin.
>> Doesn't it need to contain the field structure for *this* cursor and  
>> not *all* cursors?
> 
>       Have you looked at the keys for this dict? Can you find a case where  
> a problem could actually occur?

It's supposed to contain keys on a field name mapped to a value of a field 
type. It 
exists so we don't need to look it up each time.

But what if you have 2 tables with a 'pkid' field and in one table the type is 
char 
and the other table the type is int? Wouldn't the cursor that was instantiated 
last 
get the field type as set from the first cursor?

All I wanted to point out is that this smells very dangerous, assigning a 
mutable 
object to a class attribute. I get the same smell when I see a mutable object 
as a 
function default value.

It seems you are trying to make the child cursors of the parent bizobjs not 
need to 
constantly call getFields(), which would be a good thing to circumvent. Since 
the 
concept of child tables is completely defined in dBizobj, and not in 
dCursorMixin, 
perhaps the right place for this optimization is at that layer instead.

Paul

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to