Skip to main content

Posts

Showing posts with the label C#

Resharper add-in idea - highlight IDisposable vars

[Update 18th July 2013] @RobGibbens and Greg Hurlman picked up on this - Rob pointed out that there is an FxCop rule that can do this and Greg suggested a Visual Studio extension. I've had a quick look at the Visual Studio options and it looks like an " Editor Extension " is a good fit....hmmm, Project New, click...doh...dammit I really don't have time for this but it looks a fun little diversion! I'll update here if I get anything working. [Original Post] Had an interesting idea for a Visual Studio Resharper add-in the other day but don't have the time to implement it so thought I would put it out there...it might already exist (and hopefully someone can point me in the right direction) or someone will build it (Darren Voisey where are you?!). The idea is very simple really - when you have a variable for an object that implements IDisposable it gets highlighted or a tell-tale is displayed to let you know it should be disposed or should be wrapped in a u...

My ideal Bootstrapper...

[ Update 29-Apr-12 ] I've revisited Bootstrapper for a new project and it does register the StartupTasks in the IoC container and resolve them from there too (if you have your IoC extension before your StartupTasks) - this means any dependencies your StartupTask should be resolved. I don't know whether BootStrapper always did this or I was just too lazy to find it out - however with this feature you can pretty much disregard the following post! [ Original Post ] I like the Bootstrapper codeplex project - it's a nice clean approach to setting up your application....however... I have a specific requirement to satisfy as part of my bootstrap process and I'm not sure if Bootstrapper can solve it. I'll be honest I thought it easier to write this post as I wanted to talk about my ideal Bootstrapper as well as someone hopefully telling me if Bootstrapper can do this or not!. Lets say I have an IoC container that needs configuring - easily done with Bootstrapper. I...

Announcing MonitorWang - a distrbuted system monitoring tool

I've just launched my latest in the " Wang " series of projects - MonitorWang ! Essentially its an Open Source windows service that runs plugins for performing "HealthChecks" and reporting the results to Sql, WCF, NServiceBus and even your iPhone via Growl. You can write plugins for your custom "checks" (eg: how many customers called "Smith" from Town XYZ have registered in the last 2 hours) and also plugins for scheduling them as well. I spent a fair bit of time on the docs so I won't reguritate it all here - head over to the Codeplex site to find out more. Enjoy!

Announcing FluentGeoApi - a C# wrapper to GeoAPI.com

I'm pleased to make public the fruits of my late nights.... FluentGeoApi ! I previously mentioned that I am working on a private/personal project - well it's got an element of geolocation to it and after a bit of internet research I found GeoAPI.com . In order to interact with GeoAPI I decided to write a fluent style wrapper over the top of it and I've just released v1.0.0.0, a .Net 3.5 C# library to take the pain out of making REST calls and dealing with the GeoJson wire format used by GeoAPI. It's not 100% coverage of the API but I plan on getting there ASAP...however I've implemented Create/Modify/Delete a user entity, Simple and Keyword Search which is enough to release it. If you are working with geolocation data/features in your .Net application I would check out GeoAPI.com - I've been really impressed with what if offers (and if you hit the api < 20,000 times a day it won't cost you a penny!) - hopefully you'll also consider using FluentGe...

This month I'll be mostly....

...adding some major new features to DeploymentWang. First up is a configuration sub-system - key features are spreadsheet driven (building on LinqToExcel capability currently in DeploymentWang) and runtime updatable including across multiple applications and servers using distributed caching (will probably ship with plugins to Velocity & SharedCache); no more application restarts to pick up web/app.config changes, hooray! The second new feature will be an entire application health monitoring subsystem with a plugin architecture for writing custom health checks pertinent to your application. Maybe this will be in a new project, "MonitorWang"...we'll see. Both of these have come about from experience learnt during the successful delivery of my latest project, Tesco Entertainment

That's DataWang...(Google Sets API)

Inspired by Mitchell & Webbs " NumberWang " I have created " DataWang ".... " DataWang is a .Net library that can generate useful, realistic data for use in the development/mocks/testing process. Based on Google Sets, this library provides a .Net API over the Set functionality (by making http calls and parsing the html response). Google Sets currently does not expose a programmatic API - DataWang provides you with programmatic access to this API! DataWang is a completely extensible framework for mock data generation. It is fully interface driven and all components are dependency injectable. You can provide your own implementations for any of the component interfaces should you wish to extend or modify its behaviour. Google Sets often cannot generate the data you require - so DataWang will manufacture a list based on the results of making multiple Google Set calls - email addresses is a good example (a first name call + "@" + a domain name call). D...

WCFServiceWrapper: v0.2 release

Update: 15th July 2008 - Project now hosted on Codeplex , links below updated. v0.3 is underway, check out the issues list on Codeplex; these will all be fixed in this next release. After creating WCFServiceWrapper I've been using it a fair bit to whip up wrappers to several existing business layer interfaces... (Recap: WCFServiceWrapper is a .Net application to generate the service layer code required to expose any existing non-WCF interface via WCF). I'm releasing v0.2 which includes... * New WinForms UI * Support for generating VB code. Console app cmdline switch /L:VB * Bugfix: Primitive datatypes and void return types from interface methods where not being handled correctly. * I have also refreshed the WCFServiceExample project to include this new version in the example zip. Version 0.2 application source code and example project can be downloaded from the new Codeplex project here (The example is a VS2008 solution providing a simple business assembly and an empty WCF se...

Ninject...

...hallelujah! What is Ninject ?! (taken from here ) " In 5 seconds Ninject is the ninja of dependency injectors. In 30 Seconds Ninject is a lightning-fast, ultra-lightweight dependency injector for .NET applications. It helps you split your application into a collection of loosely-coupled, highly-cohesive pieces, and then glue them back together in a flexible manner. By using Ninject to support your software’s architecture, your code will become easier to write, reuse, test, and modify. " One of my main bug bears with Spring.NET is the feature bloat (I really don't need 70% of the features) and the xml configuration hell (and the same can be said of many IoC/DI frameworks). I'm using Castle/Windsor at the moment and even with this lighter weight framework the configuration bogs you down. I have my own solution using "Assemblers" to construct preset object tree implementations of interfaces - the "assemblers" themselves are created using IoC so I c...

Wrap your existing business layer with WCF

[Update: 21-Jun-08, v0.2 released...more info here ] I've recently had some hands on exposure with WCF. My initial impressions are that its pretty slick. However I was pretty perturbed to learn how invasive WCF is - specifically the "DataContract" attributes required to control the entity serialisation. When designing software I start in the middle - usually a vanilla interface that represents some activity - this activity is UI and Data layer neutral...its upstream clients could be a UI or equally a service, likewise I make no assumptions about the persistance (if any) that might be required. So I was pretty unimpressed to learn that to expose an activity via WCF I needed to retrofit some WCF specific attributes to my interfaces and data entities in order for them to be WCF friendly. This does not sit well with me. Suddenly a context neutral component needs to know that it *might* be part of a WCF service and therefore has to be attributed just in case it is....and what ...

Monitoring (Part 1): Whatchoolookinat?

Continuing my "Business Agility" series (I promise to explain what I mean by this!) I wanted to talk about another area of software that is often over looked and lacking information...application performance monitoring. To start with why is performance monitoring important and what has it got to do with "business agility"? As with my previous post on debugging it is the lack of information that directly impacts the ability of the business to improve its software. The lack of performance information is a blind spot as to what is actually happening operationally with your software. Ignorance of a problem doesn’t always equal bliss! In my experience much business software is written without regard for performance. However this is not the sin - the sin in my eyes is that the ability to measure performance is often not thought about at all and if performance does become an issue then it is often too late to put in place a good, consistent monitoring framework. Performan...

Debugging: Through the looking glass

Update 10-Jan-2008: I have added a link to a full trace log to one of our service calls to demonstrate the type and quality of information you should be logging... One of the biggest areas for improvement in software development is debugging - or put another way, reducing the time to understand and fix bugs - lets call this Time To Fix (TTF). Reducing TTF has some benefits directly related to "Business Agility"- more bugs can be tackled and fixed in a given period or a set threshold (severity) of bugs can be fixed in a shorter time. Rather nicely the means to improve TTF actually reduces the number of bugs being produced over time - we'll cover how this works later on. Objective Drawing on my "Business Agility through Component Software" concept and from hands on development these past ~three years I have experienced first hand how inefficient bug fixing can be and how enormous time savings can be made with a better approach to designing and implementing your s...

Act 1; Scene 1

As previously mentioned I want to write about my "Business Agility through Component Software" concept. This encompasses several aspects of software design and crucially includes operational considerations. I'll be writing a series of posts covering all of this...however in true "reuse" style I want to provide a common "set the scene" post to explain the work I have been doing and give context and background to the actual post that will reference it. I work for a Digital Media "supply chain" company. We ingest (take delivery) of media files (WMA,WMV, metadata & images) and perform a number of processing steps on them before eventual delivery to a consumer via a digital retail front end (website, WMP Online Store, gadget etc). This past twelve months I've been involved in re-developing the delivery services on our core retailer platform. These services are used to... Deliver a media file (WMA, WMV) to a PC/Client Generate Windows Media...

Service.Resume();

Hello everyone...er...anyone?! I'm dusting off the blog at last - and shocked to see my the last time I published was 6th Dec 2006.....oh gosh....oppps! I've been very busy working on rewriting the entire set of services for our Media delivery and licensing platform and integrating them with several large projects. I've finally surfaced from this and want to start sharing my knowledge and experience of the past year working on things such as.... Windows Media licensing (subscriptions, full licenses, revocation, generation) Type 1 Windows Media Player Online (Active) Stores ASP.NET as a service platform (http modules) Software design (Inversion of control, Dependency Injection, Spring.Net, Behaviour Driven Design) Business agility through software component design The future of Digital Media and general thoughts on where its all going and where technology fits in with it. I've started the ball rolling by updating my most popular blog post ( .Net custom configuration ) to...