From: Ivan V. i B. <iv...@ca...> - 2005-01-21 09:10:13
|
On Thu, Jan 20, 2005 at 09:07:16PM +0100, Andreu Alted Abad wrote: [...] > And finally I would like to mention an example that was used many times > along this thread: >=20 > mygroup.mynode=3D Node(...) >=20 > Some time ago I was discussing with Francesc about the correctness of usi= ng > node constructors in the client code. My perception was that this notation > only could bring problems since the instance created with the constructor= is > not bounded to any pytables file, and more importantly, it has no utility > except be assigned to a group after his creation; any other uses would end > with an error. [...] I don't see much technical difficulty in this change: File.create* methods basically do not do anything beyond getting the destination group, creating the object and assigning it using setattr. With the new model, some very simple checking should be added to leafs and groups to check if they are bound before doing some operations (including assigning them into a Group, which is already done by using a mutual call pattern). Although having unbound nodes might seem incorrect, using create* methods forces some knowledge into the File (it would also on Group) objects which I think they need not have. However, if create* methods were to be used anyway, I prefer them to belong in Group objects rather than File, to avoid walking the whole tree structure as you mentioned. Regards, Ivan import disclaimer --=20 Ivan Vilata i Balaguer >qo< http://www.carabos.com/ C=E1rabos Coop. V. V V Enjoy Data "" |