Possible duplicate:
Why does the HttpServlet implement Serializable?
This question suddenly arose a couple of days ago in an internal discussion, and we did not seem to find a suitable answer for this. Can someone point me in the right direction?
Questions:
1) Why is the HttpServlet in java implements serializable ? It seems I have not found a logical reason for this.
2). Trying to figure it out, I looked at the api doc and found something interesting
public abstract class HttpServlet extends GenericServlet implements Serializable
Now itβs interesting that GenericServlet also extends Serializable . Thus, both the parent and child classes implement serializable. Isn't that an anti-pattern?
source share