You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Luther Baker <lu...@gmail.com> on 2009/03/08 19:46:19 UTC

generics and pages, components and edit blocks

Is there anyway to use generics as pages, components or edit blocks?


path/Edit<Address>

vs

path/Edit<User>


I'd imagine not - you'd have had to encoded the Generic type in the class
and page names somehow and I've not seen anyone do that yet.

-Luther

Re: generics and pages, components and edit blocks

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, Mar 9, 2009 at 7:04 AM, Jonathan O'Connor <ni...@eircom.net> wrote:
> Although you can't use generics directly, I presume you can define a
> subclass that inherits from a given generic superclass.

The approach you're describing works very well. Tapestry CRUD
(http://www.arsmachina.com.br/project/tapestrycrud) uses that
approach.

-- 
Thiago

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


Re: generics and pages, components and edit blocks

Posted by Jonathan O'Connor <ni...@eircom.net>.
Although you can't use generics directly, I presume you can define a 
subclass that inherits from a given generic superclass.
For instance,
class CrudPage<T> {
     // Stuff with T
}

class CustomerCrud extends CrudPage<Customer> {
}

Would this work? I suppose if you used a generic service, then you would 
have to also instanciate it before using it:
class CrudService<T> { /* stuff */ }
abstract class CrudPage<T> {
     protected abstract CrudService<T> getCrudService();
}

class CustomerCrudService extends CrudService<Customer> { }
class CustomerCrudPage extends CrudPage<Customer> {
     @Inject
     private CustomerCrudService service;
     protected CustomerCrudService getCrudService() { return service; }
}

Jonathan
On 09/03/2009 02:35, Luther Baker wrote:
> Yes.
>
> Maybe Tapestry 6 :)
>
> Given that the language keeps changing/moving forward, this seems like an
> odd thing to simply leave the user with ... I would guess that Templates,
> Components, Pages ... and the way we setup Services in AppModule would
> eventually want to consider techniques that wish to leverage Generics.
> Obviously, registering something like DataService<Movie>.class is illegal
> Java - so it may take a creative approach.
>
> Obviously from a page/component standpoing, there'd have to be a new
> convention for such beasts. Naively:
>
> note/EditBlock_Note
> idea/EditBlock_Idea
>
> And Services (interfaces and implementations) would be a completely
> different problem ... and with things like type erasure and backwards
> compatibility ... it all strikes me as an interesting issue.
>
> -Luther
>
>
>
> On Sun, Mar 8, 2009 at 6:55 PM, Thiago H. de Paula Figueiredo<
> thiagohp@gmail.com>  wrote:
>
>    
>> Em Sun, 08 Mar 2009 15:46:19 -0300, Luther Baker<lu...@gmail.com>
>> escreveu:
>>
>>   Is there anyway to use generics as pages, components or edit blocks?
>>      
>> No, because Tapestry uses the class name as URL.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java consultant, developer, and instructor
>> http://www.arsmachina.com.br/thiago
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>      
>
>    

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


Re: generics and pages, components and edit blocks

Posted by Howard Lewis Ship <hl...@gmail.com>.
Which is why I'm anxious to release Tapestry 5.1 and demonstrate the
seriousness concerning backwards compatibility.

On Sun, Mar 8, 2009 at 7:58 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Sun, 08 Mar 2009 23:46:41 -0300, Luther Baker <lu...@gmail.com>
> escreveu:
>
>> "Further, the design of Tapestry 5 was created specifically to make it
>> possible to continue adding features without breaking backwards
>> compatibility going forward. There will not need to be a Tapestry 6."
>
> There was a very annoying troll in this list, some time ago, that always
> talked about the lack of backward compatibility of major Tapestry releases .
> . .
>
> Talking about trolling, but now on the funny side, not the annoying one,
> read this:
> http://www.jroller.com/javelotinfo/entry/trolling_with_java_web_frameworks
> :D Funny and informative at the same time . . .
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: generics and pages, components and edit blocks

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sun, 08 Mar 2009 23:46:41 -0300, Luther Baker <lu...@gmail.com>  
escreveu:

> "Further, the design of Tapestry 5 was created specifically to make it
> possible to continue adding features without breaking backwards
> compatibility going forward. There will not need to be a Tapestry 6."

There was a very annoying troll in this list, some time ago, that always  
talked about the lack of backward compatibility of major Tapestry releases  
. . .

Talking about trolling, but now on the funny side, not the annoying one,  
read this:  
http://www.jroller.com/javelotinfo/entry/trolling_with_java_web_frameworks  
:D Funny and informative at the same time . . .

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: generics and pages, components and edit blocks

Posted by Luther Baker <lu...@gmail.com>.
Ok, I'll bite :)

http://www.jroller.com/WarnerOnstine/entry/tapestry_future_adoption_redux

<q>
One shining point came from Howard himself --

"Further, the design of Tapestry 5 was created specifically to make it
possible to continue adding features without breaking backwards
compatibility going forward. There will not need to be a Tapestry 6."
</q>


On Sun, Mar 8, 2009 at 9:41 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Sun, 08 Mar 2009 23:35:44 -0300, Luther Baker <lu...@gmail.com>
> escreveu:
>
>  Yes.
>>
>> Maybe Tapestry 6 :)
>>
>
> "Tapestry 6" has a history of controversy and trolling. As it's already
> 23:38 PM here in Belo Horizonte, MG, Brazil and I'm lazy now, read this list
> and search the web for "tapestry 6" to know what I'm talking about . . . ;)
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: generics and pages, components and edit blocks

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sun, 08 Mar 2009 23:35:44 -0300, Luther Baker <lu...@gmail.com>  
escreveu:

> Yes.
>
> Maybe Tapestry 6 :)

"Tapestry 6" has a history of controversy and trolling. As it's already  
23:38 PM here in Belo Horizonte, MG, Brazil and I'm lazy now, read this  
list and search the web for "tapestry 6" to know what I'm talking about .  
. . ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: generics and pages, components and edit blocks

Posted by Luther Baker <lu...@gmail.com>.
Yes.

Maybe Tapestry 6 :)

Given that the language keeps changing/moving forward, this seems like an
odd thing to simply leave the user with ... I would guess that Templates,
Components, Pages ... and the way we setup Services in AppModule would
eventually want to consider techniques that wish to leverage Generics.
Obviously, registering something like DataService<Movie>.class is illegal
Java - so it may take a creative approach.

Obviously from a page/component standpoing, there'd have to be a new
convention for such beasts. Naively:

note/EditBlock_Note
idea/EditBlock_Idea

And Services (interfaces and implementations) would be a completely
different problem ... and with things like type erasure and backwards
compatibility ... it all strikes me as an interesting issue.

-Luther



On Sun, Mar 8, 2009 at 6:55 PM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Em Sun, 08 Mar 2009 15:46:19 -0300, Luther Baker <lu...@gmail.com>
> escreveu:
>
>  Is there anyway to use generics as pages, components or edit blocks?
>>
>
> No, because Tapestry uses the class name as URL.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: generics and pages, components and edit blocks

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Sun, 08 Mar 2009 15:46:19 -0300, Luther Baker <lu...@gmail.com>  
escreveu:

> Is there anyway to use generics as pages, components or edit blocks?

No, because Tapestry uses the class name as URL.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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