Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Designing presentation layer servlet classes

Reply
Thread Tools

Designing presentation layer servlet classes

 
 
2BaCook
Guest
Posts: n/a
 
      11-10-2003
I was wondering when writing a basic web program (typical 4-tier
architecture) having a presentation layer that all extends
HttpServlet... why not have a class BaseUI that extends HttpServlets
and then have all my other UI classes extend from BaseUI? I have seen
examples in texts just showing each UI class to extend just from
Servlets, so I figure this is wrong but I do not know why.
Thanks!
 
Reply With Quote
 
 
 
 
VisionSet
Guest
Posts: n/a
 
      11-10-2003
"2BaCook" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> I was wondering when writing a basic web program (typical 4-tier
> architecture) having a presentation layer that all extends
> HttpServlet... why not have a class BaseUI that extends HttpServlets
> and then have all my other UI classes extend from BaseUI? I have seen
> examples in texts just showing each UI class to extend just from
> Servlets, so I figure this is wrong but I do not know why.
> Thanks!


I take it you not rendering in a browser?

--
Mike W


 
Reply With Quote
 
 
 
 
John C. Bollinger
Guest
Posts: n/a
 
      11-10-2003
2BaCook wrote:

> I was wondering when writing a basic web program (typical 4-tier
> architecture) having a presentation layer that all extends
> HttpServlet... why not have a class BaseUI that extends HttpServlets
> and then have all my other UI classes extend from BaseUI? I have seen
> examples in texts just showing each UI class to extend just from
> Servlets, so I figure this is wrong but I do not know why.
> Thanks!


The question of specific technology choice aside, yes, you could do
that. But why? What do you stand to gain?


John Bollinger
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
Reinhold Erler
Guest
Posts: n/a
 
      11-11-2003

"2BaCook" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) m...
> I was wondering when writing a basic web program (typical 4-tier
> architecture) having a presentation layer that all extends
> HttpServlet... why not have a class BaseUI that extends HttpServlets
> and then have all my other UI classes extend from BaseUI? I have seen
> examples in texts just showing each UI class to extend just from
> Servlets, so I figure this is wrong but I do not know why.
> Thanks!


I don't think it's wrong to use a superclass for all servlets (there's only
an insignificant loss of performance). but I'm wondering about servlets as
UI classes. Usually a state-of-the-art application separates the model
(business logic, database access) from the view (generating the html
output). therefore you could consider using the servlets for executing
business logic and forwarding the request to jsps for presentation.
Additionally you would gain flexibility by using some MVC framework like
Struts or similar.

Reini




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
business layer, data access layer , presentation layer for asp.net using C#.net Dhananjay ASP .Net 1 12-18-2006 11:35 PM
Presentation layer has reference to data layer Ily ASP .Net 2 10-13-2006 08:40 AM
Business Layer, Data Layer, Speed Issues, Classes, and all that et ASP .Net 2 03-06-2006 02:46 PM
Exposing Business Layer Objects to Presentation Layer dan Java 25 10-28-2003 01:52 AM
Re: Exposing Business Layer Objects to Presentation Layer Universe Java 1 10-24-2003 09:40 PM



Advertisments