• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Regarding the search

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear ranchers,

Regarding

It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.



I did that in the GUI (on the client side) . That is, I extended the RowFilter, and filtered the records directly in the view according to the rules above.
Is this ok? Or should I have done it in the business layer or on the server...?

Best regards,
Stefan
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Stefan!

Well... I'd say it is better to implement these rules in the business layer. If so, you can get the same .jar file tomorrow and use the classes in a web application without any problem. The thing is, this way, you have more reusability!
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Roberto Perillo wrote:Well... I'd say it is better to implement these rules in the business layer. If so, you can get the same .jar file tomorrow and use the classes in a web application without any problem. The thing is, this way, you have more reusability!

Exactly!

So, would be good you wrap your search parameters inside of one object like pattern "Value Object", and transfer it between the layers. This way, It will help validate all parameters in any layer, any time.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!