You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org> on 2007/10/20 22:19:50 UTC

[jira] Commented: (TAPESTRY-1842) Allow coercions to handle multiple or non-concrete types

    [ https://issues.apache.org/jira/browse/TAPESTRY-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536463 ] 

Howard M. Lewis Ship commented on TAPESTRY-1842:
------------------------------------------------

I had pictured this as involving some code that would use the hibernate configuration (i.e., classes for entities) and write explicit type coercers for each entity.  Is that not possible?

> Allow coercions to handle multiple or non-concrete types
> --------------------------------------------------------
>
>                 Key: TAPESTRY-1842
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1842
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-ioc
>    Affects Versions: 5.0.6
>            Reporter: Dan Adams
>            Priority: Critical
>
> I was working on implementing something similar to TAPESTRY-1653 and ran into a problem. In our system, all hibernate entities implement an interface. I wanted to create a coercion that would handle going from String -> entity and from entity -> String. The problem with this was that, with the way coercion currently works, you have to add coercions for every concrete enttiy type rather than having one coercion that knows how to load any entity from the Session by id. This introduces a chicken-and-egg problem where in the coercion depends on the Hibernation Configuration being created already. This causes IoC to kick out because there is a dependency loop. Either I need to find a way around the dependency loop (which I can't see how) and register coercions for each specific entity type at start-up or register one coercion for all entities.
> Obviously this introduces some complications with the coercion logic but it appears to be very much a necessary ability. I'm not opposed to implementing it others can chime in if they have opinions about this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org