Blog Home  Home Feed your aggregator (RSS 2.0)  
Code to Live, Live to Code
Randy Patterson's BLog
 
 Friday, June 27, 2008

It's been six months since my previous article "10 Podcasts Every Developer Should Listen To" so I thought I would do a follow up article outlining some of the new quality podcasts available to developers.

Alt.Net Podcast Good quality weekly podcast covering topics like adopting Agile, Dependency Injection and Continuous Integration
The Java Pose Helps to keep me informed of the innovations happening in the Java world and you get a catchy intro tune for free. 
The Thirsty Developer A weekly podcast covering a wide variety of .NET topics like SCRUM, Continuous Integration, Cyclomatic Complexity and Silverlight 2. 
Parlays Good architecture podcast with a wide variety of topics that focus on Java, Google and Apple. 
Radio TFS Excellent podcast on all things Team Foundation Server.  Highly recommended if you use or plan to use TFS
ThoughtWorks - IT Matters Discusses the business and technology issues facing the IT Industry with occasional appearances from people like Martin Fowler.
Deep Fired Bytes Despite the unhealthy name of this podcast it covers a healthy variety of IT Topics.

 

If I've missed any developer related podcasts that you find helpful please let me know.

kick it on DotNetKicks.com

Friday, June 27, 2008 5:21:25 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]   Podcast  |  Trackback
 Wednesday, June 25, 2008

 

Dependency Injection using the Microsoft Unity Application Block

The Microsoft Unity Application Block is a lightweight Dependency Injection Container that is currently being incorporated into the latest releases of Enterprise Library and the Composite Application Library (Prism). This session will give an introduction to Dependency Injection and Inversion of Control concepts and a brief overview of how to use the Unity Application Block to build loosely coupled applications.

My goal is to finish by leading a discussion on the pros and cons of Dependency Injection, Loosely coupled and Tightly coupled components. When we leave I hope everyone will have a deeper understanding of these principles and how and when to apply them.

When & Where:
Thursday, June 26, 2008 from 06:30 PM - 08:30 PM (ET)
Microsoft Corporation
3000 Bayport Drive
Suite 480
Tampa, FL 33607
View a map
View 1-Click Directions

Please be aware that the outside doors lock and the elevators need a security key after 7:00 PM.

 

Please Register for the event:

Update:

Here are my slides from the presentation:

 

For additional information I recommend the following 2 part PodCast on Dependency Injection:

podcast Dependency Injection and Inversion of Control

 

podcast More Dependency Injection and Inversion of Control

 

Finally, the following book is highly recommended:

Agile Principles, Patterns, and Practices in C# (Robert C. Martin Series)
by Robert C. Martin, Micah Martin

Read more about this book...
Wednesday, June 25, 2008 9:30:20 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]   Events | Unity Application Block  |  Trackback
 Monday, May 19, 2008
 Wednesday, May 07, 2008

The Orlando Convention Center was not being used between TechEd Developer week and TechEd ITPro week.  Microsoft has graciously donated the convention center to be used by the Florida Developer Community!  There are 9 large conference rooms that will be filled for 2 days with presentations from Local,  Microsoft and TechEd Speakers.  In addition to the full day tracks listed below there will also be discounts on MS Certification Exam Tests, an MCSA/MCSE: weekend upgrade bootcamp, a Developers Weekend Exam Cram and Train the Trainer sessions.  ALL FOR FREE!!!

Saturday, June 7th Activities - 830a to 530p

Full Day Tracks Description
SQL Saturday Best of the SQLSaturday events with some special product team reps attending.
Open Space Four corners of a room with whiteboards. Sign up for a 30 minute talk on whatever topic you want
RoboCamps More info coming soon. Until then http://www.robochamps.com
Day of Agile Got a passion for Agile? Jim Zimmerman and Chris Chandler have put together a full day of Agile topics ready to go.
.NET Code Camp Some local speakers, some speakers from the regular TechEd Event and some members of the Microsoft product teams.
ITPro Camp A first for the state and maybe the country? The very first Microsoft ITPro Camp

*Schedule subject to change so check the official web site often (http://www.devfish.net/articles/inbetween/)

image

 

Party and Social! Saturday, June 7th 6:00PM

 

 

Sunday, June 8th Activities - 830a to 530p

Full Day Tracks Description
SQL University Andy Warren is putting together some of his very best training on SQL Server to get you up to speed quick
Dot Net Nuke University A full day of Dot Net Nuke Training
Open Space our corners of a room with whiteboards. Sign up for a 30 minute talk on whatever topic you want
ToolShed Russ Fustino and Stan Schultes come together with encores of "Its all about the Tools" episodes 1 and 2, plus all new episodes 3 and 4
OCS University OCS MVP Keith Kabza and Tom Cross will get you up and running on Office Communication Server in a day
.NET University

Doug Turnure's flagshihp series of structured courses geared to bring you up to speed on a particular topic.  Three separate all day courses are being offered, including Sharepoint, Service Oriented Development in .NET 3.5, and BizTalk. Something for almost everyone!

VSTS University Tentative - Doug Seven and the Redmond guys hang around to teach you VSTS. Learn from the VSTS team themselves.

*Schedule subject to change so check the official web site often (http://www.devfish.net/articles/inbetween/)

This is an incredible opportunity for learning with enough variety for everyone.   A special thanks goes out to our local Microsoft Developer Evangelist, Joe Healy for organizing the event and creating the effective but very ugly web site.

Wednesday, May 07, 2008 5:48:30 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]   Events  |  Trackback
 Friday, May 02, 2008

The Unity Application Block IoC Container comes with a little know extension for creating loosely coupled events called the Simple Event Broker.  The Unity Event Broker supports multiple publishers and multiple subscribers to the same event name.  The decoupled model prevents subscribers from knowing about publishers and publishers from knowing about subscribers.

 

image

 

The Event Broker source code can be found under the Unity Quick Starts normally located here

"C:\Program Files\Microsoft Unity Application Block 1.0\UnityQuickStarts.zip\UnityQuickStarts\CS\EventBroker.sln". 

In order to use the Extension make sure you have your project reference the EventBrokerExtension.dll and the SimpleEventBroker.dll.

Next, you need to configure Unity by adding the Event Broker Extension to the Container.

        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            UnityContainer rootContainer = new UnityContainer();

            rootContainer.AddNewExtension<SimpleEventBrokerExtension>();
            
            Application.Run(rootContainer.Resolve<DefaultForm>());
        }

 

This gives you two new Attributes recognized by Unity, [Publishes(eventName)] and [SubscribesTo(eventName)] where eventName is a string that uniquely identifies the loosely coupled event.

The attribute [Publishes] is applied to an event and lets the event broker know that when this event is raised, any methods that are subscribed to eventName are called. 

For Example:

        [Publishes("event://Transaction/Complete")]
        public event EventHandler TransactionComplete;

Best Practice:


It is recommended that you not hard code the Event Name parameter.  Instead use a class that contains the event names as public string constants.

[SubscribesTo(EventTopicNames.TransactionComplete)]

This prevents typos in the event name string and also allows a Usages Search in Visual Studio to quickly locate all Publishers and all Subscribers of an event.

 

The event broker will create a loosely coupled event named "event://Transaction/Completed" [1] and link the .NET event TransactionComplete [2] to it. The following subscriber code

        [SubscribesTo("event://Transaction/Complete")]
        public void TransactionCompleteHandler(object sender, EventArgs e)
        {
            //Do Something.....
        }

informs the Event Broker that method TransactionCompleteHandler [3] needs to be called whenever the loosely coupled event named "event://Transaction/Completed" is published. Notice that neither the publisher nor the subscriber is aware of the other.

Conclusion

The ability for your application to communicate between controls without resorting to directly linking one class to another increases the reusability of your code.  The Unity Event Broker is, as it's name implies, a rather simple implementation of loosely coupled events but it is a good start none the less.  for example,  I would like to see a way for subscribers to indicate that methods should be called on a background thread instead of always on the Publisher's thread. In future posts I will show how to register events for publication when you cannot add the [Publishes] attribute directly to an event declaration (useful for Button and Menu Click events or third part controls)

 

  1. I use the URL style string to name the decoupled events purely out of habit.  Obviously, any string will do but I find the URL format to be clean and easy to read.
  2. Events must be scoped public in order for the Event Broker to detect the Publishes attribute
  3. The subscription method must be scoped public in order for the Event Broker to detect the SubscribesTo attribute

 

Friday, May 02, 2008 1:02:08 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]   C# | Unity Application Block  |  Trackback
 Saturday, March 29, 2008

Configuring the Unity Application Block for just-in-time Instantiation. 

Out of the box, Unity does not provide a way to configure your dependencies so that they are resolved only if needed.  Lazy Instantiation would be desirable if your dependency is and required only under certain circumstances or you would like to delay object creation of a resource intensive dependency until needed.

For Lazy Instantiation, the first obstacle to overcome when using IoC Containers like Unity, is to have your components get a reference to the container so the dependency creation can be delegated to it when the need arises.  My first inclination was to wrap Unity in a Singleton and have the component reference this in order to resolve the dependency. 

Container.Instance.Resolve<IProductService>();

Singleton's are, however, notoriously difficult to test and very rigid in design.  Used in this manner,  a Singleton is nothing more than a global variable wrapped in a buzzword.  so I wanted a different approach.  Since we are using a Dependency Injection Framework, why not have the container inject a reference to itself into our components.

1.  First, configure the Unity container so that it can return a reference to itself.

image

2.  Next, create a property on your class to get a reference to the Unity container that created it.

image

3.  Finally, have the container resolve the dependency the first time it's referenced. 

image

Unit Testing

Testing is straight forward as well.   You could have your unit test use reflection to reach in and set the private field (_productService) to your mock object.  However,  giving your Unit Tests access to private members violates the "Use the Front Door First" Test Automation Principle and should be avoided if possible.  Alternatively, you could create a mock object for IUnityContainer and have it return a mock object for IProductService when the Resolve method is called.

Using RhinoMocks, the Unit Test would look something like this:

 

image

 

 kick it on DotNetKicks.com

Saturday, March 29, 2008 8:48:37 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]   Patterns | Unit Tests | Unity Application Block  |  Trackback
 Monday, March 24, 2008

Nice article posted by MSDN Magazine on Dependency Injection written by James Kovacs.  Coincides nicely with my Presentation on Unity Application Block at the Orlando Code Camp

Monday, March 24, 2008 7:16:10 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]   Patterns  |  Trackback
 Sunday, March 23, 2008

The Orlando Code Camp was a huge success.  Lots of great sessions and talented speakers. A special thanks goes out to Shawn Weisfeld of the Orlando .NET Users Group and Roy Lawson of the Lakeland Users Group, as well as the many other volunteers and speakers.

Below, I've posted my Power Point slides and code samples for both my sessions at the Code Camp.

 

The Unity Application Block

Beginning Test Driven Development

Sunday, March 23, 2008 12:29:59 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]   Events | Patterns  |  Trackback
 Wednesday, March 12, 2008

image

Orlando Code Camp 2008 - Saturday March 22, 2008

The FREE Orlando Code Camp will be on Saturday, March 22, 2008. Last year's Orlando Code Camp had 481 registered attendees, 52 sessions, and 38 speakers. If you are looking for free .NET developer training by hardcore .net developers in the Florida community, mark your calendar for this year's Orlando Code Camp.

 

Signup now, its filling up fast!

 

 

 

I am giving 2 presentations this year:

 

Beginning Test Driven Development
In this session I will discuss Unit Testing Goals, Principles and Philosophies such as Test First, Test Last and the dreaded, Test After. Learn what creating good unit tests mean and how it will help improve the quality of your applications.

 

The Unity Application Block
The Unity Application block is a lightweight, extensible dependency injection container with support for constructor, property, and method call injection. Microsoft has finally developed an Inversion of Control (IoC) container that will appear in the Enterprise Application Block. In this session I will introduce the basic concepts of Dependency Injection and review how the Unity Application Block is used.

Wednesday, March 12, 2008 8:22:14 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [2]   Events  |  Trackback

Lots of good content you can watch online or download for later viewing.

image

Mix08 Sessions

Wednesday, March 12, 2008 7:59:49 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0]   Podcast  |  Trackback
 Tuesday, January 29, 2008

 

This Month's Meeting

 

When: 1/31/2008 6:30 PM - 8:30 PM
Topic:

The Perfect Pattern Storm, where TDD meets UX and MVP.

 

As host of ARCast.TV, Ron Jacobs has a front row seat to observe the constantly shifting architectural landscape. In this session we will consider what happens when the force of test driven development (TDD) collides with the demand for better UX.

 

Speaker: Ron Jacobs is an Architect Evangelist in the Microsoft Architecture Strategy group based at the company headquarters in Redmond Washington. Since 1999 Ron has been a product and program manager on various Microsoft products including the .NET Framework, Windows Communication Foundation and COM+. A top-rated conference speaker, author and host of the podcast show ARCast.TV, Ron brings over 20 years of industry experience to his role of helping Microsoft customers and partners to build architecturally sound and secure applications.
Design Pattern Overview: David Hayden will be presenting an overview of the Factory pattern
Location:

Microsoft Corporation
3000 Bayport Drive
Suite 480
Tampa, FL 33607
View a map
View 1-Click Directions

 

Register for this meeting.

Tuesday, January 29, 2008 6:13:40 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Events  |  Trackback
 Saturday, January 12, 2008

I'm giving a presentation at the Lakeland Users Group this Tuesday, January 15, 2008 from 6:30 PM - 8:30 PM  entitled "Unit Testing Principles and Goals". 

I will discuss Unit Testing Goals, Principles and Philosophies such as Test First, Test Last and the dreaded, Test After.   Learn what creating good unit tests mean and how it will help improve the quality of your applications.  Learn to leverage to power of Test Drive Development and, when necessary, how to write Unit Tests for existing code.

 

Location:
2525 Drane Field Road, Suite 10
Lakeland, FL 33811

 

Updated:

Saturday, January 12, 2008 8:37:54 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]   Events  |  Trackback
 Tuesday, December 11, 2007

ThoughtWorks has a new IT Matters Podcast that discusses the business and technology issues facing the IT Industry. The First topic is on Domain Specific Languages Part 1 of 2.  A panel of ThoughtWorks employees including, Martin Fowler, Dr. Rebecca Parsons, Neal Ford and Jay Fields; all participate in a discussion around domain-specific languages (DSLs).

Topics include: 

1. How to build effective DSLs

2. When to use a DSL

3. What pitfalls to avoid

4. Some real-world examples of DSL best practices.

With the release of Visual Studio 2008 SDK that includes tools for Developing Domain Specific languages in Visual Studio 2008, the timing could not be better.  I am looking forward to listening to Part 2.

 

kick it on DotNetKicks.com
Tuesday, December 11, 2007 10:00:26 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Podcast  |  Trackback
 Tuesday, December 04, 2007

One of the best ways that I've discovered to keep up to date with the constant change of technology is to listen to podcasts.  I find this a great way to learn during my daily commute and exercise regiment (refilling my coffee AND getting the mail). 

 

One thing I would encourage is to attempt to listen while coding.  If you can listen to music while you code you can probably listen to podcasts with little effort.  Everyone is different but here is what I've discovered about myself.

  • If both ears are listening to a podcast I get too distracted and cannot concentrate enough on coding.
  • If I listen using my right ear, I grok almost nothing of the podcast content.
  • If I listen with my left ear, it seems to be a good balance between listening and doing.

I've heard of some who code while listening to a podcast in double speed to save time.  I can't do that but, apparently, some can. 

 

 

Here are the podcasts I find invaluable as a developer

 

smRSSImage Polymorphic Podcast Craig Shoemaker brings insight into software development in the .NET platform along with interviews with industry luminaries. Good content, good quality but an inconsistent schedule.
smRSSImage ARCast with Ron Jacobs Ron Jacobs is a Microsoft employee and delivers a weekly podcast on Channel 9 that dives into some tough .NET architecture topics. 
smRSSImage Software Engineering Radio Not specifically .NET related but contains a wide spectrum of Software topics from Dynamic Languages to Transactional Memory to Fault Tolerance. 
smRSSImage Software Quality Engineering Conferences Podcast Interviews with speakers from the Agile Development Practices 2007 Conference
smRSSImage OnSoftware Weekly interviews with some of the software industry's leading developers about a wide range of programming and development issues
smRSSImage WebDevRadio Podcast Web Development Discussion
smRSSImage Agile Toolkit Podcast Topics covering all things Agile. 
smRSSImage .NET Rocks! .NET Rocks! is a weekly talk show for anyone interested in programming on the Microsoft .NET platform. The shows range from introductory information to hardcore geekiness
smRSSImage Hanselminutes Scott Hanselman discusses utilities and tools, gives practical how-to advice, and discusses ASP.NET or Windows issues and workarounds.
smRSSImage ASP.NET PodCast The ASP.NET Podcast brings a technology focus to the area of podcasts.  This podcast is geared towards developers with applications that scale to a large amount of data and users.

 

I would like to hear what others are listening to and what software you use to manage your podcasts.  I have a love/hate relationship with ITunes.

UPDATE:

Top Developer Podcasts Part II

 

 kick it on DotNetKicks.com

Tuesday, December 04, 2007 7:23:05 PM (Eastern Standard Time, UTC-05:00)  #    Comments [16]   Podcast  |  Trackback
 Monday, November 26, 2007

Right now Techsmith is offering Camtasia and Snag-It for free.  You download the demo then register for a free license key.  These are previous versions of the software but they are still feature packed and will solve most of your screen capture needs.

download free snagit

Monday, November 26, 2007 8:56:53 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]   Deals  |  Trackback
 Saturday, November 24, 2007

If you don't have an MSDN subscription and you can't wait to try out the new Visual Studio 2008 features you can download the express edition and learn the new features while you wait for the professional edition to be available in stores.

http://www.microsoft.com/express/

Saturday, November 24, 2007 9:57:43 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   C#  |  Trackback
 Monday, November 12, 2007

image

 When: 11/28/2007  6:30 PM - 8:00 PM

Abstract: You can run, you can switch jobs, and you can write unit tests, but invariably at some point you will run into legacy code. Legacy code hides in many forms - sealed classes, spaghetti and big-ball-of-mud code, data in disparate data sources (or incompatible schemas). As an architect, there are steps you can take to get ahead of these issues and begin to make your codebases something you actually want to change. In this talk, we will discuss concepts from Michael Feathers' work on Working Effectively with Legacy Code as well as Scott Ambler's work on refactoring databases. You'll see tips and tricks to model your legacy code and data, and hear about ways to begin to turn your legacy code into a usable base."

 

Speaker: Cory Foy is an agile developer passionate about languages such as C# and Ruby. He currently works for Microsoft as a Premier Field Engineer, has been a developer on the NUnit team, and is known to speak at code camps and user groups across the country. He lives just north of Tampa with his wife and 2 daughters.

Registration: here

Monday, November 12, 2007 6:14:04 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   Events  |  Trackback
 Tuesday, October 02, 2007

Speaking in Tampa on October 18th - Repository Factory, Enterprise Library, Guidance Bundles

 

David Hayden ( Microsoft MVP C# ) is giving a  presenting to the Tampa .NET Developer Group on Thursday, October 18th at 6:30pm at the Microsoft Tampa Office.

 

The focus is on the new Repository Factory, which is a software factory from Microsoft Patterns & Practices that will generate a data access layer for your winform and web applications in minutes. It generates business entities, stored procedures, and repository classes from an existing database within Visual Studio. In addition he will also be showing off the following:

See you there! You can RSVP here.

 

 

 

I really enjoy David Hayden's Presentations and this topic is of special interest to me. 

Tuesday, October 02, 2007 6:26:40 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1]   Events  |  Trackback