Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionFormBean

 
HungryJavaGoat
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a good design to make ActionFormBean to implement an interface??
i wrote one utility for pagination by which we can display the results in pages and users can select some records , by checking the check box provided.
I made it as a separate utility class.. But when i gave it to offshore team they made some changes and they created an interface for pagination and made the ActionForm bean to impelment that interface. (I really don't understand why they did it ((:- ). i find no reason for making that as an interface.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be hard to say for sure without seeing the code and how it is used. In this case I could easily see an interface that all forms that support paging would implement. Then a common set of code could treat all these forms generically. Then again, I have run into programmers that like to cram there code full of interfaces, patterns, and abstractions for no real reason.

- Brent
 
HungryJavaGoat
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you said ..they have used some common code which treats these form beans generically. But in formbeans they have just duplicated the implementation code. for example , some of the methods they have declared in the interface are

1. public Map getSelectedItemsMap();
2. public void setSelectedItemsMap(Map map);
3. public String getPageSelected();
4. public void setPageSelected(String selPage);
5. public String getCount();
6. public void setCount(String cnt);

As you can see, these are all only getters and setters which will be same for every impelementation. Also note that it is not any behaviour that they are re-defining in different ActionForms.


Regards,
Karthik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic