Imagine a service receives two parameters: ConnectionString and Script.
public class MyExecutor
{
// execute that script in that connection context
Execute(String: Script)
{...}
}
My task is to create that service, capable of receiving different connection string from different DB and DBMS using Spring.Net.
Now I'm pondering about performance. I guess I ill need to create some kind of connection manager as a singleton.
// Probably a singleton
public class MyManager
{
private MyList List<connections_allready_open>
Execute(String:ConnectionString, String:Script)
{
//check if that connection is already open or create a new and add it to the list
var myConnection = MyList.findOrCreate();
// use that connection to execute the script
with myConnecion
{
MyExecutor.Execute(Script);
}
}
}
The main problem is I'm total clueless about Spring.Net, not even knows the name spaces to declare. Appreciate any comments, ideas and suggestions about this job.