On Wed, 20 Oct 2004 22:36:59 +0900, rdlugosz.1044583 / bloglines.com
<rdlugosz.1044583 / bloglines.com> wrote:
> Another option (which I'm betting won't be popular here...)
> would be to have a separate RectangleBuilder class that will make Rectangles
> for you.  You could have multiple methods here that would take reasonable
> parameter sets based on their name.

I tend to like using a set of factory methods.

I would, however, not create a separate RectangleBuilder class unless
I need configurable factories.  Instead, I'd exploit the metaclass
system of Ruby, and just do
class Rectangle
  def self.new_rounded(...)
  end
  # etc
end

I'll also in passing note that when working with (very) similar
problems, I've occasionally found it useful to make the styles
parameter an object in its own right, to have a separate inheritance
hierarchy with the possibiltity to vary aspects of styles that end up
being calculated from each other etc.

Eivind.
-- 
Hazzle free packages for Ruby?
RPA is available from http://www.rubyarchive.org/