哪一個是與UI層的良好結合try-catch和n-tier應用程序中的良好實踐,爲什麼?練習中使用try-catch-finally
1.
try
{
//Statements
}
catch
{
throw
}
finally
{
//cleanup codes
}
OR
2.
try
{
// statements
}
catch(Exception ex)
{
}
finally
{
// clean up
}
和在UI層
try{
}
catch(Exception ex)
{
Log(ex);
}
finally
{
//clean up
}
可能的重複[Where to put try catch](http://stackoverflow.com/questions/523875/where-to-put-try-catch) – slugster 2011-01-08 11:58:24