[Nitro] Nitro/OG examples that show recommended ......

Walter Walter at mwsewall.com
Fri Sep 2 12:17:54 EDT 2005


> I see, this is not available for the moment but you are right, this is
> an important feature.
> To tell you the truth, at the moment I am mostly working on Nitro
> stuff (and some internal nitro based projects) as I am waiting to see
> some progress on Deb's extensive Og patch. But I 'll manage to find
> some time to work on this before the next release. If one of the more
> experienced Og users can provide a patch, even better ;-)
>

I do have a simple persistent object manager that does work with compound keys and allows for sub-objects but I haven't added the joins (has_one, has_many, etc....) and I am getting to the point where I would want that.  I will study the Og code some more and see if I can perhaps integrate some of that in there.  We have approached the design a bit differently but it does seem to make sense to update Og to work with compound primary keys more so than to update mine to do relations.  Although I will say that I do need ODBC support and that might be an issue with OG as well.

> 
> Ah, now I understand your problem. How about this:
> 
> module Address
>    property :line1, String, :sql => 'CHAR(30)'
>    property :line2, ...
>    ...
> end
> 
> class Customer
>  include Address
>  property :name, String
>  property :seq_no, Integer
>  property :other_fields, String
>  property :more_fields, String
> end
> 
> and then:
> 
> Customer[1].line1 
> 
> Does this work for you?
> 

Unfortunately no.  The reason for defining them as sub-objects is that they all have extra logic built in.  The Address example I gave you was a very stripped down version.  The real one, knows how to parse the line to get the street number, the street itself, and the street type (road, street, ave, etc).  It can sort and do other things.  I have similar stuff for fiscal periods, and for phone numbers, etc.

I am thinking of using a Money and Gallon value objects instead of floats and that would also apply there as well.


Thanks,


Walt

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: 8/30/2005
 




More information about the Nitro-general mailing list