{
Connection connection = GetActiveConnection();
try {
connection.SendWriteRequest(something);
}
catch (e)
{
HandleWriteFailure(e)
}
}
How is that complex??
{
Connection connection = GetActiveConnection();
try {
connection.SendWriteRequest(something);
}
catch (e)
{
HandleWriteFailure(e)
}
}
How is that complex??
If this is a sql db implem then it should probaly use a connection concept, but does it need to care itself, in the writeDB code, if the connection is dead, reused, or other? No. It just needs an OK connection.
If this is a sql db implem then it should probaly use a connection concept, but does it need to care itself, in the writeDB code, if the connection is dead, reused, or other? No. It just needs an OK connection.
The underlying code that implements that method is free to do it *how* it needs.
Db.Add()
Will deal with details that needs to be dealt with depending on what implem of "Db" you have at runtime
The underlying code that implements that method is free to do it *how* it needs.
Db.Add()
Will deal with details that needs to be dealt with depending on what implem of "Db" you have at runtime
The code
That is supposed to write
*Should not care about these*
The code
That is supposed to write
*Should not care about these*
So: why are you asking about naming a "getConnection" or "reuseDbConnection" ?
So: why are you asking about naming a "getConnection" or "reuseDbConnection" ?
Do we have a connection to a server or is the database a local file?
Do we have to do any pre- or post- treatment before or after writing?
A million examples can be found
Do we have a connection to a server or is the database a local file?
Do we have to do any pre- or post- treatment before or after writing?
A million examples can be found