[Nitro] Og Self-Interaction Question

Trans transfire at gmail.com
Wed Dec 12 05:56:17 EST 2007

On Dec 12, 1:49 am, Matthew B Gardner <weat... at speakeasy.net> wrote:
> Hello --
>   I'm writing a game which uses Og with MySQL, and I want my website to be
> able to interact with that data as well. I'm wondering about solutions to
> this problem:
> Game...
> class HelpFile
>         property :name, String
>         property :body, String
>         property :viewed, Integer
> end
> Web...
> class HelpFile
>         attr_accessor :name, String
>         attr_accessor :body, String, :control => :textarea
> end
> The web class doesn't need the viewed attribute, but I'm assuming it'll drop
> that attribute from the database if it isn't declared. Likewise, I'm sure
> there will be web-data that I won't need in the game. I know I could disable
> full evolution, but I'd like to not have to do that...especially since I
> think that's one of the best reasons to use Og with my project (changing to
> add might not be too terrible). Maybe using two different declarations of
> essentially the same class isn't even good practice, but the game class
> having access to web-based methods and vise-versa seems problematic to me
> (not to mention the classes are in two different places).
> Does anyone have some insight on this? Implementation solutions?

Seems reasonable that you could define a single base class for the
table then two subclasses that act as "views". If sub-classing does
not provided a means for  avoiding the evolution then just delegate --
which certainly will work.


More information about the Nitro-general mailing list