tags:

views:

29

answers:

2

Hi, I want to know if there is any need to create interface for request/response objects. I know ServletRequest is an interface.

I see request/response as simple pojo, where having some members to hold data and getter/setters would suffice.

The processing of such data could be delegated to external utility classes.

Does anyone have specific inputs on this? Thanks Nayn

A: 

Hard to answer such a question in general... one good reason for defining such an interface is to isolate other parts of the app from the Servlet API. This may make e.g. unit testing easier.

Péter Török
A: 

What you describe looks like a transfer object. Normally there is no need to have an interface for that.

unbeli