On Thu, Mar 14, 2013 at 11:04 AM, Joel Pearson <[email protected]> wrote:
> Uh oh, I think I've backed myself into a corner...

:-)

> I assume that I'll need some sort of "dup" method in order to easily
> differentiate between modifying an object in place and returning a copy.
> However, in my attempts to interlink all the elements, I think I've
> created a situation where I'll end up in a loop.
>
> RubyExcel holds "child" Sheets
> Sheet links to "parent" RubyExcel
> I know they aren't really parent and child, but I wasn't sure of the
> best way to link them together.
>
> In order to dup RubyExcel I need to dup each sheet.
> In order to dup a Sheet I need to dup RubyExcel.
>
> I've ended up with a circular reference and I'm not sure of the best way
> to proceed from here.

It may be an indication that you got your design wrong.  Why did you
think you need the circular references in the first place?

> Also, is it sensible to have the namespaces stacked the way I've done
> it? Like RubyExcel::Sheet::Element.

I'd probably only have one level of namespaces for this, e.g. module
RubyExcel and put all classes in there.  You won't have too many
classes to distribute across a multitude of namespaces.

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- 
[email protected] | 
https://groups.google.com/d/forum/ruby-talk-google?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"ruby-talk-google" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to