Tales of a Developer Advocate

Developer Relations @ Google

  • Why I love WSE 3.0

    • 18 Nov 2006
    • 0 Responses
    •  views
    • Edit
    • Delete
    • Tags
    • Autopost

    I have been using WSE 3.0 for a while now and I really like it.  I really like the policy mechanism in the WSE, it affords me a kind of AOP (aspect orientated programming) that I am really starting to get into.   For instance I have made a lot of SoapFilters recently, some handy, some just for tests, but each of them allow me to add an aspect of functionality into the webservice that I am creating in a configuration and not a design time.  If I want security, just add a policy line in the XML config, if I want auditing another line, if I want exception shielding another line.   All of these aspects of the system I am creating can be added at deployment time thus leaving my web service code clean and simple.

    An example, pseudo code:


    Code highlighting produced by Actipro CodeHighlighter (freeware)
    http://www.CodeHighlighter.com/

    -->[Webservice]
    public class OrderService
    {

    [WebMethod]
    [Policy(ServerPolicy)]
    public OrderList SubmitOrders(OrderList input)
    {
    return OrderListRepository.InsertNewOrders(input);
    }
    }

    And a policy file (not an actual file that would work in this example) would say:



    Code highlighting produced by Actipro CodeHighlighter (freeware)
    http://www.CodeHighlighter.com/

    --><Policy>
    <add type="Security" MustHaveRole="Add"/>
    <add type="Auditing" />
    <add type="ExceptionSheilding" />
    </Policy>


    This service code and policy file model is so much cleaner and simpler than what you would have to write if you didn't have an AOP style policy system:



    Code highlighting produced by Actipro CodeHighlighter (freeware)
    http://www.CodeHighlighter.com/

    -->[Webservice]
    public class OrderService
    {

    [WebMethod]
    [Policy(ServerPolicy)]
    public OrderList SubmitOrders(OrderList input)
    {
    try
    {
    if(User.IsInRole("Add") && User.IsAuthenticated)
    {
    OrderListRepository.InsertNewOrders(input);
    Log.Audit(Success);
    }
    else
    {
    Log.Error(SecurityError);
    }
    }
    catch(RepositoryException ex)
    {
    throw SheildedException(ex, "Problem in Repository");
    }
    catch(Exception ex)
    {
    throw SheildedException(ex, "Unkown Exception");
    }
    }
    }


    Now tell me which code you would like to maintain! :)


     


    Tags: asp.net, WSE, WSE3, c#, .net, webservice
    • Tweet
  • ReSharper 2.0+ Plugins

    • 13 Nov 2006
    • 0 Responses
    •  views
    • Edit
    • Delete
    • Tags
    • Autopost

    I am looking for some plugins that people might have created with Jetbrains OpenAPI.  It is pretty hard to find any at the moment.

    The only one I have seen, and it doesn't appear to have been released is http://chrisdonnan.com/blog/2006/05/10/resharper-openapi/ 

    I have some ideas that I would like to play around with but I don't think the documentation or examples are any good.

     

    Directory Tags: OpenAPI, Resharper, Refactoring, Refactor
    • Tweet
  • XNA Parallax Engine and the GSE Beta 2

    • 5 Nov 2006
    • 0 Responses
    •  views
    • Edit
    • Delete
    • Tags
    • Autopost

    Just a quick update to say that I am about to start converting the current Parallax Engine to GSE Beta, I belive I need to do this because of the significant changes that have taken place since beta 1.  Most of all the Game Designers have been removed.

    I really like the idea of having Game Designers so that you can quickly configure the basic components that you are using on your game, however to get 360 support they have had to be dropped.

     

    Tags: XNA, parallax, GSE, GameComponents, GameComponent
    • Tweet
  • About

    I help developers build really cool products on the Web.

    I work for Google as a Developer Advocate in London, specializing in Chrome, HTML5 and the Chrome Web Store.

    231036 Views
  • Archive

    • 2012 (5)
      • February (5)
    • 2011 (30)
      • July (1)
      • June (4)
      • May (10)
      • April (4)
      • March (1)
      • February (5)
      • January (5)
    • 2010 (35)
      • December (15)
      • November (5)
      • October (2)
      • August (5)
      • July (8)
    • 2009 (1)
      • January (1)
    • 2008 (8)
      • December (1)
      • April (2)
      • March (3)
      • February (2)
    • 2007 (17)
      • December (1)
      • September (1)
      • August (5)
      • May (1)
      • March (2)
      • February (4)
      • January (3)
    • 2006 (153)
      • November (3)
      • October (7)
      • September (11)
      • August (9)
      • July (9)
      • June (14)
      • May (11)
      • April (32)
      • March (23)
      • February (26)
      • January (8)
    • 2005 (274)
      • December (7)
      • November (43)
      • October (63)
      • September (54)
      • August (66)
      • July (13)
      • June (10)
      • May (10)
      • April (6)
      • January (2)
    • 2004 (1)
      • August (1)

    Get Updates

    Subscribe via RSS
    TwitterFriendfeedLinkedIn