You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Kalle Korhonen <ka...@gmail.com> on 2011/02/18 17:26:55 UTC

Default String to Class coercion?

Would it be reasonable to contribute String to Class coercion by
default? Anybody see any dangers/problems with that?

Kalle

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


Re: Default String to Class coercion?

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Feb 18, 2011 at 11:45 AM, Igor Drobiazko
<ig...@gmail.com> wrote:
> Using the component class loader might be an issue in OSGi. Wouldn't it be
> better to use the thread context ClassLoader?

Context ClassLoader won't work for the component classes though.
(Maybe I should dwell into the code first but..) does the component
classloader delegate to the context classloader for classes in
non-component packages or just throw exceptions in that case? If the
latter, would it be reasonable to first try the component classloader,
and then the context class loader? Does OSGi have an issue with it
because it uses it own classloader? If this gets too complex, probably
not worth doing but at the moment, it still doesn't sound too obscure.

Kalle


> On Fri, Feb 18, 2011 at 8:27 PM, Kalle Korhonen
> <ka...@gmail.com>wrote:
>
>> On Fri, Feb 18, 2011 at 11:05 AM, Thiago H. de Paula Figueiredo
>> <th...@gmail.com> wrote:
>> > On Fri, 18 Feb 2011 16:39:15 -0200, Kalle Korhonen
>> > <ka...@gmail.com> wrote:
>> >> The immediate use case is for tynamo-federatedaccounts though I saw
>> >> some threads on the list about the same coercion. Oauth works with
>> >> callback urls which is why the library includes whole pages. It'd be
>> >> nice to allow users to override the default behavior.
>> > Why not have a fixed callback url which returns in ints onActivate()
>> method
>> > an object determined by a service (which can and should be overriden in
>> this
>> > case)?
>>
>> Perhaps but a) I started the thread about string to class coercion and
>> b) in that example, it's likely the page itself they want to
>> customize, not the oauth logic.
>>
>> Kalle
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>

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


Re: Default String to Class coercion?

Posted by Igor Drobiazko <ig...@gmail.com>.
Using the component class loader might be an issue in OSGi. Wouldn't it be
better to use the thread context ClassLoader?

On Fri, Feb 18, 2011 at 8:27 PM, Kalle Korhonen
<ka...@gmail.com>wrote:

> On Fri, Feb 18, 2011 at 11:05 AM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
> > On Fri, 18 Feb 2011 16:39:15 -0200, Kalle Korhonen
> > <ka...@gmail.com> wrote:
> >> The immediate use case is for tynamo-federatedaccounts though I saw
> >> some threads on the list about the same coercion. Oauth works with
> >> callback urls which is why the library includes whole pages. It'd be
> >> nice to allow users to override the default behavior.
> > Why not have a fixed callback url which returns in ints onActivate()
> method
> > an object determined by a service (which can and should be overriden in
> this
> > case)?
>
> Perhaps but a) I started the thread about string to class coercion and
> b) in that example, it's likely the page itself they want to
> customize, not the oauth logic.
>
> Kalle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: Default String to Class coercion?

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Feb 18, 2011 at 11:05 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Fri, 18 Feb 2011 16:39:15 -0200, Kalle Korhonen
> <ka...@gmail.com> wrote:
>> The immediate use case is for tynamo-federatedaccounts though I saw
>> some threads on the list about the same coercion. Oauth works with
>> callback urls which is why the library includes whole pages. It'd be
>> nice to allow users to override the default behavior.
> Why not have a fixed callback url which returns in ints onActivate() method
> an object determined by a service (which can and should be overriden in this
> case)?

Perhaps but a) I started the thread about string to class coercion and
b) in that example, it's likely the page itself they want to
customize, not the oauth logic.

Kalle

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


Re: Default String to Class coercion?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 18 Feb 2011 16:39:15 -0200, Kalle Korhonen  
<ka...@gmail.com> wrote:

> The immediate use case is for tynamo-federatedaccounts though I saw
> some threads on the list about the same coercion. Oauth works with
> callback urls which is why the library includes whole pages. It'd be
> nice to allow users to override the default behavior.

Why not have a fixed callback url which returns in ints onActivate()  
method an object determined by a service (which can and should be  
overriden in this case)?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Default String to Class coercion?

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Feb 18, 2011 at 8:54 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> The trick would be to use the right class loader ... the component
> class loader I think, because if you contribute class "pages.Foo" you
> mean the transformed version, I would think.

Right. Yes, I expected that classloaders might cause potential complications.

> Where would you expect to use this?

The immediate use case is for tynamo-federatedaccounts though I saw
some threads on the list about the same coercion. Oauth works with
callback urls which is why the library includes whole pages. It'd be
nice to allow users to override the default behavior. As a library,
it's probably not a good idea to contribute a string to class coercion
as it might fairly easily step on users contributions. But if Tapestry
core supports it, the library could simply take advantage of it.

Kalle


> On Fri, Feb 18, 2011 at 8:26 AM, Kalle Korhonen
> <ka...@gmail.com> wrote:
>> Would it be reasonable to contribute String to Class coercion by
>> default? Anybody see any dangers/problems with that?
>>
>> Kalle
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

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


Re: Default String to Class coercion?

Posted by Howard Lewis Ship <hl...@gmail.com>.
The trick would be to use the right class loader ... the component
class loader I think, because if you contribute class "pages.Foo" you
mean the transformed version, I would think.

Where would you expect to use this?

On Fri, Feb 18, 2011 at 8:26 AM, Kalle Korhonen
<ka...@gmail.com> wrote:
> Would it be reasonable to contribute String to Class coercion by
> default? Anybody see any dangers/problems with that?
>
> Kalle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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