On Sun, Jan 27, 2008 at 09:07:41AM -0800, Suraj N. Kurapati wrote:
I had not read such an article and there was no message_types.rb in
my code.  However, I believe you are referring to the
over-aggressive OOP factorization of Message classes.

Sorry, message_spec.rb. And I was referring to:

      rsp.type.should    == Rversion.type
      rsp.version.should == req.version

There was an article which advocated similar message passing style, and I strongly disagreed with it. I'd prefer something more idiomatic, like:

        want rsp.type == Rversion.type
        want rsp.version == req.Version

Initially, I just had a single Message class that performed to/from
9P byte-stream conversion for all types of messages (KISS, YAGNI).
After I did some profiling, it showed that this runtime message
processing (if format == blah, do blah blah, ...) was a performance
bottleneck.

I noticed the same thing in mine. I also noticed that ruby was not designed to run stack machines. :( I like your solution.

--
Kris Maglione

Far-way talent always seems better than home-developed
talent.

Attachment: pgpud844vr3Bl.pgp
Description: PGP signature

Reply via email to