IgorShare Weblog

Practical Engineering

Archive for the ‘.NET’ Category

Messaging Platform and Service Bus Resources

Posted by igormoochnick on 10/25/2009

On the recent project we’ve put in place a messaging platform. Apparently my engineers had a vague understanding what that is. To save you the same trouble I’ve gathered a bunch of interesting resources that can help you get up to date:

Open source Service Bus implementations

nServiceBus

MassTransit

WCF (misc)

Posted in Messaging, REST, Service Bus, WCF | Leave a Comment »

Now I have ALL of the Microsoft developer certifications – long journey is over!!!

Posted by igormoochnick on 09/09/2009

Now I own the full deck of the Microsoft certifications and I can sit back and relax (beer is in order ;-) . Unfortunately, in the startup world that I operate most of the time, it’s not very recognizable achievement, but it’s nice to put these logos on my presentation slide decks and, especially now, I have a very powerful bragging rights – I have ALL of the Microsoft developers certifications !!!

It was a lengthy path and, I should add, a very confusing one. It wasn’t very obvious what certification is a prerequisite to which one and, I must add, I’ve made a couple of mistakes on the road until I’ve discovered a developer’s certification map by Jorgen Thelin that put everything in order and cleared all the confusions.

ms-cert-path-mcpd_4[1]

Posted in .NET, ADO.Net, ASP.NET, C#, Community, Thoughts, WCF, WPF, Workflows | 6 Comments »

WCF Certification (70-503) is mine!!! Now I’m a certified (MCPD) Enterprise Application Developer

Posted by igormoochnick on 09/06/2009

If you were wondering why there was a silence on my blog – I was preparing for a battle with the Prometric testing computer ;-) And I Won!!! Last week I’ve passed my LAST (for the near future) certification exam: Windows Communication Foundation. This gave me another MCT certification -

MCTS wcf

And finally enabled my long overdue certification MCPD Enterprise Application Developer.

MCPD ent

To those who are looking into passing this certification you may use the following materials that I found very helpful (after the break):

Read the rest of this entry »

Posted in .NET, Community, Thoughts, WCF | 2 Comments »

Building GWT web clients [Part 4.1] – How to create an Azure RESTful web service?

Posted by igormoochnick on 06/08/2009

Prerequisites: make sure that you have all the Azure SDK tools installed for your VS2008.

 

(1) Start by creating a new “Web Cloud Service” project in the Visual Studio. Give it a nice name.

(2) Add a new “WCF Service” to the WebRole project.

(3) Define a required contract:

The most important part here is to put attributes that will tell the WCF in what format to send/receive the message body (XML or JSON) …

[ServiceContract(Name = "service", Namespace = "http://www.igorshare.com")]
public interface IContactManagerService
{
    [OperationContract]
    [WebGet(UriTemplate = "/contacts", BodyStyle = WebMessageBodyStyle.Bare,
       ResponseFormat = WebMessageFormat.Json)]
    List<Contact> GetAllContacts();

    [OperationContract]
    [WebGet(UriTemplate = "/contacts/{filter}", BodyStyle = WebMessageBodyStyle.Bare,
       ResponseFormat = WebMessageFormat.Json)]
    List<Contact> GetContacts(string filter);
}

[DataContract]
public class Contact
{
    [DataMember]
    public string FirstName { get; set; }

    [DataMember]
    public string LastName { get; set; }

    [DataMember]
    public string Company { get; set; }
}

(4) Implement the service logic:

public class ContactManagerService : IContactManagerService
{
    private static readonly List<Contact> Contacts = new List<Contact>() { ... };

    public List<Contact> GetAllContacts()
    {
        return Contacts;
    }

    public List<Contact> GetContacts(string filter)
    {
        string f = filter.ToLower();

        var contacts = from contact in Contacts
                       where contact.FirstName.ToLower().Contains(f)
                            || contact.LastName.ToLower().Contains(f)
                            || contact.Company.ToLower().Contains(f)
                       select contact;

        return contacts.ToList();
    }
}

(5) Configure it to be exposed as a RESTful service:

To make it REALLY, REALLY simple for you, do this trick:

a) Comment out the system.serviceModel section in the Web.config file

b) Add the Factory attribute to the .svc file

<%@ ServiceHost Language="C#" Debug="true"
Service="ContactManagerCloudService_WebRole.ContactManagerService"
CodeBehind="ContactManagerService.svc.cs"
Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>

(6) Build the service

 

You’re interested in 2 artifacts of the build:

  1. .cscfg file – configuration for the Cloud Service deployment
  2. .cspkg file – all the bits packaged (zipped)

 

At this moment you have 2 choices:

  1. Run your project in the local Development Fabric (for testing and debugging), or …
  2. Deploy it to the Azure Cloud (for staging or production)

 

To deploy your application to the cloud, do right-click on the CloudService project and select “Publish”.

Visual Studio will launch the Azure Service Developer Portal page. Log-in to your account, create a project and deploy your bits to the staging environment:

clip_image001

 

This is it!  You’re good to go.

BTW: make sure that your application works in the staging environment and then you can push it to Production by just switching it with the Staging.

 

 

Note: Check out a great explanation about the difference between the WCF REST Configuration for ASP.NET AJAX and plain REST Services by Rick Strahl.

Posted in .NET, Azure, C#, JSON, REST, S+S, Tutorials, WCF | Leave a Comment »

CodeCamp 11 Presentation: Best Practices in building scalable cloud-ready Service based systems

Posted by igormoochnick on 03/29/2009

This Saturday I’ve held a “Best Practices” Zen-style discussion during the CodeCamp #11 in Waltham.

Some people were great, but I really expected to have more heated discussions and interesting “war” stories.

You can find the slide deck on the SlideShare

Posted in ADO.Net, Azure, Data Services, Presentations, S+S, WCF, Web | Leave a Comment »

Oslo: Basic M grammar for a generic Language

Posted by igormoochnick on 03/23/2009

I’ve noticed that each time when I need to create yet another language definition or some rules grammar, I write the same (or a very similar) “prelude”. I guess that you do the same thing. To simplify the process I’ve crystallized this basis into a simple module. It contains the definition of a Whitespaces, Single- and Multi-line comments and a commands list. You can reuse this module by importing it into your language definition.

Here is the example of a very simple language:

// This is a comment

This_is_some_command;
This_is_another_command;

/* This is a multi-
line comment */

This_is_the_last_command;

The grammar is pretty trivial (if you reuse the foundation grammar – note the import in the beginning):

module SomeLanguageModule
{
    import LanguageBaseModule { Common as C };

    @{CaseInsensitive}
    language RulesDefinition
    {
        // Delimiters
        @{Classification["Delimiter"]}
        token commandDelimiter = ";";

        token Command = c:(C.AlphaNum | "_")+;
       

        // The Program
        syntax Main
            = C.CommandList(Command, commandDelimiter);

        // Ignore whitespace
        interleave Whitespace = C.Whitespace | C.Comment | C.MultiLineComment;
    }
}

The middle section of the grammar  (Command) is where you concentrate your development efforts. Make sure to replace the Command “token” with Command “syntax”.

The Tree result from this grammar and the sample, shown at the top of this post, looks like this:

Main[
  [
    "This_is_some_command",
    "This_is_another_command",
    "This_is_the_last_command"
  ]
]

Download the sample language and the grammar from my SkyDrive.

See the LanguageBaseModule grammar after the break …

Read the rest of this entry »

Posted in M, Oslo | Leave a Comment »

ADO.Net Data Services presentation @ NEVB User Group

Posted by igormoochnick on 03/09/2009

clip_image001

Had a pleasure presenting ADO.Net Data Services (Astoria) to the New England VB User Group last Thursday.

Had a lot of fun and there were a lot of great questions.

Feel free to shoot me any questions and you’re welcome to download the PowerPoint slide deck and BeerFest  example source code (yes, we’ve talked about beer tastings ;-) .

The slides are based on the Mix’08 and PDC’08 talks.

Decided to give a try to SlideShare and published the presentation there as well.

Posted in .NET, ADO.Net, ASP.NET, Community, Data Services, Presentations, Web | Leave a Comment »

Error Handling in Workflows

Posted by igormoochnick on 02/09/2009

Note a great article by Matt Milner in the latest (Feb’09) MSDN about different ways of Error Handling in Workflows.

Posted in .NET, Workflows | Leave a Comment »

We have one more MCPD: Windows Developer 3.5

Posted by igormoochnick on 02/05/2009

MCPD_All

Received MCPD: Windows Developer 3.5 certification.

I deserve a long overdue drink!

Posted in .NET, Thoughts | 2 Comments »

New Oslo bits are out – January CTP

Posted by igormoochnick on 02/03/2009

Yesterday got new Oslo bits (January CTP) – the upgrade went surprisingly smooth. Now I’m hands deep in this new pile of bits. Giving the credit that it’s still CTP – I like the progress so far. Can’t wait to see the release version.

Posted in M, Oslo | Leave a Comment »