Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

initialising a class (a common util) object inside my action

Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all,
im involved in a project that uses struts completely. all transaction in our project holds some specific features that are common between them. (example, client details etc). we have tried making a common action class (ex. client profile action) to support various transactions. but the problem here is the load that is forced upon a common action class. it effects the performance of the application.
now, i have devised a new way of segregating the common features to a normal class and use this class in the independent action classes. for example, the client profile action to all transactions, simultaneously uses the common features from the java class i have created.
The question is, does it effect the performance and integrity in such a way that the instances overlaps with the others.

The below design will visualize the scenario.

Old design
transaction A----->CommonClientProfileAction<-----Transaction B

(many actions call to a single clientprofileaction class)

New design

Transaction A-----> ClientProfileActionA |
Transaction A-----> ClientProfileActionB |------
Transaction C-----> ClientProfileActionC | |
--------------------------------------------| |
(independent action class utilizes the common feature present in the normal common class by creating its own instances.)

sorry for my poor design
thanks in advance
cheers everybody

urs respectfully
[ March 25, 2008: Message edited by: krishna kishore ]
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What container are you using? I am curious about why you think that using a common action class affects the performance of your application. This is an area where my knowledge is a bit fuzzy. I would think that your container could have multiple threads all using the same action instance.

- Brent
krishna kishore
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Brent
I am using weblogic as my web continer. does not the lots of "request threads" accessing a single resource will slow down the process? rather we split different request as separate resources. its hard to maintain the code also when we write hundreds and thousands of lines in single action class. here in the second design, the common utils were segregated from the main action. action containing only the reference to the common util class and its methods.

cheers all
    Bookmark Topic Watch Topic
  • New Topic