I have a program where I want to save some data record. And I want the output type to be flexible such that I could save the data record to a text file, xml file, database, push to a webservice.
My take on it would be to create an interface such as
DataStore with a
Save() method, and the concrete subclasses such as
What is the proper name/terminology for this type of pattern (I'm using the term "DataStore", log4net names things "appenders", .net they talk about "providers" and "persistence")? I want to come up with good class names (and method names) that fit with a convention if there is one.
can you point me to a decent example, preferably in C#, C++, or java?
Managed to find this stack overflow question, Object persistence terminology: 'repository' vs. 'store' vs. 'context' vs. 'retriever' vs. (…), which captures the terminology part of my question pretty well although there's not a decent answer yet.