> I'm looking for an O-R layer for the next version of our system;
> somebody recommended that I evaluate Peers. I've identified 7
> structural cases and a few other criteria that I'd like in an O-R tool.
> Can an experienced Peers user or developer tell me how well it handles
> these situations?
>
> O-R structures:
> 1) simple (1 class, 1 table)
You use a tool called Torque to generate Peer classes for you. There are 4
classes for each table. Base<table-name>Peer, Base<table-name>,
<table-name>Peer and Base<table-name>
The Base* classes contains all the functionality and should not be change.
The other two classes are empty and this is where your application business
logic goes. If you regenerate with torque only the Base* classes changes.
This allows you to change the schema, but still keep your existing code.
> 2) 1:n
Torque will generate methods for you to access the relevant objects.
For example Category and Item. Category.getItems() will give all the items
for a category or Item.getCategory() will give the associated Category for
an Item.
Torque also generates methods for joining all objects with less db hits as
to improve performance.
> 3) n:m
You can use the methods generated by Torque for this, but it would probably
be more efficient to use a Criteria object. Joins are very easy to do and
you'll find that you'll be able to do complex multi-table joins without a
problem.
> 4) self join 1:n (object trees)
Same as (3). I have very efficient code that loads a tree from a table into
a in memory tree representation with a single db hit. If you're interested
I can give it to you.
> 5) self join n:m (object maps)
Same as (3).
> 6) simple inheritance (S extends B, each maps to a table with a shared
> primary key)
I don't think there is any support for this at the moment, but it could
probably be done.
> 7) polymorphic inheritance (S and T extend B, the application works with
> a collection of B)
Same as (6)
> The only other real requirement I've got is good documentation.
As an added bonus Peer allows you to create objects from a standard SQL
query. This gives you the opportunity to do things by hand wherever you
might find Peers lacking (which isn't a lot :-)
The documentation is coming along nicely, but there is room for improvement.
We'll help you with Peer if you help out with docs :-)
> Thanks for your time,
>
> J. Pulley
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]