Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Servlet Architectural Question

Status
Not open for further replies.

zooxmusic

Programmer
Nov 24, 2004
96
US
Hi all,
Not sure if this is specific to J2EE (sorry if it is not)
Would it be good form to use filter servlets to ALWAYS transform any request in my web app to a DTO's instead of doing the transformation in a regular call in the web app?

Thanks in advance
Brian


Spend like you don't need the money,
love like you've never been hurt and dance like nobody's watching!
 
depends entirely on what kind of website you are writing - but generally I'd say no.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thanks sedj, well I have to write a transformation layer between my company and a third-party we contracted. The means of communication is xml to them and we use dto's from the client. The main responsibility for me is to transform our dto's into the proper xml format, send the xml to the third-party, get the response in xml, transform that back into a dto then send that dto back to the client. I have no logic except for the format of the xml and dto's. This can also happen in reverse with the third-party notifying me.

My main problem is that I need to write a logging engine that will write each and every notification either TO the third-party of FROM the third-party. I cannot have this logging engine fault the main function in any way. So if the entire logging engine dies it cannot effect anything. I need to spawn this in 2 threads with the one for logging almost acting like a udp connection and the other going through the main method.
Does this make any difference? Any suggestions would be helpful.
Brian

Spend like you don't need the money,
love like you've never been hurt and dance like nobody's watching!
 
If you are always transforming whatever to a DTO, then perhaps you should use a filter to do it.

With regards to logging - I would write a notification listener, perhaps in JMX, that you can just fire a DTO object at - if it fails it fails, and won't kill your main app.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thank you,
Not familiar with JMX but thank you for pointing me in that direction. I am sure to learn it soon and I really hate having to refactor from a TOTALLY bad design because I just don't have the knowledge.

Brian


Spend like you don't need the money,
love like you've never been hurt and dance like nobody's watching!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top