This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Struts and the fly likes Design pattern and mutlthreading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Design pattern and mutlthreading" Watch "Design pattern and mutlthreading" New topic

Design pattern and mutlthreading

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 580

I faced a interview,in that session ,the below listed question posted to me.

1) In ENterprise web application using struts,if a client send request to Contoller servlet ,then it create new instance of action class then pass the request to it.If any already existing request comes in ,then existing instance of Action will be used.Please confirm the question itself correct or wrong ?; and above logic is common for all type of design pattern.

2) Designing Multi threading web application is best solution or not ?,when and where muthithreading applied to web application

3) what are the possible design pattern used in Struts based application?;which design pattern is best suited.
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 471

1- Yes if we are speaking about struts 1.x, and that's Singleton pattern. If struts 2.x, then no.

2- Web applications are multithreaded by default. There's usually only on instance of a servlet or a JSP, and threads work on the service() method. In struts, actions are singletons, so they are multithreaded as well

3- MVC & Front Controller.

Visit my blog:
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Design pattern and mutlthreading
It's not a secret anymore!