Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird 1.2.1 findByCriteria()

 
Ericsson Liu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question regarding to the search method.

The javadoc of the DBAcess interface says:


But the specification requires an exact match:


The coding part is not an issue, just want to clarify the requirement. I
 
Thomas Thevis
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first requirement is for the database layer. You have to implement a data access class implementing this interface. Therefore, you have to implement the methods as specified by the interface. The seoond requirement comes from the GUI or middle tier (depending on the design decision you choose). Therefore, these two do not have to match exactly. However, if you implement the method as specified in the interface your business method should not be a problem (as you stated yourself).
My suggestion would be to thing in different tiers or layers and develop them independently of each other.

Regards,
Thomas
 
Ericsson Liu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Thomas, I understand what you mean. The problem is that the database layer is more relaxed on the searching than the business layer. Even though I implement my business rule as exact match, when it comes to db layer, it will still return all the records that partially match the criteria. Unless I do some more checking on the returned result set.

cheers
 
Thomas Thevis
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ericsson,

...when it comes to db layer, it will still return all the records that partially match the criteria. Unless I do some more checking on the returned result set.

Agreed. In my opinion the extra checks are business logic and should be performed by a business layer. The database layer delivers all partial matches and the business layer restricts them to exact matches.

Regards,
Thomas
 
Ericsson Liu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the heads up. I guess I will do some more checkings in my business logic now.
 
Thomas Thevis
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic