Well, last week I have spent some time learning Cecil and Gendarme stuff. I’ve written my first draft for checking a simple rule and achieve some knowledge about these two technologies. I really enjoyed a lot learning these technologies.
I’m going to say my first impressions for each techonlogy.
- Gendarme is simple. Writting new rules is easy. You only have to implement an interface.
- Gendarme is well named. If you want to create a new rule for check types, you will implement the ITypeRule interface. If you want to create a new rule for check methods, you will implement the IMethodRule interface.
- Gendarme isn’t intrusive and is powerful. You can write the rule that you want. You can write simple rules, and also, you can write really complex rules.
- Gendarme is integrated. You can use gendarme with different development tools (you can create a NAnt task, you can use with Makefiles) and programming language (you can use VB.NET, you can use Boo).
- And finally, Gendarme is in continous improvement.
I also think Cecil is a great framework too. By this moment, I think it’s simple, it’s fast and it’s easy deal with it and you have a lot of documentation. I can’t write more about Cecil, because Cecil is bigger an I will need more time to learn it.
Well, the first rule that I’ve chosen to implement is that Attributes ends with “Attribute” suffix.
This rule will check that the new attributes ends with “Attribute” suffix. You can see the reference in C#Language Specification.
Some examples:
Good:
public class CustomAttribute : Attribute {
}
Bad:
public class Custom : Attribute {
}
In the next days, I will add more test cases and I will put some links to source code to prove that it’s really easy write this rules with Gendarme and Cecil.

2 comments ↓
Buenas! Ya veo que va genial tu proyecto GSoC. Es cojonudo que te hayan aceptado
Aprovechando que el Pisuerga pasa por Valladolid, voy a darte algunas sugerencias para reglas de Gendarme:
- Unhashable Class (propuesta por Boris Kirzner):
http://boriskirzner.wordpress.com/2007/05/29/back-to-hashcode-mutability/
- Deadlock-prone Syntax (basada en la genial idea de Alan McGovern de usar using en los locks):
http://monotorrent.blogspot.com/2007/04/i-was-just-talking-to-guy-about-some-if.html
- Empty catch (esta es de mi cosecha
:
http://lists.ximian.com/pipermail/mono-list/2007-March/034769.html
Saludos!
Gracias Andrés !
Perfecto, las apunto y si voy guay de tiempo las haré.
A ver si te cojo por el Jabber o por el IRC y hablamos un poquico
Un saludo.
Leave a Comment