[ 
https://issues.apache.org/jira/browse/TORQUE-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15395340#comment-15395340
 ] 

Thomas Vandahl commented on TORQUE-343:
---------------------------------------

Yes, the use case is exactly as you describe. In general, in cases like these, 
the convention is to configure the class name of the extended object somewhere. 
In the Torque case, you would need to add a configuration for the peer class as 
well. When using the registry I propose, I could simply ask Torque for the 
implementation of a Peer for a given object without such extra configuration. 
That's basically the idea I want to get across.

> Implement a central registry for peerImpls like the registry for managers
> -------------------------------------------------------------------------
>
>                 Key: TORQUE-343
>                 URL: https://issues.apache.org/jira/browse/TORQUE-343
>             Project: Torque
>          Issue Type: Improvement
>          Components: Runtime, Templates
>    Affects Versions: 4.0
>            Reporter: Thomas Vandahl
>            Assignee: Thomas Vandahl
>             Fix For: 4.1
>
>
> I'd like to suggest a central registry for peerImpl-objects which can be 
> queried by the Persistent class it is responsible for. This would allow 
> reusing and extending the peer objects dynamically as well as giving them 
> some kind of life-cycle.
> The main method would be similar to this:
> {code:java}
> public <T> BasePeerImpl<T> getPeerFor(Class<T> persistentClass)
> {
>     return peerRegistry.get(persistentClass);
> }
> {code}
> I would also like to suggest moving the buildCriteria(obj) method to the 
> RecordMapper or the TableMap class. This will further reduce the amount of 
> code that needs to be generated.
> If the idea is received well, I'll come up with a proposal.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscr...@db.apache.org
For additional commands, e-mail: torque-dev-h...@db.apache.org

Reply via email to