Updates from October, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • Richard 7:54 pm on October 27, 2010 Permalink |  

    Amazon vs Azure 

    When Amazon’s EC2 service first came out I was amazed. I thought this was going to change things forever. When Azure first came out, I was a sceptic. The thing that put me off Azure was the tie-in. Microsoft to date are the only Azure hosting provider. I knew that there were Azure specific libraries, and that I would have to develop my app specifically for the Azure platform. Moving it elsewhere would be an expensive option. This assumption was wrong. In fact, I believe that most web-based applications could probably just be copied across onto Azure with modest, or even zero changes. It’s true, there are Azure libraries which provide you with access to things like performance counters, logging, Azure blob storage, etc… What I learned, is that most of this stuff is not necessary, and just ‘nice to have’. Playing with Azure helped me to appreciate what Amazon lacked.

    With Azure your hands are tied, you upload your files, and you’re done (with the exception of pressing the ‘go live’ button). This means that Microsoft are responsible for deploying your solution across the server farm, but not only this, they take responsibility for patching the OS, for performing the ‘transitions’ (when you swap instances). With Amazon, you’re left to figure these things out for yourself. Of course, comparing the two technologies is like comparing apples with pears. Amazon allows you to do anything you want with just about any kind of machine image you could need, Azure hosts services, data and web roles, a narrow service offering, but this probably covers 90% of the use cases out there.

    So anyway, here is a table to summarise the key differences between the offerings (there are plenty of similarities):

    Amazon EC2 Windows Azure
    Deployment You are responsible Microsoft is responsible
    Management
    (i.e. patching the OS)
    You are responsible Microsoft is responsible
    Software licence cost
    (i.e. OS and database)
    Free if using Linux/MySQL etc…
    otherwise you pay
    Software licensing included in the cost
    Choice Runs whatever you want Runs .NET services and applications that run on IIS
    (i.e. ASP.NET and PHP)

    So my advice is; if your application will run on Azure, use it, otherwise it’s Amazon.

    Advertisements
     
  • Richard 7:46 am on October 20, 2010 Permalink |  

    NHibernate Jet Driver 

    I wanted to connect Castle ActiveRecord to Microsoft Access (don’t ask me why), and struggled to find the required NHibernate Jet driver, in a compiled form. So I built the source against .NET 3.5, and you can download it here:

    NHibernate.JetDriver.dll for .NET 2.0

    NHibernate.JetDriver.dll for .NET 4.0

    NHibernate.JetDriver.dll for .NET 4.5

     
    • iPudding 10:51 am on November 14, 2010 Permalink | Log in to Reply

      Hi, I’ve use your dll. It has error like this:-

      —-> System.IO.FileLoadException : Could not load file or assembly ‘NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

      Are there another dependencies should I import? Please help me. Thanks

    • iPudding 11:18 am on November 14, 2010 Permalink | Log in to Reply

      Sorry about my previous post. The problem cause from NHibernate v.3 isn’t compatible with this version of NHibernate.JetDriver. It must use with NHibernate v.2.1.0.4000 only.

    • Roberto 12:38 pm on December 8, 2010 Permalink | Log in to Reply

      There is a compatible version for NHibernate 3?
      Else, could you suggest me a “local” database for a windows application? (i don’t like idea to make install of a sql server express on clients computers)

    • loktionoff 2:58 am on March 12, 2011 Permalink | Log in to Reply

      Actually the NHibernate Jet Driver works with NHibernate 3.x, however there is a little trick with assembly binding redirection that you have to implement. Add the following snippet to your app/web configuration file:

      • vnik 9:25 am on March 29, 2011 Permalink | Log in to Reply

        Hi loktionoff, can you please publish the snippet?

        Test method FirstSolution.Tests.GenerateSchema_Fixture.CanGenerateSchema threw exception: NHibernate.MappingException: Could not compile the mapping document: FirstSolution.Mapping.Product.hbm.xml —> NHibernate.HibernateException: Could not instantiate dialect class NHibernate.JetDriver.JetDialect, NHibernate.JetDriver —> System.IO.FileNotFoundException: Impossible to load the file or the Assembly ‘NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4’.

        [I’m using NHibernate v3]

        If I solve I’ve to write a little guide just to join all the efforts in the web that I found 🙂

      • davod 6:28 pm on May 29, 2013 Permalink | Log in to Reply

        It looks like you intended to include a portion of an app/web configuration file but its not here. Can you add it?

    • Eddy 9:26 pm on August 9, 2012 Permalink | Log in to Reply

      I’m converting my project from vs 2005 to 2010 v4.0. Looks like I have update NHibernate 1.x to some version. Do you have jet drivers compiled for .net v4.0? Any recommendation on the NHibernate version that I should upgrade? Thank in advance.

    • Richard 12:04 pm on August 13, 2012 Permalink | Log in to Reply

      Hi Eddy, I have added some additional download options. For (my) future reference, the source can be downloaded from here: https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.JetDriver/src/

  • Richard 7:56 am on October 15, 2010 Permalink |  

    REST in ASP.NET 

    SOAP based web services became too complicated (I completely agree), so Roy Fielding’s REST services emerged as the light-weight, quick and simple alternative. So I thought I would add some RESTful services to an ASP.NET project I’m working on. A quick scan around the internet revealed that this is no simple thing:

    http://www.west-wind.com/weblog/posts/310747.aspx

    http://msdn.microsoft.com/en-us/netframework/dd547388.aspx

    Downloading a toolkit, setting up WCF Data and Service Contracts, messing about with web.config, blah blah, this is all too complicated, and is at complete odds with the REST principal of simplicity. So my solution? Create an ASP.NET page, remove everything on it, but a single repeater:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Rest.aspx.cs" Inherits="StateMagic.Web.Rest" %>
    <?xml version="1.0"?><asp:Repeater runat="server" ID="repeater">
    <HeaderTemplate><states>
    </HeaderTemplate>
    <ItemTemplate>  <state href="?state=<%#(Container.DataItem as string)%>&username=<%= Server.UrlEncode(this.Credentials.Username) %>&apikey=<%= this.Credentials.ApiKey %>&modelid=<%= this.ModelId%>"><%#(Container.DataItem as string)%></state>
    </ItemTemplate>
    <FooterTemplate></states>
    </FooterTemplate>
    </asp:Repeater>

    Then in the code behind, you read in the parameters on the query string, perform the necessary database query, and bind the resulting objects to the repeater.

    Yes, it’s ugly, but it’s simple, and you have ultimate control over the way the XML looks.

    Perhaps it would be better to define an object model, and use the serializer to write that out to the response stream instead, but it seemed like more worker, and the serializer isn’t quick.

     
  • Richard 7:56 am on October 13, 2010 Permalink |  

    Hello world! 

    Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

     
    • Mr WordPress 7:56 am on October 13, 2010 Permalink | Log in to Reply

      Hi, this is a comment.
      To delete a comment, just log in, and view the posts’ comments, there you will have the option to edit or delete them.

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel