Mathew Nolton Blog

Software dementia unleashed...

March 2004 - Posts

Follow the .Net convention of appending Attribute to the name of your Attribute class at your own risk.

I have been delving more and more into custom attribute programming more and more lately and the following is a quote from my validation article (click here to view the article).

It is a .NET convention to append “Attribute” to the name of each custom attribute type class. Then when assigning an attribute to an item, you may leave off the “Attribute” portion of the name so that you can decorate your items in the following manner [RequiredItem()] or [RegEx(….)]. This feature has a side effect. If you define two attribute type classes, one with the name RegExAttribute and the other RegEx you will be able to compile your project; however, when you attempt to use the class RegEx, you will get the following compilation error:

’RegEx’ is ambiguous; use either ‘@RegEx’ or ‘RegExAttribute’

I recommend you follow the .NET convention; regardless, it is a good idea to pick a single convention and stick with it.

Posted: Mar 30 2004, 05:08 PM by MatiasN | with 2 comment(s)
Filed under:
Validators in the Middle-Tier-A New Article on TheServerSide.Net

I just published an article on TheServerSide.Net. It's about creating and using validators in the middle-tier. Specifically, it talks about how to use attribute progamming along with reflection to decorate and then validate parameters, properties and fields.

http://www.theserverside.net/articles/showarticle.tss?id=Validators

The code can be gotten from here.

http://www.cybral.com/solutions/tools.htm

Any constructive feedback is appreciated.

Posted: Mar 23 2004, 02:11 PM by MatiasN | with 1 comment(s)
Filed under:
Problems with P/Invoke.....Check out ClrSpy

Adam Nathan posted a cool little tool called CLRSpy for finding problems with P/Invoke on the GotDotNet board. We have a problem where we think a Cash Reader Device and Crystal are stepping on each others memory with a Kiosk Framework written in .Net .... I haven't used it yet to see if it solves my problems but it looks like it is worth a look.

-Mathew Nolton

Posted: Mar 19 2004, 10:04 AM by MatiasN | with no comments
Filed under:
Performance Metrics

Performance Tips and Tricks of .Net Applications. All too often we fall into what is easy versus what is right. I saw a comment in a discussion on www.TheServerSide.Net where someone pointed out the evil-ness of foreach. The trade-off and ease of use that enables us to write tight-compact code can sometimes cause a bloat in performance. We all must be diligent in the code we write....IMHO

 

Posted: Mar 09 2004, 04:44 PM by MatiasN | with 2 comment(s)
Filed under:
More Posts