jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Designing logic for parsing request data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "Designing logic for parsing request data" Watch "Designing logic for parsing request data" New topic

Designing logic for parsing request data

vithal kambhammettu

Joined: Jul 18, 2001
Posts: 17
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

Joined: Jul 27, 2001
Posts: 1365
It sounds to me like an ugly way of storing data. I would put the parsing code the data access layer so nobody knows.
I agree. Here's the link: http://aspose.com/file-tools
subject: Designing logic for parsing request data
It's not a secret anymore!