• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ActionFormBean

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic