Skip Navigation

New office new artwork

7 May 2010 10:03 by pete.williams

The painting magician that is 45rmp was in over the bank holiday weekend. He's done another great job for us, take a look at these!

 









Tags:

We're on the move

12 April 2010 10:46 by pete.williams

After a very busy start to the year we have outgrown our current office so are on the move. We’re taking a bigger room at St Nicholas House so thankfully don’t need to change our address!

The new office upstairs has a lovely view of Castle Park and Bristol Bridge.

 



We're also on the look for a new developer so watch this space for the job ad!

Tags:

Using partial classes to make LINQ to SQL even more useful

10 March 2010 11:14 by steve.temple

Recently I got into a discussion with an interviewee for a developer role here at Gibe, I thought it was interesting and misunderstood enough to warrant a blog post on the subject. The gist of it was a problem he was having because he wasn't able to add methods to the LINQ to SQL classes that get created by the drag and drop editor. Well he had added methods but had done it by modifying the generated source code which were overwritten if he wanted to update a table to pick up some new fields.

One of the big advantages of using LINQ to SQL is the speed of development it allows. I used to create class libraries with data objects which tended to be pretty dull code, just grouping data from tables into logical objects. LINQ to SQL and the visual studio designer does away with this by automating the creation of these data classes which is awesome and saves a bundle of time, however some of my classes would have a few methods for doing some manipulation of the data. How do you do the same with Linq to SQL without hacking the generated code.

The solution to this is using partial classes, for those who don't know, partial classes allow you to spread the code for a class over multiple files. It's how webforms manage to hide all the code that you used to have in .NET 1 projects when you added controls to your aspx pages. In .NET 2 they've tucked all that code away in a partial class so you can't fiddle with it and break things. A much more elegant solution than the previous version which had comments in the code behind file telling you not to touch some of the file. The dynamically created LINQ to SQL classes are all partial classes, which lets you perform the same trick.

As a sample imagine I've got a Product table in my database and I've just dragged this table into my dbml designer. This handily creates me a Product class in the .designer.cs file which I should leave along. But now I want to add a method to get the total stock of this product. The stock levels are spread over two fields, one in stock now and one due in. I can create a new class in the same project called Product like so:

public partial class Product
{
    public int GetTotalStock()
    {
        return this.Stock + this.DueInStock
    }
}

Note that this is a partial class with the same name as the one the visual studio designer has created for me. Because of this .NET will add the methods, properties and attributes added in this class together with all the other partial classes with the same name (and namespace) in this project. So I'll now be able to use the GetTotalStock method along with the other designer generated properties that are available in the Product class ... Simples.

Office Art

17 February 2010 10:06 by pete.williams

We've decided to brighten up office with some wall graffiti. After putting out a shout on twitter we found a chap called 45rpm, who really understood what we wanted and did a great job bringing our boring white walls to life. His site is http://www.thebearded45.co.uk/

Here is the first scamp 

 

Then he created a fully detailed line drawing



Here’s the canvases drying



Et voila – We’re really chuffed and it brings the office to life

Its hard to get a sense of scale from the pictures but its pretty big!

 


Tags:

Freelance PHP developer wanted

1 February 2010 11:05 by pete.williams
We’re looking for a great freelance PHP developer to work from our office creating Drupal based sites.

We have various projects coming up and we need someone who knows your way around Drupal, including developing bespoke modules and custom theming sites. They also need to be a bit of a html and css whizz, know JQuery and be familiar with MySQL.

If you fit the bill, drop us a line and we’ll meet up for a chat.