You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Jason Novotny <no...@aei.mpg.de> on 2002/10/29 21:11:02 UTC

why do portlets inherit from servlets?

Hi,

I've been looking at IBM's Portlet API in which portlets inherit from 
servlets-- I would like to get some technical reasons for why this is a 
good or bad idea. For one thing it seems performance might be slower 
since portlets would be invoked presumably using 
RequestDispatcher.include() methods rather than using a portlet object 
instance. Another thing is that portlets would be managed by the 
servlet container such as classloading, whereas if I have portlets as 
independent objects I could use my own classloading mechanisms to 
reload them without restarting the servlet container.
	Any comments and information is greatly appreciated.

	Thanks, Jason


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: why do portlets inherit from servlets?

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Jason Novotny [mailto:jdnovotny@lbl.gov]
> Sent: Wednesday, October 30, 2002 9:02 PM
> To: Jetspeed Developers List
> Cc: david@bluesunrise.com
> Subject: Re: why do portlets inherit from servlets?
>
>
>
> Hi David,
>
> 	Thanks for the information. In trying to implement
> something similar
> myself, I'm confused as to how to manage the portlet lifecycle if
> portlets are servlets. For instance, the only method a "manger"
> servlet, or portlet container, can access of a portlet is the service
> method thru the RequestDispatcher.include call. How would the
> init(PortletConfig) or initConcrete(PortletSettings), login and other
> methods get called?
> In the other case, where portlets are their own objects and not
> necessarily servlets, then what about the PortletConfig object, which
> seems to get its params from the web.xml? Will that be a part of the
> standard?

Well wouldn't the servlet interface be just one of the interfaces that a
portlet may implement, so the container can make standardized calls such as
init on the Portlet (extended) interface.

IMO, there are too many differences between a portlet and servlet. The
servlet api should be mimicked where needed.
I personally wouldn't extend a Portlet interface from Servlet. A portlet has
a different lifecycle and request phases. Some Servlet API methods would be
not applicable (or stale) on the Portlet api. Portlets render fragments,
servlets the entire page.

David



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: why do portlets inherit from servlets?

Posted by Jason Novotny <jd...@lbl.gov>.
Hi David,

	Thanks for the information. In trying to implement something similar 
myself, I'm confused as to how to manage the portlet lifecycle if 
portlets are servlets. For instance, the only method a "manger" 
servlet, or portlet container, can access of a portlet is the service 
method thru the RequestDispatcher.include call. How would the 
init(PortletConfig) or initConcrete(PortletSettings), login and other 
methods get called?
In the other case, where portlets are their own objects and not 
necessarily servlets, then what about the PortletConfig object, which 
seems to get its params from the web.xml? Will that be a part of the 
standard?

	Thanks for your time, Jason



On Wednesday, October 30, 2002, at 11:49  AM, David Sean Taylor wrote:

>
>
>> -----Original Message-----
>> From: Jason Novotny [mailto:novotny@aei.mpg.de]
>> Sent: Tuesday, October 29, 2002 12:11 PM
>> To: jetspeed-dev@jakarta.apache.org
>> Cc: Raphael.Luta@groupvu.com
>> Subject: why do portlets inherit from servlets?
>>
>>
>> Hi,
>>
>> I've been looking at IBM's Portlet API in which portlets inherit from
>> servlets-- I would like to get some technical reasons for why this is 
>> a
>> good or bad idea. For one thing it seems performance might be slower
>> since portlets would be invoked presumably using
>> RequestDispatcher.include() methods rather than using a portlet object
>> instance. Another thing is that portlets would be managed by the
>> servlet container such as classloading, whereas if I have portlets as
>> independent objects I could use my own classloading mechanisms to
>> reload them without restarting the servlet container.
>> 	Any comments and information is greatly appreciated.
>>
>
> The advantage is that you can leverage the Servlet API with your 
> portlets,
> instead of mimicking the functionality.
> This makes for a nice aggregation engine based on servlet dispatcher, 
> all
> built in and less work for the portlet container developers.
>
> I wouldn't consider IBM's API as the standard, especially in this area 
> of
> portlets inheriting from servlets.
>
>
>
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: why do portlets inherit from servlets?

Posted by David Sean Taylor <da...@bluesunrise.com>.

> -----Original Message-----
> From: Jason Novotny [mailto:novotny@aei.mpg.de]
> Sent: Tuesday, October 29, 2002 12:11 PM
> To: jetspeed-dev@jakarta.apache.org
> Cc: Raphael.Luta@groupvu.com
> Subject: why do portlets inherit from servlets?
>
>
> Hi,
>
> I've been looking at IBM's Portlet API in which portlets inherit from
> servlets-- I would like to get some technical reasons for why this is a
> good or bad idea. For one thing it seems performance might be slower
> since portlets would be invoked presumably using
> RequestDispatcher.include() methods rather than using a portlet object
> instance. Another thing is that portlets would be managed by the
> servlet container such as classloading, whereas if I have portlets as
> independent objects I could use my own classloading mechanisms to
> reload them without restarting the servlet container.
> 	Any comments and information is greatly appreciated.
>

The advantage is that you can leverage the Servlet API with your portlets,
instead of mimicking the functionality.
This makes for a nice aggregation engine based on servlet dispatcher, all
built in and less work for the portlet container developers.

I wouldn't consider IBM's API as the standard, especially in this area of
portlets inheriting from servlets.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>