This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why methods of SimpleFormController are overridden from a Class optionally and not mandatory?

 
Monica Shiralkar
Ranch Hand
Posts: 825
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is SimpleFormController a Class and not an Interface. OnSubmit method is not a mandatory to implement method because it is overriden from SimpleFormController.But shouldnt this functionality be mandatory when we are using a Form? Then shouldnt this been kept in an interface and thus made mandatory to implement?

thanks.
 
Nam Ha Minh
Ranch Hand
Posts: 502
Eclipse IDE Firefox Browser Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monica. Shiralkar wrote:Why is SimpleFormController a Class and not an Interface. OnSubmit method is not a mandatory to implement method because it is overriden from SimpleFormController.But shouldnt this functionality be mandatory when we are using a Form? Then shouldnt this been kept in an interface and thus made mandatory to implement?

thanks.


Because Spring is flexible. One can choose either to extends the SimpleFormController or not (by using XML or annotation configuration). We can write simple controller which does not tie to the framework, thus making it's easy for unit testing the controller class.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic