[Nitro] Og and the 'Composite' pattern.

Alexey Petrushin lists at ruby-forum.com
Thu Jun 5 15:55:00 EDT 2008


Hello, is there a way to implement the 'Composite' pattern in Og?

Probably it should looks like this:

    class Item
      property :name, String
      belongs_to :parent, Item
    end

    class Container < Item
      has_many :items, Item
    end

    class Image < Item; end
    class Post < Item; end
    class Folder < Container; end

But i failed to achieve this with Og :(

P.S.
Does ActiveRecords or DataMapper support this feature?

Thanks!
-- 
Posted via http://www.ruby-forum.com/.


More information about the Nitro-general mailing list