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

Designing logic for parsing request data

 
vithal kambhammettu
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys
i came across this problem recently in a test, and i was wondering what the best solution for this would be? and more important why?
when writing an application, which periodically checks a database table to see if other applications have placed any work requests there, The requests are stored in a single column and each contains several items of information separated by a comma. Each item in the comma separated String represents a value for a field of a Request object. Once a request is retrieved from the database, which one of the following is the BEST place to put the logic that parses the request data?
1) In the Request class constructor
2) In the getters for each property of the Request object
3) In the data access layer of the application
thanks a lot
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds to me like an ugly way of storing data. I would put the parsing code the data access layer so nobody knows.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic