• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Asking authors about the patterns in Web Tier

 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ko Ko,
Have you checked out the Sun Core J2EE patterns articles?
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please post your doubts?
 
Mcgill Smith
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FrontController represents the C in the MVC pattern.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic