Browsing articles in "Dev For Noobs"
Jan
23

Sexy DataTables with for Asp.Net MVC

Just thought I’d pass this little gem on as it’s saved me a lot of time (eventually) and given me a much more finished solution in the end than my hacked together attempt.  Whilst trying to produce a simple reporting app I required a table view along with pagination, sorting and  search, I went about trying to produce each individual element in MVC and had come up with a half-baked solution but it didn’t “smell right”.  Anyway whilst surfing t’interweb I came across this tutorial

http://blogs.msdn.com/paulwhit/archive/2009/03/28/walkthrough-full-example-of-using-mvccontrib-grid-with-jquery-datatable.aspx

It was a really simple way to create the exact table I wanted with out using Grids etc..  The only issue I had came from using MVCContrib the version I used needed MVC 2 so I upgraded the project by starting a fresh and cutting out a load of controllers and views etc.  All in all a much more finished attempt thanks to the great work of Allan Jardine and the MVCContrib guys.

Resources:

http://www.codeplex.com/MVCContrib

http://www.datatables.net

http://www.asp.net/mvc/

Jan
18

Tools of the trade

By Andy  //  Dev For Noobs, Rants  //  3 Comments

Inspired by Rob Conery’s post I’ve decided to write my own blogging engine and yes I can so see all those out there’s point that there is a massive amount of more than adequate blogging engines, CMS’s etc already out there what’s the point and in many ways I agree I’ve tinkered with wordpress for long enough now to realize how much work has gone into that to bring it to the masses and in the reasonably polished stat it’s in now.  Looking at subtext etc I can see the amount of love and attention that has gone into these engines is phenomenal and in some ways it seems disrespectful to shun them and try for some half arsed has up that will be my attempt but at the end of the day it’s my attempt and that’s what matters.  As a reasonably junior developer I can see all the benefits  of creating my own.

Speaking as someone with 3-5 years experience in development and 8+ years experience as process Technician and Time served ToolMaker I feel little emphasis is but on skills building in the It industry.  From my experience I’m sure others have varying experiences.  The thing I do know is that as an engineer I had to serve an apprenticeship which meant working under mentors doing menial and often degrading task with the aim of rounding me into the finished article.  Some of the initial task would involve making Items that I could use throughout my career.  Plum bob’s, clamps gauges, vices the list was impressive many of which I still have in my tool chest gathering rust in my dad’s workshop.  My point being that I could just as easily have gone and bought these tools, many of which would have been a dam sight better any one witnessing an apprentices first attempts at turning, milling etc will understand but they were ” MY” tools and I loved the feeling of working with something I’d made.  The skills learnt producing these seemingly pointless tools transferred onto production projects and strengthened my talents without the pressure that comes with high tolerance production environments.

I can see the parallels with my current web projects but unfortunately my web learning curve is higher whilst my approach to honing my skills has been much more disjointed this I believe most (Honest) Developers will agree with.  We tend to learn what we need as we need it with little structure or planning in the approach.  So as part of my new aim to really push my skills in development I’m going to produce my own blog as Rob suggests and at some point show my code so I can have a massive peer review and see where my short comings are.

The engine will be written in an MVC pattern using asp.net and I will try and implement many of the patterns and practices Rob and others have championed.  I’m also working through Rob’s storefront video series in an attempt to bring some structure and balance to my skill set.

Oct
20

A D’oh Moment

I know this is something that most devs will not find interesting but it really made me smile when I stumbeld across using static members to count object instances. Like I’ve said I’m a noob and have jumped between technolgies so I decided this week to focus on learning the C# 3.5 Language from the ground up. I dug out my copy of Step by Step C# 2008 and decided to do a Chapter every time I needed a 5 min break from my Drudge (Smokers can have a Cigarette, why can’t coders have Dev Breaks??). After running though the variables, DataTypes etc I came across the classes and methods sections then got to the statics Which had the following little sample which I found very enlightening and though I’d share. It will also be for personal ref later.
using System;

namespace TheBasics
{
public class Circle
{
private int _radius;

public static int numCircles = 0;

public Circle()
{
_radius = 0;
numCircles++;
}

public Circle(int initialRadius)
{
_radius = initialRadius;
numCircles++;
}

public double Area()
{
return Math.PI*_radius*_radius;
}
}
}

So basically what this would allow you to do is Call the Static value numCircles which would have a count of all instances of the Circle Class. Simple I know bu t I liked it
Circle circle1 = new Circle();
Circle circle2 = new Circle();
Console.WriteLine("There are {0}, Circle objects",Circle.numCircles);

On A side note whilst creating This post I was struggeling to put nicley coloured and formatted code into the post. I found this and It worked a treat

Oct
16

Starting to come together

By Andy - Admin  //  Dev For Noobs, Rants  //  2 Comments

Well after beginning my rants last week I’ve had a pretty interesting week.  It started off with some replies to my blog post and emails I’d sent following it up.  I’ll go into one of these in detail soon.  I also listened to a .netRocks podcast where they discussed if software development had become to complex.  It addressed a lot of the issues I’ve been having lately and made me realize one the, the most important thing and that is to enjoy what you’re doing.  I brought my head out of the DDD clouds and decided just to start playing with some of the Alt.Net principals.  A current work project highlighted it’s self for this treatment and so with a list of Dimecasts.Net Screen casts and a browser loaded with codebetter.com posts off I went.

Building in the Unit Tests was pretty interesting and proved invaluable in refactoring so me of the initial code I had written.  It also highlighted some of my fundamental failings with regards to C# and .Net development in General.  The positive I’ve taken from this is just getting to a keyboard and creating a piece of software even if you don’t implement 100% best practices and don’t follow to the letter patterns such as DDD, TDD etc.  You’ll have a good time learning and the resulting project will be a great deal better than if you hadn’t tried even if something’s are a big spaghetti it’s all a learning process, use it as such..

I Don’t(as yet) want to publish my results as they are far from finished and I still haven’t got my head round a lot of these principals to the degree where I would feel comfortable writing about them.  The basis of the project was a file notification system to alert of incoming and outgoing files.  The unit test where simple to introduce once I started refactoring and really getting to grips with things like factory patterns etc.   I managed to drop a bit of Linq2xml learning in as well which proved amazingly powerful and has really caught my boss’s eye.  I’ve managed to fit IoC into the repository which has allowed us to switch between xml and sql etc.  Using the quick start guide on the structureMap site it was all simple enough.  Some of the other parts are proving a bit trickier and I’ll need to read up on structureMap for things like Instantiating with constructors etc.  The system will now run as a service and only requires a small amount of tweaking to make it production ready.  I still need to figure out some way of testing the system fileWatcher aspects but I think that’s going to be complicated with possible mock objects etc??

All in all it’s been a really productive week and I just thought I’d let you all know how it went.

As discussed earlier I’d mailed off to a few prominent developers/Podcasters etc and was pleasantly surprised by the feedback I received, showing just how approachable these guys are.  One of the best responses was from Craig Rowe a developer at Web Design Agency HeadScape he supplied me with a number of links that have proved helpful here are some of them

StackOverflow (www.stackoverflow.com) and the stackoverflow podcast (http://itc.conversationsnetwork.org/series/stackoverflow.html)

Hanselminutes (http://www.hanselminutes.com/) – Scott Hanselmans podcast

Codebetter – http://codebetter.com/blogs/

A Foundations of Programming eBook by Karl Seguin – http://codebetter.com/blogs/karlseguin/archive/2008/06/24/foundations-of-programming-ebook.aspx

In reference to Generics you might find Karl Seguins article useful: http://codebetter.com/blogs/karlseguin/archive/2008/11/21/back-to-basics-generics.aspx

Anyways to sum up after feeling a bit lost in the wilderness lately, this last week really has made me feel like I’m starting to get somewhere as a profesional developer.

Digital Infamy

The home of Designer/Developer and all round web geek Andrew Allison. The site is basically my playground and will hopefully house my thoughts and some of my work. At the minute I'm still just playing with it to see what feels right.