Assaph Mehr wrote:

>>Not sure what you mean by "how invasive is KB regarding the objects it
>>manages".  KirbyBase does give you the ability to create a custom
>>"record class".  All the records in the result set will be returned as
>>instances of this class.
>>    
>>
>
>Do I need to inherit from a certain base class (like in AR)? Do I need
>to define fields as special properties (like Og)? In short, how much
>KB specific aspects does a record class have over a regular class?
>
>  
>
No, you don't need to inherit from any specific class.  The only thing 
your class needs to have is #kb_create method.  KirbyBase calls this 
method, once for each record in the result set, to create an instance of 
the class.  It passes in the fields of the record as arguments to 
#kb_create.  That's it.  Everything else in the class is definable by you.

There is an example in the distribution called "record_class_test.rb" 
that shows how this works.

In fact, you don't even have to define a custom class if you don't want 
to.  Records in a result set default to being simple Struct objects if 
there is no custom class defined.

>>Regarding the second question, KirbyBase supports one-to-one
>>relationships (called "lookup fields" in KB) and one-to-many
>>relationships.  You also have the ability to define "calculated fields".
>>    
>>
>
>How about many-to-many? Constraints on relationships? I don't mind
>doing this with a special relationship-class, just want to know what
>is the KB-way?
>
>  
>
Nope and nope.

>Thanks again for your time,
>  
>
No problem.  :-)

Jamey