domenica 16 settembre 2012

Expose the Domain Service to other types of clients, formerly "SOAP Endpoint"

Don't believe who say that it's easy to expose a Domain Services using SOAP endpoints. Expose a RIA Domain Service to other clients, glad to the very infrastructure of RIA Services, it's not painless. First of all, it needs some changes to the web.config, that's not a problem at all.
You will get the very painful steps just when try to connect to your domain services. The RIA endpoints are automatically generated by the service itself, so, you have no way to control them (some workarounds exists but I feel like they can create problems in future releases of RIA Services, or even in different configurations, because they're hack on IIS URL registration).

domenica 22 luglio 2012

Filosofia della stesura del codice

Proprio l'altro giorno commentavo insieme al mio amico J0rd4n0 un link da lui twittato riguardante dieci semplici cose da ricordare quando si scrive codice. La discussione era particolarmente filosofica, e mentre l'articolo da lui postato considerava quei punti "assolutamente necessari", io ero più propenso a dire che si stesse parlando di passaggi da valutare caso per caso. Inizierò quindi un esame punto per punto di questa filosofica discussione.

Lambda Expressions in .NET

Lambda expressions are anonymous functions used to create delegates and complex expressions. They can contains expressions-only instructions and complete functions bodies.
In the beginning I must admit that I haven't seen any necessity to use them inside a context like the .NET Framework. I've mostly seen them useful for interpreted languages like Javascript. Using LINQ, I always prefered to use SQL-like sintax against extension methods and lamdba expressions.  Instead, during a recent .NET Campus event, I've completely changed my mind. I have been illuminated when I saw lambda expressions applied to several sorting and selecting algorithms in XNA development. They're the best choice for who need to write fast delegates without getting dirty the class code with functions that will be used very rarely.