Amazon.com Widgets

New FxCop rules from the community

Four or so years ago when we got serious about FxCop internally one of the main design points we had is that the community would not only find value in the rules we created, but would also add their own.  I see today that at least one person has started doing just that.  Thanks Brady

 

fxcop rule : checking for IDataReader in method parameters

 

Know of any others?

 

Published 19 July 04 05:20 by BradA

Comments

# Pattern Guru said on July 20, 2004 1:20 AM:
Cool. At our company we are doing stuff with FxCop rules, but it's specific for a sort of framework and application architecture we're working on and so far it's all still internal work. All of this means nothing about it can be found online. (Yet?)
# Anand said on July 20, 2004 1:21 AM:
Well I wrote some for the older versions. Have not had the time to update them, but I still get questions on writing new FxCop rules, because people read the information at my site, http://www.fxcop.tk.

I wanted it to be more of a place where people can learn to write FxCop rules rather than be rules repository. Thats why I still have those source files there, even though most of those rules are now part of the FxCop release.
# geoffrey@orbitone.com said on July 20, 2004 1:51 AM:
I know that John Robbins wrote an article creating FxCop rule. You can find on
http://msdn.microsoft.com/msdnmag/issues/04/06/Bugslayer/default.aspx

And in the sample there are design rules and some Performance rules
# Jason Coyne said on July 20, 2004 6:34 AM:
What is the major problem with passing the DataReader to a constructor, vs any other kind of method? Does the constructor have some additional overhead in it?

I can understand wanting to keep the datareader open for the minimum amount of time possible, but say you have a class (or class hierarchy) that represents a given database structure, woudlnt it make sense to pass the datareader into the contstructor or factory, and have everything built that way, and avoid the overhead of a datatable?
# brady gaster said on July 21, 2004 9:45 AM:
thanks for the link! i'm trying, but it ain't easy to write these puppies!
# brady gaster said on July 21, 2004 10:31 AM:
Want to help me with a problem i'm having writing another rule? Take a look at this discussion on the GotDotNet FxCop board.

http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=246144

Help!
# Rob Caron's Blog said on July 22, 2004 12:33 AM:
# My Blog said on July 22, 2004 3:02 AM:
# My Blog said on July 22, 2004 4:44 AM:
# Kris said on July 22, 2004 7:11 AM:
I'm with Jason on this one. I don't see why using an IDataReader as a method argument is such a horrible thing. Obviously passing IDataReader across tiers/application boundaries is a bad thing. However, if you read the MS PAG on Performance you can see that they always advocate using IDataReader vs. the heavier DataSet, with the tenet that you use it within the same application layer. Having a factory method which accepts IDataReader or IDataRecord vs. DataSet/DataTable seems completely valid with this in mind.
# William Robertson said on July 23, 2004 11:59 AM:
Hoping to see a reply for why the IDataReader as a method parameter is bad. I just started doing that to use OleDbDataReader, SqlDataReader, and OracleDataReader in one wrapper.
# Ben said on July 27, 2004 3:05 PM:
I wouldn't consider passing an IDataReader around to be bad, as long as it's not passing through teirs anyway.
# David M. Kean said on August 16, 2004 7:08 PM:
I have started writing a few rules, including some that are used by Microsoft internally.

<a href="http://managedfromdownunder.blogspot.com">http://managedfromdownunder.blogspot.com</a>
# David M. Kean said on August 16, 2004 7:09 PM:
Whoops stuffed up the link:

http://managedfromdownunder.blogspot.com/
# Managed from down under said on September 19, 2004 5:11 AM:
# Managed from down under said on September 19, 2004 8:25 AM:
# Managed from down under said on September 19, 2004 8:29 AM:
# Managed from down under said on September 21, 2004 6:23 PM:
# Managed from down under said on September 21, 2004 6:26 PM:
# Managed from down under said on September 22, 2004 6:51 AM:
# Managed from down under said on September 22, 2004 8:59 AM:
# Managed from down under said on August 3, 2005 7:24 AM:
New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker