현재 사용 중인게.. 2개 사용해 본건 5개밖에 안되네요 --;;

 

http://www.dotnetjunkies.com/WebLog/richardslade/archive/2005/10/29/133481.aspx

 

 

'programming > c#' 카테고리의 다른 글

정규식 컨닝페이퍼~  (0) 2005.11.03
C# coding guideline  (0) 2005.10.22
열거형 클래스 예제  (0) 2005.10.22

FxCop라는 프로그램으로 내가 만든 프로그램을 분석해 보면서 나온 내용들 정리

재미 있는 점은 Microsoft에서 만든 SqlHelper도 FxCop에서 제시하는 Rule을 어긴게 종종 보이네요 ^^''

 

발견된 건 무지 많은데... 공감도 가고 이해도 가고 수정도 했던 부분만 간략히 정리하는 중이다..

 

<<Performance Rule>>

- Properties should not return arrays

이유 : 비록 readonly 속성이라도 넘겨받은 배열의 값을 변경할 수 있기 때문

해결책 : clone해서 넘긴다.

출처 : http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.32&url=/Performance/PropertiesShouldNotReturnArrays.html

 

- Do not initialize unnecessarily

이유 : CLR이 생성자를 실행하기 전에 모든 fields를 기본값으로 초기화를 한다. 대부분의 경우 생성자 안에서 field들을 기본값으로 초기화 하는일은 중복된 작업이다.

해결책 : 생성자 안에서 기본값으로 초기화하는 코드를 삭제

출처 : http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.32&url=/Performance/DoNotInitializeUnnecessarily.html

 

<< Usage Rulse >>

- Non-constant fields should not be visible

이유 : read-only가 아닌 static field 상수는 쓰레드에 안전하지 않으므로..

해결책 : read-only로 만들거나 public을 제거하여 노출하지 않는다.

출처 : http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.32&url=/Usage/NonConstantFieldsShouldNotBeVisible.html

 

<< Design Ruls >>

- Abstract types should not have constructors

이유 : 추상 type의 생성자는 상속받은 type에서만 호출할 수 있으므로 추상 type은 public 생성자를 갖으면 안된다.

해결책 : public생성자를 protected 생성자로 변경

출처 : http://www.gotdotnet.com/team/fxcop/docs/rules.aspx?version=1.32&url=/Design/AbstractTypesShouldNotHaveConstructors.html

?? : 그다지 공감가지는 않는데... 어짜피 추상 type의 객체를 바로 만들 수가 없는데...

'programming > c#' 카테고리의 다른 글

10가지 .Net용 무료 개발 툴  (0) 2005.11.03
열거형 클래스 예제  (0) 2005.10.22
.NET Test Driven Development의 모든것...  (0) 2005.10.03
enum class example

>더보기


'programming > c#' 카테고리의 다른 글

C# coding guideline  (0) 2005.10.22
.NET Test Driven Development의 모든것...  (0) 2005.10.03
The 30 Minute Regex Tutorial  (0) 2005.10.03

뭐.. 왠만한게 다 될꺼라는 생각은 갖고 있지만... 레지스트리 조작하는 코드는 첨 보네요..

 

혹시라도 쓸 일이 있을지 몰라 소개합니다.

 

출처 : http://codebetter.com/blogs/sahil.malik/archive/2005/09/13/131900.aspx

 

MVP인 어떤 분이 정리해 놓은 TDD 관련 자료들입니다.

지금까지 본 내용 중 제일 많은 양이 아닌가 싶네요..

 

출처 : http://codebetter.com/blogs/darrell.norton/articles/50337.aspx


>더보기


'programming > c#' 카테고리의 다른 글

열거형 클래스 예제  (0) 2005.10.22
The 30 Minute Regex Tutorial  (0) 2005.10.03
DAAB의 버그(??)  (1) 2005.08.09

처음 공부하는 사람이 보기도 좋고, 레퍼런스로 활용해도 좋게 정리를 잘 해 놨네요.

 

출처 : http://www.dotnetmonster.com/Uwe/DirItem.aspx/Articles/NET-Framework/The-30-Minute-Regex-Tutorial

'programming > c#' 카테고리의 다른 글

.NET Test Driven Development의 모든것...  (0) 2005.10.03
DAAB의 버그(??)  (1) 2005.08.09
ConnectionString 모음  (0) 2005.08.09

팀장님이 적당한 질문들 만들어 보라고 해서 찾아봤습니다. ㅋㅋ

다들 한 번 대답 해 보시죠~~

 

Question:What is SQL?  
Question:What is SELECT statement?
Question:How can you compare a part of the name rather than the entire name?
Question:

What is the INSERT statement?

Question:How do you delete a record from a database?
Question:How could I get distinct entries from a table?
Question:How to get the results of a Query sorted in any order?
Question:How can I find the total number of records in a table?
Question:What is GROUP BY?
Question:What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a table?
Question:What are the Large object types suported by Oracle?
Question:Difference between a "where" clause and a "having" clause ?
Question:What's the difference between a primary key and a unique key?
Question:What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
Question:What are triggers? How to invoke a trigger on demand?
Question:What is a join and explain different types of joins.
Question:What is a self join?

 


>더보기


DAAB(Data Access Application Block)를 이용해 application을 만든게 있는데, 몇가지 문제점이 발견되었다.

 

1. connectionString을 넘기면서 호출하는 method를 사용할 경우, 거의 대부분 문제 없이 수행되다가 아래와 같은 에러가 간혹 발생하는 경우

System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection (SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at System.Web.SessionState.SqlStateConnection..ctor(String
sqlconnectionstring)

 

1번의 경우 아직 정확한 해결책을 찾지 못했지만 오늘 가장 근접한 내용을 찾았다

링크는 http://geekswithblogs.net/gavin/archive/2004/09/21/11482.aspx

 

2. 아래와 같은 메소드들을 호출하면 connection 연결이 안되는 문제

SqlHelper.ExecuteNonQuery(_connstring, CommandType.StoredProcedure, _spName, _arParms)
SqlHelper.ExecuteReader(_connstring, CommandType.StoredProcedure, _SPName, _arParms)
SqlHelper.ExecuteDataset(_connstring, CommandType.StoredProcedure, _spName, _arParms)

 

2번의 경우 connetionString이 아닌 connection object를 생성해서 연결한 후 넘기면 문제가 해결 되었다.

 

DAAB를 실전에 사용하시는 분들은 꼭 주의하시길...

'programming > c#' 카테고리의 다른 글

The 30 Minute Regex Tutorial  (0) 2005.10.03
ConnectionString 모음  (0) 2005.08.09
(수정).Net 개발자라면 꼭(?) 사용해야 하는 툴  (0) 2005.06.21

http://www.connectionString.com 보다 나은 듯

 

 

출처 : http://www.codemaker.co.uk/it/tips/ado_conn.htm#SQLClientManagedProvider


>더보기