0

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

2 Answers 2

0

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

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.