>>>>> "JNP" == Joshua N Pritikin <[EMAIL PROTECTED]> writes:

  >> but the direct access of the hash is not cool.
  >> adding methods via a public and documented path is sorta ok. but
  >> it still means that my new methods KNOWS the internals of the watcher in
  >> that it will access the hash part (even if it is not used).

  JNP> Your brain isn't twisted enough.  The reference is a hash only
  JNP> because I made it that way by default.  The event magic can be
  JNP> attached to any kind of reference.  For example, see
  JNP> t/attach_to.t.

hmm, rare that someone doesn't think i am twisted. :-) i grok that the
magic part is separate from the actual reference and you can use any ref
type. but i feel dirty directly accessing the hash and not through a
method. 

  >> please?????

  JNP> Sure, but you still haven't convinced me that it is necessary.  ;-)

<carrot>
with sugar on top?
</carrot>

<stick>
or i will beat you with a large clue bat
</stick>


  JNP> Yah, yah.  I understand what you are saying but I think that Event
  JNP> already provides it.

  >> this gets confusing in any case. i need a separate OO layer above
  >> event.pm for the api i want so the objects i pass to cb =>[] have to be
  >> mine and not the user's. so i need encapsulation even if you gave me the
  >> data method.

  JNP> Granted, but I agree that it is a worthy goal to try to minimize the
  JNP> number of indirections.

so there is a good reason! actually in a few cases (plain) i return the
watcher object since there is no need for encapsulated data there. all i
want is a callback of an object/method. but making that work across the
board would clean up the design. i would always return the watcher but
it would be reblessed to my class which would inherit the Event
classes. then the high level user could use any of my methods or yours
without any conflicts and extra code.

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com

Reply via email to