Sorry for the bad title I just didn't know how to word it right.
Say I have a class called Table and these three methods:
//Creates a new table in underlying provider and returns new Table object.
CreateNew(string Name);
//Opens the table in provider and returns new Table object.
OpenTable(string Path);
//Same action as above just on a collection, and returns a IList<Table>
OpenTables(IList<string> path);
At the current time I am using something like this, where all the methods are static on the type:
Table tab = Table.OpenTable("SomePath");
Table tab = Table.CreateNew("DummyTableName");
You get the idea.
However I was wondering if these really should be in a factory. Something like this:
TableFactory factory = new TableFactory();
Table tab = factory.CreateNew("DummyTableName");
Table tab = factory.OpenTable("SomePath");
The factory wouldn't be static as that would make other code that uses a factory hard to test
What do you think?