Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!uunet!mcsun!sunic!bmc!sys_ms From: Mats.Sundvall@bmc.uu.se Newsgroups: comp.sys.mac.programmer Subject: methods or functions in oo programming Message-ID: <2616.252ca3bb@bmc.uu.se> Date: 6 Oct 89 12:08:11 GMT Organization: Biomedical Center, University of Uppsala, Sweden Lines: 32 So, I bought TC 4.0 and jumed on the oo train. It looks really nice. The class library is very interesting. But when trying to write some code myself I think I kneed sopme basic advices. I have to implement an object that does not fit in the TC class tree. I want to implement an object tree that handles molecules like DNA, RNA and proteins. Shall I make the object molecule a child of CObject or make a new root? The when I have the object DNA that I want to be able to do things with the question is if the things I want to do shall be implemented as methods of the object or like functions that I pass the object to. Example: I want to be able to CUT a DNA with an enzyme. The result is one or many objects that contain part of the sequence. How do I get the resulting list of new DNA objects if I implement this as a method. The other method/function I want to implement is LIGATE. I pass LIGATE two objects of DNA and it assembles these into one object of DNA. Should this be a method or should it be a function. Hopefully somebody can give me a hint so I can get together some code and ask you some more questions. Thanx, -- Mats Sundvall Biomedical Center +46/18174583 University of Uppsala Mats.Sundvall@BMC.UU.SE Sweden psi%24020019700620::MATS