aspose file tools*
The moose likes Servlets and the fly likes Asking authors about the patterns in Web Tier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Asking authors about the patterns in Web Tier" Watch "Asking authors about the patterns in Web Tier" New topic
Author

Asking authors about the patterns in Web Tier

Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
I took SCWCD Beta last Monday and I got a few questions about Front Controllers and Filters..... I'm not quite clear with the characteristics of those patterns to implement in the real world application... Here is the right time, I got the great authors of J2EE Web Tier to explain us about those thing... Mr. Kevin and Mr.Jayson, could u please explain something about those patterns with suitable examples? Thank you very much to both of the authors and it's kind of blessing from the God to have u here in JavaRanch....


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Ko Ko,
Have you checked out the Sun Core J2EE patterns articles?


Groovy
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Yes, I did... But the explanation there doesn't have examples to clarify my doubt... We now have famous authors here and if they have available time, they might want to explain to us about the characteristcs of those patterns....
Thank for your advice as well, Pradeep...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Could you please post your doubts?
Mcgill Smith
Ranch Hand

Joined: Nov 11, 2003
Posts: 178
Could you please post your doubts?
----------------------------------------------------------------------------
Difference between Front controller and MVC?(i know mvc is a framework)but i am asking with exam point of view.


Regards
Mcgill
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

FrontController represents the C in the MVC pattern.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Pradeep Bhat:
FrontController represents the C in the MVC pattern.

Hi Pradeep,
Yeah, I think that "C" includes all servlets which control the web app... So is there any reason why Servlets and Front Controllers got different names, instead of using a common name, since they do the same job...
BTW, did u take ur Beta exam?
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
McGill Smith wrote: i know mvc is a framework.
Strictly, MVC is not a framework, but an architectural (or aggregate) pattern.
A framework is a partial implementation that you can extend by adding your own application specific code. A pattern is just a description of a solution to a particular situation and forces.
There are plenty of frameworks available for the web tier, many of which claim to implement (or to help you implement) MVC. You are also free to implement your own web application applying the MVC pattern (or any other approach) "from scratch".


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
So is there any reason why Servlets and Front Controllers got different names, instead of using a common name, since they do the same job
You can do a lot more with servlets than just Front Controllers. The Front Controller approach (having a single dispatch servlet for a whole application, which redirects to JSPs) is just one of the ways of building a web application.
If you prefer an alternative approach, you could use lots of servlets (typically one for each type of action). Another popular approach is to use a single servlet, but with no JSPs or other web application-specific components - the single servlet uses regular Java classes to generate all HTML output.
Does that make sense?
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Frank Carver:
You can do a lot more with servlets than just Front Controllers. The Front Controller approach (having a single dispatch servlet for a whole application, which redirects to JSPs) is just one of the ways of building a web application.

Hi Mr.Frank,
Is it possible to occur bottleneck problem at the Front Controller, since a single FC has to deal with all the incoming reuqests??? Anyway, thank u very much for ur explanation... I started to be clear about them...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Is it possible to occur bottleneck problem at the Front Controller since a single FC has to deal with all the incoming reuqests

No.
[ January 29, 2004: Message edited by: Pradeep Bhat ]
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Is it possible to occur bottleneck problem at the Front Controller, since a single FC has to deal with all the incoming reuqests???
It's easy to think that there might be a bottleneck, but in reality, there almost always isn't. It's important to remember that each request that comes in get's its own thread, and all these threads can be happily running "through" the servlet code at the same time.
Maybe it will help to think of it like lots of people watching a movie at the same time :- the movie doesn't slow down or stop because there are more people in the movie theater
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Frank Carver:
[i]Maybe it will help to think of it like lots of people watching a movie at the same time :- the movie doesn't slow down or stop because there are more people in the movie theater

That's very good example, Mr.Frank... Thank you for your patient explanation.... And thanks Pradeep as well... I seldomly apply those patterns in the real world... That's why I am weak in those area, I guess... Applying J2EE patterns into the real world application can make us improve the quality of the application as well as our implementation ability on J2EE....
Thanks a lot, guys!!!
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Originally posted by Ko Ko Naing:

That's very good example, Mr.Frank... Thank you for your patient explanation.... And thanks Pradeep as well... I seldomly apply those patterns in the real world... That's why I am weak in those area, I guess... Applying J2EE patterns into the real world application can make us improve the quality of the application as well as our implementation ability on J2EE....
Thanks a lot, guys!!!


I am surprised that do not apply patterns into real projects. You can visit wwww.theserverside.com and check for new emerging patterns.
[ January 29, 2004: Message edited by: Pradeep Bhat ]
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Pradeep Bhat:

I am surprised that do not apply patterns into real projects. You can visit wwww.theserverside.com and check for new emerging patterns.

I do apply MVC in the projetcs that I did in the past... But not as a pure Front Controller as a single controller, but the servlets in the web app work as controllers for each modules they are responding for...
Thank you for the link, Pradeep... I knew about that site already b4...
 
Consider Paul's rocket mass heater.
 
subject: Asking authors about the patterns in Web Tier