------Original Message------ From: Gustaf Neumann Gustaf.Neumann@wu-wien.ac.at To: Zoran Vasiljevic zoran@munich.com Sent: December 13, 2000 10:41:01 AM GMT Subject: [Xotcl] RE: [Xotcl] Re: [Xotcl] Object mixin with passing init args ?
from the implementation point of view this is not a big issue. however, from my experience, i should note that i switched from a style of "passing arguments to init" to the "-parameter style of configuring objects", which is in almost all cases the more
elegant
solution.
<snip>
Yes. I must admit that your reasoning is correct. One gets wierd constructs if thinking about all possible situations.
But, let me explain my issue. There may be another solution.
I have couple of classes impementing tree-like operations on XML files and regular filesystems. Both classes share the same abstract class, Tree (when I think of the Storage implementation in XOTcl distro, then this case would be very similar). Now, each of (Xml/Ufs) classes are mixed-in the general Tree object. Each of them needs a different argument pointing to a xml-file/file-directory where to hook on.
Consider ...
Class Tree ;# has abstract methods mostly Class XmlTree -superclass Tree ;# implements above methods Class UfsTree -superclass Tree ;# ...
XmlTree instproc init {xmlFile} {....} UfsTree instproc init {rootDir} {....}
Tree t t mixin XmlTree /path/to/xmlfile.xml ;# use the Xml driver t mixin UfsTree /some/dir ;# switch to filesystem driver
Dang ! Showstopper, since I cannot pass arg to XmlTree/UfsTree. Any suggestions ?
______________________________________________ FREE Personalized Email at Mail.com Sign up at http://www.mail.com/?sr=signup