[Nitro] Og Self-Interaction Question

Matthew B Gardner weather at speakeasy.net
Thu Dec 13 01:21:08 EST 2007

Hello --
	Sorry to reply to myself, but I had some more thoughts...I apologize if I 
wander outside the scope of Nitro/Og at all. I was thinking that I could 
declare the attributes for each class shared by the game and the web 
interface outside of the class declarations that include game or web specific 
methods. I'm not concerned with them being the same class, I'm just concerned 
about one declaration dropping a table it shouldn't. Also, declaring the same 
attributes for the same class twice doesn't seem very Ruby-ish.

I was thinking, then, that I could just do something like...

class Helpfile # in a file called shared


require 'shared'
class Helpfile
	game methods...


require 'shared'
class Helpfile
	web methods...

Now, the game and the web interface wouldn't have access to each other's 
methods, which I think would be a problem otherwise. I'm not sure if this is 
good application/web design, but it makes sense to me, anyway. 

I know Og stands by itself, but just to make sure...would this cause any 
problems on the game side, which only includes Og? --

attr_accessor :body, String, :control => :textarea

I'd need that for the web-side, of course.

Thanks again for any help/answers,

On Wednesday 12 December 2007 22:33, Matthew B Gardner wrote:
> Hello --
> On Wednesday 12 December 2007 03:20, George Moschovitis wrote:
> > One question.
> >
> > why do you use property for the Game class and attr_accessor for the Web
> > class?
> That was unintentional...I learned Og through tutorials that used property
> instead of the generic accessors. I'm assuming I can use the accessors
> everywhere now, or is there a valid reason to keep using property?
> > from what I understand you keep 2 different codebases and a single
> > database. This looks like duplication of effort to me (and I can think of
> > synchronization problems, etc..) I can see no easy solution to your
> > problem (apart from changing to :add evolution)
> >
> > -g.
> It's just one codebase (the game), but I want to use the web aspect for
> editing things that would otherwise be much more tedious and less
> user-friendly inside the game. For example, writing and editing helpfiles
> for things inside a browser would be much easier and dynamic than it would
> be inside the game. I guess I misspoke in my initial post...the two classes
> aren't the same, they just share the same data and need to share class name
> to do so (to access the same db table). I think switching to add evolution
> may be the most natural solution for me, but I'm going to look into Trans's
> ideas too.
> Thanks for your help,
> Matt
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

More information about the Nitro-general mailing list