> Before I start work on a DB- I thought to execute
> code with JSP- Formbean- Action Servlet- Business
> Class- DAO flow. Is it possible to hardcode values
> and retrieve it from DAO? Pardon me if this sounds
> dumb question.
> Thanks,
What for? Testing purposes, I presume. Yes, it's possible - and common - to have your DAO return hard-coded values your client code will expect, in order to focus on another layer until you're ready to actually get the DAO working
One approach would be to gradually push the hard-coded values down layer by layer, first having your JSP hard-coded with them, then get the JSP to obtain values from a form bean, which has them hard-coded, and so on, until you've got end-to-end real data flowing about. This way of working avoids the tedious, even daunting "how will all this fit together?" lines of thought that most people mistakenly go down early in their coding career
> Mock objects (the implementation that returns fixed
> values for test) can also be used in an ongoing basis
> for unit testing each layer.
Of which, EasyMock seems to be the most straight-forward example I've seen. Others will have different opinions, of course. Try 'em all