← Back to team overview

oship-dev team mailing list archive

Re: Parameters of constructors in datastructure.py

 

Hi Eduardo,

These are very quick replies so they may cause you to have other
questions.

On Tue, 2010-06-29 at 12:19 -0300, Eduardo César wrote:
> Hi all,
> 
> I am too a bit confused by parameters of constructors of some classes
> in datastructure.py. Its related to the Wagner's question, but in a
> different aspect.
> 
> Classes Item, ItemStructure, Cluster, Element, ItemTree have a whole
> set of parameters that are not described in the specification
> 
> Example:
> 
> class ItemTree:
> ...
> def __init__(self, uid, atnodeid, name, atdetails, fdraudit, links, parent):
>         DataStructure.__init__(self, uid, atnodeid, name, atdetails,
>                                fdraudit, links, parent)
> ...
> 
> Why do they have all of those parameters? I could not discern their
> purpose in the way they were made.
> 

They may well have been implemented poorly (by me) but probably because
they are inherited attributes and should be overridden.  As I say
though, the implementation may be incorrect.  Feel free to make them
work correctly with the spec.
  


> 
> Another question:
> 
> To implement to asHierarchy() method, present in many classes, I have
> to use the Cluster class, so it have to go "up" in the file, before
> some other classes. But by doing this, the code breaks, because the
> ICluster class itself needs other, more "down" in the code class.
> 
> Diego, perhaps you can point to me a direction and some advice on how
> you solved the "circular dependency" concerning the History class.
> 

My thought on the first/real question is that there are many Zope/Grok
methods that are already available for certain functionality we need. 

So if you have a method oeA to be implemented and there is a method
already inherited from ZTK called zA Then you might do something like:

def oeA(self):
  return zA(self)

does that make sense?  In other words most of the "functionality" we
need is already there.  We just need to correctly implement the
attributes and maybe over-ride behaviour in some places.

Cheers,
Tim




> _______________________________________________
> Mailing list: https://launchpad.net/~oship-dev
> Post to     : oship-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~oship-dev
> More help   : https://help.launchpad.net/ListHelp

-- 
***************************************************************
Timothy Cook, MSc

LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook 
Skype ID == (upon request)
Academic.Edu Profile: http://uff.academia.edu/TimothyCook

You may get my Public GPG key from  popular keyservers or    
from this link http://timothywayne.cook.googlepages.com/home 

Attachment: signature.asc
Description: This is a digitally signed message part


References