More Tools! (That I forgot in the other post.)

Recently I made a post about tools you just have to use (at least after you’ve used them just once!).  Well there where a few that I had neglected to mention and a few I just stumbled back upon after realizing I had not installed them on my recent machine load.

  1. CodeSmith – If you have a layered application, use CodeSmith.  CodeSmith now does .netTiers, CSLA, NHibernate, Wilson’s ORMapper, APOSA, and more!  If you have a layered application (and it follow design pattern guidelines) you are probably very close to one of these already and should definitely check out generating the boiler plate code!  CodeSmith absolutely rules, I have 2 major projects under my belt now and am about to wrap another third, open source, project that utilizes CodeSmith generated code.  In every scenario it has drastically reduced code work and provided me to build projects that without I would have needed to hire or contract another developer to just handle the boiler plate while I completed the architecture design.  Instead I was able to surge ahead, create unit testing for the code base that I did have to manually create, and finish the projects on time and generally under budget!  Please note, I am NOT paid by anybody at CodeSmith!  I’m vouching for this product solely because I know what quality it is.- TestDriven.Net – This is an awesome unit testing add-in for Visual Studio.  If you’ve ever just wanted to execute a single test, this is the tool that does it!  Check it out, it’s low overhead and I’m betting you’ll dig it.- NCover – Code Coverage that will create unit tests if you are missing coverage.  I haven’t thoroughly used this software, but needless to say when the code base is of a decent size with more than 2 people contributing you should probably get some type of code coverage checker.- Reflector – Sometimes, you gotta know what’s under the hood.  This is the tool that helps you find out what is under there.

Anyway, those are the ones that I’ve somehow missed.  I’m going to throw all of these in the big bucket o’ tools list and get that published in the not too distant future.  At some point, I’m curious myself, how many tools and add-ins I actually have installed and use regularly for development.

Technorati Tags: Codesmith, .nettiers, csla, nhibernate, ormapper, aposa, design patterns, testdriven, unit testing, ncover, reflector

del.icio.us Tags: Codesmith, .nettiers, csla, nhibernate, ormapper, aposa, design patterns, testdriven, unit testing, ncover, reflector

Stored Procedures and Property Resets :: Tip O' The Day

Tip #1

As of a recent task I’ve had to go through and reset hundreds (literally, no exaggeration) of properties on some Infragistics Controls.  If you’ve ever worked with them you know how many properties and nested properties these controls have!  Well, lo’ and behold unbeknownst to me if you right click on the property there is a “Reset” option that will allow you to reset the property to the original value(s).

Tip #2 – Bonus Tip

If you’ve ever created stored procedures via the Database Project in Visual Studio you’ll notice that the default proc skeleton that is displayed has comments (or doesn’t depending on which version of Visual Studio).  This “template” file that Visual Studio uses is nothing more than a *.sql file located in the “C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Templates\Database Project Items” directory with Visual Studio 2005.  Go in there and add your specific information to the file to cut down on stored proc coding time!

Primary Entry Focus

I was reading the great Neopoleon’s Blog last night and realized two things, I should add a bit more “pizzaz” (as they say on Dethklok’s Metacalypse) or A.K.A. personal diatribe.  Smile [:)]  I’ve been just kind of spurting out some overly general, random, off hand things and I’m going to push toward my actual 2 cents on technology, projects, and companies and also try to stick to more in depth articles.

So this stands as a warning!  Surprise [:O]

Thus my recent addition of the “rants” category will probably increase!  My category of “Discussion Points or Ideas” will probably also increase drastically as I have a lot of discussion points that would be interesting to begin.  So hopefully all 3 readers I have currently will enjoy my new directions, if not, my loss.  Sad [:(]

Windows Workflow Increases Coolness Factor

After making it through about 200+ pages of the book Essential Windows Workflow Foundation by Dharma Shukla and Bob Schmidt I discovered two capabilities that I really like about the Workflow Foundation.  The first is the database tables provided via the Workflow SDK that are used for persistence and tracking.  The second thing that caught my eye, which I had not even really thought about before, was the workflow display engine.  A part of the workflow foundation which provides actual graphical display of the workflow in a Visio Flowchart type fashion directly within an application.  Both of these sections I’m now going to elaborate on a little bit more, namely to show how to setup a basic installation of the database tables and how to put in place a workflow diagram into an application.

Workflow SQL Tracking and Persistence Tables

Most of these steps can be found at the linked MSDN page, but I’ve extrapolated by own instructions below.  Also this seemed a partial necessity since I couldn’t find instructions for setting up the tracking and persistence tables I’m rolling my own.  The MSDN articles for the persistence setup and tracking setup are available if one needs a step by step.  My directions a bit more cut and to the point.

Smile [:)]

First create a database for the tracking and persistence store to use such as “WorkflowStore“.  I know, real original.  But anyway, there are more important topics at hand!

Next find the SQL file “open the SQL script c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\SQL\en\SqlTracking_Schema.sql“ and then run the “SQL script c:\WINDOWS\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\SQL\en\SqlTracking_Logic.sql“ file.  These two files take care of the tracking part of the workflow database.

After setting those up execute the SqlPersistenceService_Schema.sql file and the SqlPersistenceService_Logic.sql file to complete the persistence portion of the setup.

Now that the database is setup the respective web or application config files need to have some particulars added.  In the Services section of the config add the following:

“<add type=”System.Workflow.Runtime.Tracking.SqlTrackingService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ connectionString=”Initial Catalog=WorkflowTrackingStore;Data Source=localhost;Integrated Security=SSPI;”/>“

for tracking and

“<add type=”System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ connectionString=”Initial Catalog=WorkflowPersistenceStore;Data Source=localhost;Integrated Security=SSPI;” UnloadOnIdle=”true”/>“

for persistence.  For hosting the designer in a windows application stay tuned.  Until then, happy coding!

kick it on DotNetKicks.com

Reactive Programs and Windows Workflow Ramblings

I’ve started working heavily with Windows Workflow.  It seems this foundation from Microsoft is being heavily undersold in my opinion.  What one can do with this base is massive, at least for enterprise solutions, and in many a case for almost any type of solution.  This type of graphical design of workflow directly mapped to code has been needed for ages, oft promised, mostly just vaporware until now.

This is an entry documenting some of my first flailing through some samples I’ve been tossing together.

Sample 1

First I started a basic Sequential Workflow Console Application from Visual Studio by starting a new project.

Once the application is open I renamed the initial workflow file accordingly, since I have an obsessive compulsive issue with the default filenames and such.

Now that I’ve settled my obsession with things not being “default” I moved on to tossing some cool workflow controls into the SequentialWorkflow.cs file.  The first two I dropped in was a Code Control and a Delay Control.  After dropping these two controls onto the page I ended up with the diagram below.

There was one problem.  I wanted the delay to occur before the Code Control executes.  With the Workflow Extensions Diagramming it is ridiculously easy to change it, by simply dragging and dropping the delay in front of the Code Control I resolved my whole dilemma.

Now that everything in the world was right I tossed some petty Console.Write* code into each of the controls.  The code I entered was super basic for this example.

1 using System;

    2 using System.Workflow.Activities;

    3

    4 namespace WorkflowSampeSequential

    5 {

    6     public sealed partial class SequentialWorkflow : SequentialWorkflowActivity

    7     {

    8         public SequentialWorkflow()

    9         {

   10             InitializeComponent();

   11         }

   12

   13         private void delayFor30Seconds_InitializeTimeoutDuration(object sender, EventArgs e)

   14         {

   15             Console.WriteLine(“Pausing for 30 seconds.”);

   16         }

   17

   18         private void CodeActivityNumeroOne_ExecuteCode(object sender, EventArgs e)

   19         {

   20             Console.Write(“This is the console writing doing a \”Console.Write\”.  “);

   21             Console.WriteLine(“This is the \”Console.WriteLine\”.”);

   22         }

   23     }

   24 }

So with that snippet of code one can see how the example works to step through each part of the Workflow. My next example is going to be a little more elaborate. So now that the simple one is setup, cuz it’s always good to have that simple “working” example, my next workflow related entry will have some real meat to it.