Web Log di Adrian Florea

"You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
posts - 440, comments - 2715, trackbacks - 3944

My Links

Archives

Post Categories

Image Galleries

.RO Blogs

.RO People

.RO Sites

Blogs

Furls

Links

vinCitori

maggio 2006 Blog Posts

Enums with a single default value

Nel libro di Cwalina & Abrams (p. 93), la regola "avoid publicly exposing enums with only one value" ha questo commento: "A common practice for ensuring future extensibility of C APIs is to add reserved parameters to method signatures. Such reserved parameters can be expressed as enums with a single default value. This should not be done in managed APIs. Method overloading allows adding parameters in future releases." E' proprio il caso del enum nidificato SingleSignonTicketType (SharePoint Portal Server 2003), creato solo per "riservare" il parametro Type nel metodo ReserveCredentialTicket, metodo a cui corrisponde la procedura esterna dallo stesso nome  (vedi la...

posted @ martedì 9 maggio 2006 09:06 | Feedback (25) | Filed Under [ Pattern Dappertutto ]

Quiz Sharp #55 (Joe Duffy)

Vi incito a comprare il recente libro di Joe Duffy semplicemente copiando dalla pagina 24 queste due righe di codice: int? x = 10;Console.WriteLine(x.GetType()); Cosa stampa a console e perché?: A. System.Int32 B. System.Nullable`1[System.Int32]

posted @ sabato 6 maggio 2006 18:17 | Feedback (40) | Filed Under [ Quiz Sharp ]

Powered by:
Powered By Subtext Powered By ASP.NET