Ted Husted wrote:

Craig R. McClanahan wrote:

All of the above use cases could be covered by a ChainServlet to load the config stuff and store it in a servlet context attribute. That doesn't help the non-web case, but a default solution that uses a static singleton might work out ok there.


It just occurred to me that I have a non-web case on my desk now. It converts a file scraped from a HTML page into a couple of fixed-length files that are imported into a database. Problem is, the government agency that creates the HTML page tweaks the format now and again, or adds new information, which makes maintenance an ongoing issue. This seems like a good use for the CoR architechture, since each Command can scan for one of the many possible input formats. If it's not yours, pass it along =:)

Sounds like a pretty exact match to the motivations described in GoF for Chain of Responsibility :-).



I've a maintenance ticket open for this now, so I'll think I'll migrate it to Chain. The best part is that the application is already fully tested, and so it will be a good show of using Unit Tests in a non-web applicaton too.

That will be a useful exercise.




-Ted.

Craig





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to