0

I have a C# console application. This application has many different projects/C# class files, each of them dedicated to parsing a certain kind of XML and creating an object, called 'Response'. Now, each of these individual projects parses the XML, and gets an error msg field (stores it in the 'Response' object) from these different xmls. Now, based on this error msg, I want to set the value of an other field of the 'Response' object. This processing logic is the same for all the projects. So my question is, should that processing be done just before saving the 'Response' object in the DB, and hence making changes to only 1 single file? Or, should this be a common method in a base class, invoked on all the 30 projects/C# class files?

2
  • Presumably these 30 different Response classes all inherit from the same base class? Commented Mar 9, 2015 at 9:42
  • @Dan-o: yes, they do Commented Mar 9, 2015 at 9:43

1 Answer 1

3

So just going purely on the limited information in your description, the common base class seems like an appropriate place to put common processing logic.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.