LINQ to SQL – IsNull and Ordering

January 30, 2010

I thought I would share a nice small tweak I made to a LINQ to SQL model. Assume I have the following table structure for ‘Categories’: I faced with the need to select categories while ordering it by the combination of Description1 and Description2 (Note: nullable fields). I entered some dummy data to the table to illustrate the point:   The goal is to retrieve the order as follows: 1, 3, 5, 2, 4 After explaining that, lets forward to the LINQ statements then. Take 1...
tags: , ,
4 comments

WCF 4 Routing Service – Wrapping it up

January 25, 2010

The routing service that ships with WCF4 beta 2 is a very useful layer for implementing basic standard router facade which provides virtualization, versioning, protocol bridging, windows identity impersonation, transaction propagation and routing capabilities for your back-end services. Unfortunately, I’m afraid that it has a lot to advance in order to be usable for advanced more-sophisticated layer as far as it goes for implementing an actual management layer for message brokering and a policy enforcement point. Following are links to my previous posts concerning the routing service: WCF 4 – Routing Service, The Beginning WCF...
tags: ,
no comments

WCF 4 Routing Service as a PEP (Policy Enforcement Point)

January 24, 2010

This will be the last feature requirement I plan to check with the router service of WCF 4. One of the core purposes for developing the router facade here at my workplace was to have our own layer where we could implement and ensure any kinds of standards/policies. Few examples include encryption, SLA, authorization, logging, notifications. The list goes on. These things require me to have control over the request and reply messages as well as the invocation process flow. Let’s take a simple authorization for example - Let’s assume we have a simplified authorization module we would like to implement in our...
tags: ,
no comments

WCF 4 Routing Service – Runtime Governance

January 21, 2010

One of the goals for building the router facade at my workplace was to make it an essential runtime agent for registering runtime data to the governance realm I implemented. The router sends meta-data of all the runtime messages that goes through it over to the governance registration service queue. Basically, this means that I need a way to intercept every request and reply. I couldn’t find a complete solution for that in the current WCF 4 Routing Service, which is the fourth point of failure. The best way that I found to go about...
tags: ,
2 comments

Comparing NHibernate and EF 4

Entity Framework has made great progress towards being a popular ORM framework. EF 4 is much more practical and usable version than its previous one. There’s a nice post which debates about the comparison between NHibernate and EF4: Debate: Comparing NHibernate and EF 4 “The general consensus appeared to be that NHibernate has a number of features which are missing from Entity Framework 4.0 like read/write batching, "extra" laziness, collection filters, tweaking, and others, however Entity Framework has a better LINQ provider, documentation and it is supported by Microsoft”
tags: ,
no comments

WCF 4 Routing Service – Resolve Endpoint in Runtime

January 20, 2010

The WCF Routing Service comes with a nice set of configuration for defining the client endpoints and the filters to map them for a single request. You can define filters, be that on the message headers or content (using XPath) in order to select the appropriate endpoint to the back-end service. I was looking for a way to determine this in runtime. The router facade I built uses information from the service registry to select the endpoint information for communicating with the back-end service. This means that I can’t follow the standard way of defining...
tags: ,
2 comments

WCF 4 Routing Service – O/W Operation and Corresponding Channel Shapes

January 19, 2010

O/W operations require to be invoked through the ISimplex contracts which represent O/W channel shapes. When I say O/W operations, I mean that the channel shape reflects that too. E.g. TCP protocol is by nature a duplex channel, you should invoke O/W operations through IDuplexSessionRouter contract. I couldn’t manage to call a O/W operation for a back-end service which is exposed with WsHttpBinding with Reliable Session enabled! That is the second point of failure. In addition, At my router facade I have rich meta data regarding the target back-end service...
tags: ,
one comment

WCF 4 Routing Service – Supported Bindings

For starters, I had to examine if the router service supports all the common bindings we’ve been using in our enterprise. The following worked just fine: BasicHttp Http Protocol, Text Encoding and Soap12 Message Version (part of the WS-I Basic Profile) WsHttp Standard Reliable Session (instead for O/W – more at the next post) ...
tags: ,
no comments

WCF 4 Routing Service – Going Basic

The routing service that comes with WCF 4 enables you to make a single up-front layer for accessing back-end services. The basic concept is that you define endpoints for your router service to be accessible by consumers as well as the internal client endpoints the router service will call the back-end services with. This shields clients from having to know about the physical findings of the back-end services, allowing you to implement useful things such as versioning, virtualization, protocol bridging, routing, PEP and back up lists (call a different service if the main one is down)In addition, the routing service supports preserving...
tags: ,
one comment

WCF 4 – Routing Service, The Beginning

I have decided I had enough time to “rest” while being swamped with work and personal agenda over the last few months, it’s time to get back on the saddle. I mentioned it some time ago, but one of the core projects I have been working on is building a smart router facade, a sort of a message broker, providing versioning, virtualization, PEP and so on. WCF 4 introduces us with a nicely wrapped router service OOTB. I was on my way to try to determine if I can use that service as the base implementation...
tags: , ,
one comment