The Eric Wroolie Blog

Overpass Experiences

  • Blog
  • Videos
  • Overpass Apps

Powered by Overpass Apps

MyGeneration – a timesaver

March 31, 2008 by wroolie Leave a Comment

Code Generators are nothing new. I played around with Codesmith back before they started charging $200 for it and have looked into some of the codegen tools on sourceforge but was generally unimpressed. Most lacked enough documentation to really customise anything.

I even tried some of the high-end tools like Tier Developer which costs $1k and provided everything but the kitchen sink. You can download it for the trial, but it requires a steep learning curve to customise and you actually get a salesman call you up on the phone.

If you’ve never used a code generator, it’s basically an application that spits out code based on collections you pass it. Most of the time, it’s a database structure. You design your database, point your code generator at it, and select which tables you want to use. The template will create some output files for you based on what you select. For example, I selected five tables and used a code generator to create my CRUD stored proc files. I select a directory to output to and the code generators put the files there. I can then run these files against a database or include them in a Visual Studio database project. Since this is a one-shot generation, I can freely modify these files after they’ve been created.

I first looked at MyGeneration a few months ago. Like most of the cool new tools, I thought about all the cool things I could do with it– then I moved on to something else.

Today I started automating some of my Model classes using it. So I got to really use it in anger. Here are the things I really like about it:

    1. It’s free.
    2. There is a huge template library
    3. Tempates can be written in VBScript– so no new languages to learn.

Every time I look through a template library for a code generator, I get some really ambitious code. Everyone wants to generate all of your stored procs, data access layers, business objects, and test cases. I usually just want something simple like business logic layer. With this tool, it’s easy to write your own.

In a few hours, I wrote code to generate all of my interfaces and model objects. Since it was vbs, it was just like writing a classic asp page. I just looped through all the tables and created the beginning of my business objects:

<%

'******************************Class File*************************************
%>
#region headerblock
// Filename : <%=tableName%>.cs
// Change history
// date            version: author : description of change
// <%=Now()%>    <%=vbtab%>0.1    <%=vbtab%><%=input.Item("txtDeveloperName")%>    <%=vbtab%>Object Created

#endregion

using System;
using System.Data;
using System.Collections;

namespace <%= TrimSpaces(namespace) %>
{
    public class <%=tableName %> : I<%=tableName %>
    {

        public <%= tableName %>()
        {

        }

        #region Internals
        <% For Each objColumn in objTable.Columns %>
            private <%=objColumn.LanguageType%> <%=InternalVariableName(objColumn,true)%>;<%Next%>
        #endregion

        #region Properties
        <% For Each objColumn in objTable.Columns 
        %>
            public <%=objColumn.LanguageType%> <%=InternalVariableName(objColumn,false)%> {
                get 
                {
                    return  <%=InternalVariableName(objColumn,true)%>;
                }
                set 
                {
                     <%=InternalVariableName(objColumn,true)%> = value;
                }
            }
        <%Next%>
        #endregion

    }
}
<% 
    call SaveFile(tableName,input.item("txtPath"))

%>

One of the most tedious aspects of creating a model project is generating this code. Sure, I need to modify this further and I will probably normalise the database further–but this gives me a decent start and saves a few hours. I can also use this to generate the very basic unit tests (ie. can I create the object? Do all of the properties match?, etc).

It’s definitely a tool to check out. It’s a lot more fun to create your own template (or modify an existing one) than it is to use what’s given to you.

You can find MyGeneration at : http://www.mygenerationsoftware.com

I was tempted to title this post “Talking ’bout MyGeneration” but I fought back the urge.


Filed Under: C# Coding, Software Dev & Productivity

Going from player to coach

March 28, 2008 by wroolie Leave a Comment

I’m a big Tom Peters fan.  I’ve read a few of his books and read his blog regularly.  He had a radical approach to the business life and I find that comforting in my current world of commutes and cufflinks.

One of the things that Tom Peters often says is (I’m paraphrasing only slightly) “Only in business do you see the best salesperson promoted to sales manager.”  In a symphony, the best violinist does not become a conductor.  The best managers in major league sports were often very average players when they played. 

I’m finding myself in the position where I do more code reviewing than actual coding.  I look at timescales and can’t believe someone would think such a trivial bit of work would take so long.  I often find myself aghast at someone’s lack of javascript knowledge or how they rely on WYSWIG editors for page design.  In the .Net age, do we really think we can drop basic HTML and javascript knowledge?

A few weeks ago I gave someone a task that would have taken me three hours to complete and he took over two weeks.  I know it would take me three hours, because I had to redo the bit of work afterwards anyway.

It’s difficult to move from coder to code reviewer/developer manager when the coding always seemed so easy.  In baseball, I’m sure managers where were very talented players probably had the most difficulty with players who struggled to perform basic actions.  A manager who was a mediocre player would be able to give a struggling player better advice. 

It’s difficult moving to the next level.  But God knows I had enough people help me when I was struggling.  Now it’s time for me to be one of those people.

Filed Under: Uncategorized

Fishing for Leads

February 11, 2008 by wroolie Leave a Comment

I’ve written a few times about the perks of being an IT contractor. There are a lot of things I really like about this line of work.  I don’t even mind being “in between jobs”. 

Last week, I put my CV on the market for a few days (I’ve extended my current contract, so have now removed it).  After activating my CV on Jobserve, my mobile phone started ringing continuously with agents trying to fill Investment banking jobs.  It’s nice to know the market is still going strong after the credit crunch.

During this few days, I got a call I’ve gotten several times before from an agent.  It goes like this:

AGENT: I’m calling for Eric please.

ME:  Yeah, this is Eric.

AGENT:  I was just going through your CV on Jobserve and it looks very good.  We’ve got a lot of great opportunities to put you in for.  We got lots of contracts that are suited specifically to your skillset.

ME:  (I’ve heard it before, but I’m polite) Oh, great.

AGENT:  So, you’re working for XYZ Corp now.  I’ve put lots of people into contracts there.  Are you working with Steve?

ME:  No, I’m not.

AGENT:  Oh, really?  So, who are you working for then?

ME:  (still polite) Somebody else.

AGENT:  Yeah.  Whose department are you working in?

ME:  I’m afraid I can’t tell you that, but if you put me into a different contract I’d be happy to tell you . . .

AGENT: (Click!)

This is a tactic agents and recruiters use called “fishing for leads”.  They may or may not have positions to put you in for– most often, they don’t.  They need line managers to pester.  If they see your CV, they know there is a good chance you will be leaving a vacancy behind you.  They can snatch up the vacancy without every helping you leave.  The agent always throws out the name of someone in the company you’ve been dealing with.  This name is made up–and often seems to be Steve.  I got one of these calls last week.  He actually hung up on me.

The other way agents fish for leads is as follows:

AGENT: So, how long have you been looking for work?

ME:  Oh, just a few days.  I took a few months off between contracts.

AGENT: Well, we got this great contract for £70/hour.

ME:  Oh, great.

AGENT: I can put you through for it, but this company is very specific.  They need to know everyone else you’ve interviewed for.

ME:  I’m sorry.  I can’t tell you that.

AGENT:  Well, this company won’t take even look at someone’s CV unless they know who else  you’ve been talking to.

ME:  I’ll tell them at the interview if they ask.

AGENT: (with mock frustration) Are you telling me you are going to pass up £70 an hour just because you won’t tell me who you’ve been talking to?

ME:  That’s right.  If you put me into this role, I will be happy to give them a list of people I’ve spoken to.

The agent hangs up.

I actually had this conversation a few years ago.  I’m sure the agent didn’t have any role to put me into.  The £70 an hour was a complete lie–an obvious one.  I’ve never worked for someone who insisted on knowing where I had interviewed.  The agent just wants to find out where jobs are going so he can flood them with CVs (and add more competition for me).  If an agent actually gets me in for an interview, I owe it to that agent to keep that information confidential and not to give it out to one of his competitors.

Most agents I’ve worked for have been very honest and (despite that salesman-talk they do) I generally trust them.  But every so often, you get these con artists who are just fishing for leads.  If you are considering contracting, look out for this.  If  you are already a contractor, you’ve probably already experienced it.

Filed Under: Uncategorized

  • « Previous Page
  • 1
  • …
  • 73
  • 74
  • 75
  • 76
  • 77
  • …
  • 112
  • Next Page »

Recent Posts

  • The Last Human Developer
  • My Gig and the Imposter Syndrome
  • Getting Picked Last for Teams in PE
  • One Little Growth Opportunity at a Time
  • I’m sorry if I look like I know what I’m doing