Goodbye Persistence(?)

by Jeff Doolittle 4. January 2010 11:10
We're using NHibernate these days and going REALLY fast, but could we go even faster if we kissed RDBMS goodbye?

http://blog.wekeroad.com/2009/12/31/hello-from-2020

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

ExpressVal - Rapid Validation for .NET

by Jeff Doolittle 2. December 2009 08:13

I just uploaded a new project to codeplex this morning.  Check out the ExpressVal Rapid Validation Library for .NET (http://expressval.codeplex.com/).

ExpressVal

Rapid Validation for .NET

Benefits

  • Be expressive with your validation rules using Expressions!
  • Spend less time thinking about display messages and more time focused on the validation requirement itself!
  • Simply implement and test your validation rules!
  • Lightweight and nimble!
  • Self-contained! (does not rely on any other external framework or project)

Features

  • Create rules using lambda expression syntax
  • Parses many types of expressions to create canned, English language messages
    • Examples:
    • x => x.Name != null - "Name cannot be null"
    • x => !string.IsNullOrEmpty(x.Name) - "Name cannot be null or blank"
    • x => x.HireDate >= new DateTime(2000,1,1) - "Hire Date must be greater than or equal to January 01, 2000"
    • and many more...
  • Canned messages can be overridden with custom message text
  • Fluent interface for building up validators
  • Multiple options for loading validator rules
    • Discoverable based on assigning the Validator attribute to expressions defined in a field on your entities
    • Implementing IValidatorSource and passing your implementation to the ValidatorEngine

 

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

How to (really) turn off Just-In-Time Debugging (JIT)

by Jeff Doolittle 23. September 2009 03:28

I'm working on developing a server process that needs to execute nightly.  While working out some kinks, the process occasionally throws an exception.  The server in question has Sql Server Management Studio installed on it, which uses Visual Studio as its application shell.  This means that the server tries to invoke Just-In-Time debugging whenever an unhandled exception is thrown.  This is a problem for a few reasons.

  • No one is logged in to the server when the error occurs, so there is no one to actually debug the process
  • The attempt to start up JIT prevents the actual exception message from being added to the event log
  • The machine isn't (and shouldn't be) set up for debugging the application anyway (it's a DB server, for Pete's sake!)

This MSDN article says to simply start up Visual Studio, go to Tools --> Options --> Debugging --> Just-In-Time and then uncheck all the boxes.  This isn't quite enough.  To complete the process, I had to follow the steps in another article (Just-In-Time Debugging) and remove some registry keys.

Of course there should not be any unhandled exceptions in an application!  However, in the early stages of testing a new server process, it's nice to be able to get helpful error messages when you do experience an unhandled exception.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

Agile Is Not A Process

by Jeff Doolittle 23. May 2009 07:07

Lately I'm hearing a lot about agile "processes" and teams that claim to be adopting an agile "methodology".  This sort of language speaks as if certain structures and procedures can be adopted which will make a team agile. This thinking is misguided at best, damaging at worst. When Kent, Bob, Ward and the other 17 "Apostles of Agile" crafted the Agile Manifesto, they did not publish a list of procedures or processes.  Instead they provided a set of values and priorities.

Are you part of a team that is striving to be agile?  If so, ask yourself, what is the primary driving force behind your efforts?

  • Structures
  • Procedures
  • Processes
  • Methodologies

or

  • Values
  • Priorities
  • Principles

Do we need structures and procedures?  Absolutely! They are the context in which we perform concrete actions in order to fulfill the values and priorities to which we are committed. However, it is the ability to adapt these structures and procedures that makes an Agile team. When methods and structures are rigid and unchanging, agility has ceased.

Agile is not a process, but it is about how we create, shape and adjust our processes. The real question to ponder is this: "Do current structures, procedures and metholodogies enable us to maximally operate according to our values, priorities and core principles?" This is the question of alignment (a concept I will explore further in future posts). If the answer is "no" then are you willing to do something about it?

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Agile Project Management

Preparing for an Agile Retrospective

by Jeff Doolittle 19. March 2009 17:02

One of the facets of the Agile methodology I appreciate is the emphasis on transparency.  Rather than ignoring the proverbial elephant-in-the-room, Agile helps us to quickly identify (and hopefully address!) the real issues that affect our teams.  This aids the continuous learning process as we must constantly face hard realities and find creative ways to address them.

A vital part of the Agile process is the retrospective.  In this process, the team members identify the events which have occurred during a previous time-period.  They then seek to discover patterns in these events.  Finally, the culmination comes as the team identifies ways they can continue doing what is working, improve on what is working, and avoid doing what has not been working.

It is important to enter the retrospective process with a dispassionate view as to the events which have occurred prior to the retrospective.  It is non-productive to place blame on individuals or circumstances.  Instead, we must work together to face reality in the form of hard facts. As we reflect on these factual events, we work collaboratively to identify possible solutions that enable the team to reach for ever more productive heights.

This isn't to say there is no room for feelings in a retrospective.  Certainly the team members may experience a range of emotions as they reflect on the events of the previous time-period.  But the idea is to avoid any form of us-them mentality, or to blame circumstances for the outcomes.

Retrospectives can be an exhilarating and enlightening experience.  They are a great tool for improving the continuous learning of your teams.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Agile Project Management

ASP.NET MVC Version 1 Has Shipped

by Jeff Doolittle 18. March 2009 07:12
Version 1 of Microsoft's ASP.NET MVC framework has shipped.  Find out more about the framework or go download it.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Patterns & Practices - Part 2

by Jeff Doolittle 17. March 2009 15:37

In my previous post on Patterns & Practices, I discussed the fact that in order to learn P&P, you have to be willing to make mistakes.  In the early stages, it is beneficial to look for opportunities to apply patterns to your development so that you can begin to see how they take shape.  You may not understand their benefit in the early stages, but this is a vital step, akin to the experience of the "Karate Kid" as he was told to "wax on / wax off".  He spent weeks practicing the same moves over and over again, not really understanding the purpose of such repetitive tasks.  What he failed to realize was that he was developing muscle memory and creating well worn neural pathways that would prove vital in his development process.  This holds true for us as software developers as well. [For this early development stage, a key resource is a book such as Head First Design Patterns].

Eventually you gain some proficiency with the repetitive tasks.  You begin to realize that certain patterns work better than others in certain circumstances.  You might discover that some patterns can paint you into a difficult corner (Singleton is of course the prime example, though Static Gateway has its pitfalls as well). At this stage you are beginning to deconstruct the value and utility of particular patterns for certain situations and contexts.  You awaken to the realization that code can have a "smell" that communicates whether a design is fitting or not.  While you cannot necessarily name the "smell" it is clearly there.  [At this stage, you're ready to tackle Refactoring to Patterns].

Take time to identify patterns that fit well for addressing particular smells.  Look for examples in code written by others (you are taking time to read code written by others, right?).  And start looking for ways that improper use of patterns can introduce smells of their own.

In my next post in this series, I will switch gears and discuss the relationship between Patterns and Practices and why you ultimately want to emphasize the Practices over the Patterns.  Stay tuned!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

Visual Studio Project Sorting Fix

by Jeff Doolittle 4. March 2009 04:40

When you first create a solution using Visual Studio 2008, your projects sort nicely in alphabetical order.  But then as your project grows, you begin using solution folders to organize your projects.  It is at this point that your projects no longer sort alphabetically within their solution folders. 

Of course I've heard of the trick where you just choose one of the projects in a folder, press "F2" (rename) and then leave the project name as it was previously.  But this is 1) a pain, and 2) only sorts projects in that one solution folder.

So I created a tool that will modify your Visual Studio solution file (.sln) and make the projects sort properly within the solution folders.  Check it out at CodePlex:  Visual Studio Solution Sorter (http://solutionsorter.codeplex.com/).

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Patterns & Practices - Part 1

by Jeff Doolittle 3. January 2009 02:20
This is the first post in a series on Patterns and Practices.  The series will explore the learning process of a developer who desires to learn and apply good patterns and practices.

Emilio and I had an interesting discussion a few days ago regarding Patterns & Practices.  We observed that when a developer first adopts P&P, he behaves like it's all about the patterns.  The developer begins to read books and blogs that describe the various patterns and how these can be useful.  He begins to discover patterns in existing libraries and frameworks.  He starts looking for opportunities to implement patterns in his own development.  And he almost inevitably ends up suffering from some form of patternitis (often concentrated around an overuse of Singleton!).

I believe this phase of development is necessary for a developer.  To comprehend patterns you have to actually try developing with them.  You can learn a lot about patterns from a book, or by reading code from someone else's project.  But ultimately the only way to truly understand patterns is to actually put them to use in a project of your own.  In this regard, learning patterns is like learning to ice skate - you can watch others skate, you can read books on skating, but ultimately you're going to have to throw on some skates and hit the ice.  And when you do, you're going to fall.  When I learned to skate as a kid I remember that I was always afraid to fall.  This fear prevented me from learning.  But eventually someone told me that the only way to learn to skate was to push myself, and that meant I was going to fall sometimes.

So dig in, read about patterns, study them, learn to discover them in your code and in the code of others.  And go ahead and try using some of them in your own projects.  Yes, you will make mistakes, but this is a vital part of the learning process.

This post has focused on the initial process of learning patterns.  In my next post on this topic, I will explore how the developer can begin to experience success applying patterns in his or her own projects.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Software Development

Signature Converter

by Jeff Doolittle 23. December 2008 16:27

For a mobile application I'm working on, I needed a simple signature capture control. I found just such a control at the Code Project (http://www.codeproject.com/KB/mobile/SignatureCapture_PocketPC.aspx). The code will capture a signature and actually convert it into bitmap coordinates. This will allow me to store much less data rather than full images. But at some point I'm going to want to convert these bitmap coordinates back into an image. And unfortunately, the signature capture project only provides Java code for performing this process.

Well, if anyone else is interested, here is the Java code ported to C#. My next step will be to extend this class so that it isn't directly dependent on File System IO. But this should be enough to get anyone started who'd like to use the Signature Capture control from CodeProject, but wants to use .NET and C# to convert the bitmap coordinates back into an image.

using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Drawing; using System.Drawing.Imaging; namespace Agilification { public class SignatureConverter { const int baseX = 25; const int baseY = 25; public static void Convert(String inputTxtFile, String outputGraphicsFile) { List<String[]> v = readFile(inputTxtFile); Hashtable ht = getMinMax(v); int minX = (Int32)ht["minX"]; int maxX = (Int32)ht["maxX"]; int minY = (Int32)ht["minY"]; int maxY = (Int32)ht["maxY"]; int width = maxX - minX + baseX; int height = maxY - minY + baseY; Image image = new Bitmap(width, height); Graphics g2d = Graphics.FromImage(image); var b = new SolidBrush(Color.White); g2d.FillRectangle(b, 0, 0, width, height); drawImage(g2d, v, minX, minY); g2d.Dispose(); image.Save(outputGraphicsFile, ImageFormat.Jpeg); } private static void drawImage(Graphics g2d, List<String[]> v, int minX, int minY) { for (int j = 0; j < v.Count; j++) { String[] points = (String[])v[j]; int x1 = 0; int y1 = 0; int x2 = 0; int y2 = 0; for (int i = 0; i < 4; i++) { x1 = Int32.Parse(points[0]) - minX + (baseX / 2); x2 = Int32.Parse(points[2]) - minX + (baseX / 2); y1 = Int32.Parse(points[1]) - minY + (baseY / 2); y2 = Int32.Parse(points[3]) - minY + (baseY / 2); } var p = new Pen(Color.Black); g2d.DrawLine(p, x1, y1, x2, y2); } } private static Hashtable getMinMax(List<String[]> v) { Hashtable ht = new Hashtable(); int minX = 9999; int maxX = 0; int minY = 9999; int maxY = 0; for (int j = 0; j < v.Count; j++) { String[] points = (String[])v[j]; for (int i = 0; i < 4; i++) { minX = (Int32.Parse(points[0]) < minX) ? Int32.Parse(points[0]) : minX; minX = (Int32.Parse(points[2]) < minX) ? Int32.Parse(points[2]) : minX; maxX = (Int32.Parse(points[0]) > maxX) ? Int32.Parse(points[0]) : maxX; maxX = (Int32.Parse(points[2]) > maxX) ? Int32.Parse(points[2]) : maxX; minY = (Int32.Parse(points[1]) < minY) ? Int32.Parse(points[1]) : minY; minY = (Int32.Parse(points[3]) < minY) ? Int32.Parse(points[3]) : minY; maxY = (Int32.Parse(points[1]) > maxY) ? Int32.Parse(points[1]) : maxY; maxY = (Int32.Parse(points[3]) > maxY) ? Int32.Parse(points[3]) : maxY; } } ht.Add("minX", minX); ht.Add("maxX", maxX); ht.Add("minY", minY); ht.Add("maxY", maxY); return ht; } private static List<String[]> readFile(String fileName) { List<String[]> v = new List<String[]>(); var reader = new StreamReader(fileName); String record = null; while ((record = reader.ReadLine()).Trim().Length > 0) { String[] points = new String[4]; points = record.Split(' '); v.Add(points); } return v; } [MTAThread] static void Main(String[] args) { try { String inputTextFile = ".\\Sign.txt"; String outputImageFile = ".\\Sign.jpg"; Convert(inputTextFile, outputImageFile); } catch (Exception ex) { Console.WriteLine(" exception: " + ex.ToString()); } } } }

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

Powered by BlogEngine.NET 1.4.5.0
Theme by Extensive SEO


Subscribe

Jeff is reading...