NamingContainer, where have you been all my life!

Well, it’s been where it’s always been – in the .net framework, all the way back to version 1.0 apparently!  I’m sure I must have written some awful code in the past to get around the fact that I didn’t know about this, and I really must spend more time getting down to the details of the framework for reasons of framework nuggets like this.

Imagine you have a ListView and want to allow updates on each item, with perhaps a text field etc. in there, and you click a button inside that ListViewDataItem.  NamingContainer for the button will return that ListViewDataItem so that you can find just within that container… ace!

protected void btnWishList_Click(object sender, EventArgs e)
    Button _button = ((Button)sender);
    RadTextBox tb = (RadTextBox)_button.NamingContainer.FindControl("txtNotes");
    // do other processing

the above is formatting awfully at the moment, looking for a nice wordpress syntax plugin.

A wee step backward…

Well, maybe not.  I’ve been reviewing over the weekend my approaches to learning, and after reading considerably, I think Entity Framework isn’t the right path for me at the moment.  So many are reporting issues with it, and the Julie Lerman book highlights a number of hoops you need to jump through on complex datasets that simply shouldn’t be there.

So it’s back to basics.  Linq, and then by definition Linq to Datasets, Linq to SQL (and eventually when it matures, Linq to Entities) is the path I’ve chosen.  Linq to Datasets may well be considered legacy code, though suite-e uses them in a few places to retrieve large sets of data (converting stored proc –> objects for 45,000 rows proved too time costly), and I think it’ll be handy to start at this grass roots level.

I’m convinced by ORMs, and ideally would like to proceed with Entity Framework, but at least the above will give me a solid grounding that I can then proceed through to something like EF with limited pain.  VS2010/C#4.0 apparently will have some updates, so I’ll keep monitoring.

On a separate note, I’m getting so heavily addicted to stackoverflow – I post where I can, but as a resource for learning it’s fantastic.  You still have a number of weaknesses (people not answering the question, but posting fast to try to get points, downvotes for stupid reasons, etc.) but on the whole, it’s a cracking resource.

This month will see me probably post very little, we have 4 large client sites up for launch and 2 minor client updates, so I suspect the hours will be long and arduous, but we soldier on 🙂

Where do we go from here…

Most people start their blogs with a ‘hello world, expect more from me’, so apologies for the war and peace tome that you’re about to suffer if you’re reading this!

Well, we find ourselves at a somewhat melancholic crossroads.  I was contacted by a recruitment agent from Nigel Wright earlier in the week to suggest that they had 2 jobs that they thought I’d be perfect for, and they based the decision on a CV that was nearly 4 years old.

Initially, excitement kicked in and I had no idea where it came from – what was wrong with my current job?  It got me thinking and reading a bit, I’ve been here for a little over 3 years now, and have been a very active part of the team, I’ve architected and built our in house CMS/E-Commerce/CRM solution that we can then use to build client websites (there’s another post in there somewhere as to why we didn’t go with an off shelf solution!), I’ve gotten the organisation Microsoft Partner status, something I’d recommend any organisation do if they’re developing for the MS platform btw, I’ve brought in a fair few clients – everything is peachy right?

Well, no.  What about me?  Selfish to say, but where is my career going in all of this, what am I doing, and how am I doing it?  I’ve been a web developer now for about 15 years in various guises, starting out with the good old perl/cgi/mysql combo, moving over to classic ASP, and then over the past 5-6 years focussing on c#/ I’ve done some very fulfilling work, and some that just ticks over, like any developer I guess. Since my computing degree I’ve always felt I’ve been at the softer side of development, never really delving, never getting too heavily into the software architecture simply for the sake of it.  I’ve hit a point where I can continue to do as I am, delivering quality code for sure, but really not being truly happy with it because I want that more thorough approach, or I can do something about it.

I’ve led development teams, I’ve implemented n-tier solutions using the facade pattern, I’ve done huge projects with tens of thousands of (more often than not necessary) lines of code, I’ve implemented rich SQL server schema, I’ve implemented interfaces, I’ve serialised, I’ve consumed, I’ve done an awful lot.

What’s Changed?

It was a chance tweet yesterday by Mike Taulty where he mentioned Rob the Geek, and you just know, anyone with a name like that, I have to check them out.  I got to Rob’s blog and in particular a post where he was lamenting some of the same issues that are facing me… I want to know more, I want to do more, I want to understand more – software development without learning just isn’t enough for me.

So what do I want?

I think first and foremost, I want to get deeper into the framework – there are any number of the simple things that I just want to understand more, reflection, generics (not just List<Object>), Lambda, goodness the list goes on – all fundamentals, and I know that if I sat for a short period on any of them I’d get them, and it’d stick – I’m certainly not an unintelligent guy (well…)

Key really for me is MCTS I think – I think the framework exam will lead me into a nice and thorough understanding of the framework so that I can then proceed to the ASP.NET 3.5 Application Development exam.

After that, my main thirst is to work with ORM, and in particular Entity Framework, I’ve read and understand the reasons that some people are waiting till 2.0 to roll out into production, but speaking as someone who’s written DAL/Object layers for 4 years, it’s getting very old very fast and I want to try something else that lets me focus on the good bits and worry less about the data.  After that (or probably in parallel), MVC looks pretty cool – again, just as potential starting points.

How do I go about all this then?

There are an awful lot of things I waste time on each week – online gaming, getting to work at 7:15am because I’m awake and I’ve got stuff to do, leaving at 7pm because I’m still awake, and I’ve got stuff to do… it all adds up, I suspect I can allocate at least 25hours a week to personal study (thankfully my wife is very supportive of me doing this, and the kids will I think reap the benefits of the happiness I get from it).

So that’s where we are.  And this blog, at least in the first instance, is intended to be a record of my path through all of the above – I’ll post about everything, even when I’m learning things that seem ridiculously simple – I think keeping this record will help motivate me, will help keep me focussed – I don’t particularly care if anyone ever reads it, I’ve found even just this seminal post to be incredibly cathartic.

Expect regular updates, as if I don’t it means I’m not doing what I said I would 🙂