On Sat, Apr 28, 2012 at 5:54 AM, Alvaro Tejero Cantero <alv...@minin.es>wrote:

> Hi,
>
> There are two things about the design of the PyTables API that I don't
> understand:
>
> a) what is the reason to bind methods such as createTable & so on to
> the File object instead of putting the respective functions on the
> tables module?
>
> rationale: tables.createTable(where*, ...) could do the same job,
> where* being where prepended with file path or a group object.
>                this frees the namespace so as to have
> mytable.mydataset or mytable.mygroup free and not need to go through
> root.
>

I think that the idea is that data set creation only ever happens on the
file object
or on group objects.  Since this task is well encapsulated by such objects,
and that
you would always have to pass these file/group objects in to the functions
you
propose, that we just follow this common object oriented design pattern
here.


> b) why is it necessary to explicitly dereference links via __call__?
>

I don't use links, so I'll defer to someone who knows ;)

Be Well
Anthony


>
> rationale: if it would work like 'mount' then your applications do not
> need to know whether a given dataset is local to the file or 'mounted'
> through another file. As it is, the physical design of your database
> escalates up to the application code, i.e. the latter depends on how
> you arrange your tables in files.
>
> derived question: what is the best way to achieve this transparency on
> application code? e.g. is it a good idea to capture Exceptions such as
> occur when indexing mytable.mylink[:] and try mytable.mylink()[:]
> before really giving up?
>
> Cheers,
>
> -รก.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Pytables-users mailing list
> Pytables-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pytables-users
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to