Generics :: Tip O' The Day

Many people find Generics confusing.  I hope that I can add to some confusion reduction with a quick demonstration of some standard Generics usages in the C# .NET 2.0 world.

The type-safety of C# prevents potential errors by catching them at compile time.  Every variable in C# has a defined type.  When you give the object an assignment the compiler checks if it the action is a valid.  If the assignment isn’t valid, BOOM, you get a notification.

Now a major problem comes up when you try to use collections in pre-generics C#.  The collection objects in C# are typed to hold actual .NET Framework objects.  Since anything goes in, there is no way to provide type checking.  Compounding this situation is the fact that each object getting pulled out of the collection then needs to be cast.  This creates some nasty, bloated looking code, especially once you start churning out all the collections themselves.

So today’s tip is simply to remember that generics are your friend!  No more nasty ole’ pre-C# 2.0 collections.  Generics, generics, generics!  To check out more about Generics, get the low down, and see how generics are utilized in .NET Framework for reflection, arrays, collections, serialization, and even remoting check out Microsoft‘s MSDN Section on Generics.  For more information specifically on what a generic check out this particular MSDN page.

Smile [:)]

Bid Up?

So I was, as I do every week, just looking through the job postings to see the types of things that are posting, what percentages of jobs are out there, and what the rates are.  It is, as a consultant, very important to keep up with all those things.  The reasons range from assuring that I’m not falling behind with technology to seeing who and where pressure is coming from for the project and company that I am currently working for.

Every once in a while I still see these postings that are morbidly outdated and out of touch with reality.  It’s almost as if Paris Hilton is out there writing these job descriptions and setting the rates!  I personally am offended to see anyone or any company out there asking for a “Senior” anything software related for $30 bucks an hour.  Now don’t get me wrong or out of context.  $30 is a good rate for a lot of developers out there, but for a senior .NET engineer or senior Java engineer is ridiculous.  The current rates in market for an average Senior .NET or Java Engineer is about $40-$47 bucks an hour.  For a company that is serious about longevity, peak performers, and concerned about getting the best of the best, the rates skip up to at least $55-60 an hour.

So to all those guys out in the field looking for work, if there are any left at this particular junction in the industry, don’t accept low ball rates.  It does you and the rest of us bad and sets the perception of managers and other artificially low, because I guarantee the movers and industry experts aren’t going roll over for these low ball amounts.  If you’re faced with this dilemma at this time in the industry please shoot me an e-mail and lets talk, I’m sure I can roll you into one of the friendly and competent recruiters that I know, who I know hire appropriately, scope well, and present honorable and good rates.

Lean, Agile, Death Marches, and Get'n er' Done!

Every year there are literally dozens, hundreds, possibly even thousands of software projects that fail.  The projects that fail range in scope and price.  Project efforts of a few hundred dollars to the behemoth project of tens or hundreds of millions of dollars.  These projects follow known problematic approaches that are outlined extensively with anti-patterns and other various books about things like the software development Death March.

There is one underlying concept that is lacking in project failure; there is no agility to the process.  It’s to rigorous, to whatever.  The really awesome and downright cool thing about software development is that IT DOES NOT HAVE TO BE THIS WAY!  I was just reminiscing about one of my past jobs that was saved from its death march status of sick anti-patterns.  The solitary agile method used was postponing, not even on purpose, the actual method for application deployment.  The amazing thing is that it all started from a last minute disappearance of money.

I was working at a particular consulting entity called PSI Net Consulting Solutions.  They had been working on the MACWIS Project for the Mississippi Department of Human Services.  The project was horribly behind, all types of things had slipped, but because of budget cuts and quick thinking on the part of the project workers some streamlined usage of Citrix and other tools where used at the last minute to save hundreds of thousands of dollars and finally get the application deployed.  This Government project was brought home for me recently while beginning to read the book “Lead Software Development – An Agile Toolkit”.  In the introduction of the book a speech is mentioned where Jim Johnson, chairman of the Standish Group told about how Florida and Minnesota developed their respective WIS (Welfare Information Systems) and how one state got it right and the other went through a horrible non-agile, very un-lean approach.  The difference being a 200:1 improvement.  One project lasted well past 10 years and exceeded 230 million dollars, the other cost 1.1 million and lasted a little longer than a year.

The basics of this post is that no matter how proven lean process, elimination of waste, and other methods are, they still get ignored.  But I must move away from this topic for just a minute and drive home another, far more important point.  Even though there is so much attention paid to process, to control, to the “method”, the fact of the matter is it all boils down to the team, the individuals and their respective abilities and the ability of management to line those people up with their strengths.  Sometimes people don’t have particular strength and they need moved out of the project path to assure success.  As they say it only takes one bad apple.

No matter how good the method is, without the right people it will fail.  This is another point of strength for agile.  The reason I say that is agile attracts the people who want to succeed, that understand how things generally work, and those that really push for agile usually have seen what it can do.  Agile lean or whatever you call it.  Get strong individuals who can take the elements of whatever agile methodology and make it as lean as possible.  Generate code, refactor, clean up previous code messes, don’t make sphagetti.  Focus DB Gurus on the DB, get the coders on in the code, get the BAs talking to customers and so on and so forth.

To be lean, you gotta make sure the people you have are the right ones for the job.  Without the right people, even lean and agile process is nothing but a death march.

Icky CAB

Ok, I’ve been using CAB, the SCSF, in “pseudo kinda sort of” Model View Presenter Pattern usage.  The application that is being developed definitely uses the core of the mentioned products.  Recently as I read some techno babble by Glenn Block who works directly on the factories and tools themselves I came to a scary conclusion.  Several of the prospective issues of our CAB/MVP implementation and to help further a solution for others out there using the CAB/MVP Patterns I figured I’d relate some non-business specific solutions.  The bullet list below is from Glenn’s blog entry.

  • Ability to support multiple teams developing different parts (modules) in isolation.- Ability to extend existing and add new modules to the application without recompilation.- Loosely coupled components that can share data and interact with one another as well as the UI (i.e. populate menus, toolbars, and status bars)- Standardized and extensible layouts.- Pluggable UI components.- Pluggable application services that can be globally accessible such as Authorization and Authentication.- Separation of UI, Business and Infrastructure concerns.- UI Testability.- Reduction of repetitive coding tasks.- Simplified deployment.

 My fears, the short list, is appended to the respective bullet point listed below.

  • Ability to support multiple teams developing different parts (modules) in isolation.

[Problem][Developers, management, and other powers often push for vertical development either purposefully or accidentally.]

[Solution][When developing against CAB/MVC foundations and patterns the various layers should always be broken out to the specific teams that can best handle and develop against the specific layers.]

  • Loosely coupled components that can share data and interact with one another as well as the UI (i.e. populate menus, toolbars, and status bars)

[Problem][Often groups tend to accidentally tightly couple things when development is hurried.  When this occurs a major benefit becomes moot.]

[Solution][A person or persons should be delegated to refactor the code regularly to insure that the pattern stays loosely coupled.  This can also be done during code reviews and turned into a great session of to-do and not to-do items.  The key of staying loosely coupled is code reviews and refactoring the code on a very regular basis (weekly) to stay on top of what is going on.]

  • Pluggable application services that can be globally accessible such as Authorization and Authentication.

[Problem][If the CAB/MVC is used with an architecture that does not directly allow clear modularized usage of authorization and authentication the CAB/MVC also becomes unwieldy and difficult to manage.]

[Solution][Integrate and create an LDAP based (AD if need be) security integration that can be globally accessible via the plug-able application services.  Either way this scenario is always specific to the particular architecture and pattern implementation of the particular business.  It is very difficult to clearly use modularized authorization and authentication when the application is many layered and complex.  However, when an application is many layered and complex it is even more important that the authorization and authentication ARE modularized.]

Each of these prospective problems is easily overcome with a little development effort and acuity to code reviews and refactoring, but as always should be brought to focus right away to alleviate any magnifying schedule time and costs to a project.

Technorati Tags: CAB, SCSF, MVP, MVC, UI Components, model-view-presenter, model-view-controller, refactor, refactoring

del.icio.us Tags: CAB, SCSF, MVP, MVC, UI Components, model-view-presenter, model-view-controller, refactor, refactoring