You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Lance (JIRA)" <ji...@apache.org> on 2014/06/22 22:27:25 UTC
[jira] [Issue Comment Deleted] (TAP5-1611) out-of-the-box way in
Tapestry for replacing components
[ https://issues.apache.org/jira/browse/TAP5-1611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lance updated TAP5-1611:
------------------------
Comment: was deleted
(was: I wasn't really talking about the map inside ComponentOverrideImpl. I was talking about the map inside the MappedConfiguration at the time when tapestry is building the from multiple modules. I'm not 100% sure on how the class reloading works and how classloaders are shared. Can modules be hot-reloaded independently of one another?
Let's consider the following case:
1. Module A contributes class X to ComponentOverride - MappedConfiguration.add(X.class, XOverride.class)
2. Module B overrides the contribution - MappedConfiguration.override(X.class, XOverride2.class)
Now, lets consider the case where Module B is reloaded after component X has also been reloaded. Will step 2 work? Or will override fail since the two classes are not the same? I'm not sure myself, it hurts my brain a bit ;))
> out-of-the-box way in Tapestry for replacing components
> -------------------------------------------------------
>
> Key: TAP5-1611
> URL: https://issues.apache.org/jira/browse/TAP5-1611
> Project: Tapestry 5
> Issue Type: New Feature
> Components: tapestry-core
> Affects Versions: 5.3
> Reporter: Jens Breitenstein
> Assignee: Thiago H. de Paula Figueiredo
> Priority: Minor
> Labels: component, month-of-tapestry
> Fix For: 5.4
>
>
> It would be nice to allow global component replacement by a different component class (or derived version from the original) compared to the field type provided. So @InjectComponent would behave more or less like @Inject for services without the need of Interfaces.
> NOTE:
> current workaround is decorating ComponentInstantiatorSource
> As Thiago outlines my workaround is sub-optimal as it bases on internal classes which might subject to change without notice. He suggests to have an Service we can contribute our "overrides" to. Replaceing components would introduce a new level of flexibility to change implementations without touching tml's at all. Naturally ServiceBinder was not my suggested place for this new kind of "binding", seems to be a misunderstanding. From a functional point of view I was just thinking about something like...
> public static void bind(final ComponentBinder binder)
> {
> binder.bind(ComponentA,class, ComponentBderivedFromA.class);
> }
> ...this, as an example.
--
This message was sent by Atlassian JIRA
(v6.2#6252)