Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does ActionSupport implement Serializable

What is the need for Action classes to be serializable? When and how does it happen, if at all.

like image 241
sengs Avatar asked Jan 25 '11 06:01

sengs


1 Answers

As far as I can tell, it doesn't need to be Serializable, and it was a mistake to make ActionSupport implement that interface.

Here is the best reasoning I have found on the subject (taken from here):

It's very common in web frameworks to use Serializable objects for a couple or reasons, such as being able to preserve state across a server restart and for shipping objects around in a cluster.

With that said, (IMHO) I believe it was a design mistake to have ActionSupport implement Serializable. I don't believe that either of the above really apply to Action objects since they are short-lived. The choice of making Actions Serializable should have been left to the developer and not "forced" by the framework.

like image 144
Daniel Alexiuc Avatar answered Nov 09 '22 23:11

Daniel Alexiuc