[Rbrainz-users] Do you need help.

Philipp Wolfer phw at rubyforge.org
Mon Jun 11 15:19:44 EDT 2007


2007/6/7, Nigel Graham <nigel at maven-group.org>:
> As I mentioned earlier I am not such a big fan of using tests on the
> class type. I have attached a duck typing edition of MBID for you to
> look at and comment on.
I'm still not completely used to "messing around in foreign
namespaces", butI like your implementation very much. It cleanly
solves the requirement to allow strings (or other representations of
the ID) wherever it is convenient.

I have a few comments about the various methods: We won't need
"from_string" anymore, it is conceptual the same as "parse", which I
like better. And I'm not sure about "from_uuid" and "from_uri"
anymore. My original idea was to make it explicit what you are doing.
But in many cases you don't know what you have anyway and you end up
using "parse". So we could get rid of those two methods as well. Or
maybe we could even offer only "new". What do you think?

What I liked about the old code was the fact that the two use cases
creating a MBID from an URI or a UUID were logical divided, now it's
all in one method (initialize). Maybe we could split it up internally
(from_uuid, from_uri, but private).

One quick note about code style: I don't like long lines (I set the
limit to 80 characters per line), so I normally use the post "if" or
"unless" only in very short statements, even if the alternative uses 3
lines.

> Based on previous experience with incomplete/partial dates I have found
> it usefull to consider them as time periods. This way of looking at them
> considerably lightens the burden of dealing with them with regards to
> other data types like Time and Date. Another advantage is that periods
> have a string of well defined operations that makes it so much easier to
> to do stuff like finding bands that were active from 1979 - 1999.
I'm not sure if I get your point here. Would it mean to store a begin
and end date, e.g. "1988-08-01" and "1988-08-31" for the incomplete
date "1988-08"?
As far as I understand this is mainly a comparison problem. Isn't this
basically solved by the current implementation of <=>?

> Another problem is that Gem::Platform doesn't reflect this 3 binary
> system. Gem::Platform::DARWIN contains the string 'powerpc-darwin' which
> is only the right value for PowerPC binaries.
That's a problem. Do you know how other projects solve this?

If you have a Rubyforge login I would like to give you access to the
project's SVN repository. You could checkin your MBID changes and
integrate them properly. In the week beginning on June 25th we could
then talk about our further project plans in detail and have a little
chat about ourselves.

Bye,
Phil


More information about the Rbrainz-users mailing list