SyntaxHighlighter

Friday, March 28, 2008

I AM ALT.NET


(AltNetPedia)

A week or so ago I listened to Scott's weekly podcast as I do every week, and the topic was ALT.NET. After listening to it... I went over to altnetpedia(the link above) to learn more.
It is so refreshing to learn that a lot of what I'm doing and what I'm striving to do actually has a name and meaning. As I gear up for the conference next month I'll be going over the major principles and practices that I try to incorporate in my daily development efforts. It'll just be a review, but again I want to be sure I'm covering as much as I can.

Practices and Principles like the following: (These will be referenced from Agile Principles Patterns and Practices in C#)

1) Single Responsibility (SRP)
2) Open-Closed (OCP)
3) Liskov Substitution (LSP)
4) Interface Segregation (ISP)
5) Strategy
6) Facade and Mediator
7) Singleton and Monostate

In addition to the list above... I'll also be digging around in Spring.NET a little more since I got the hang of the IoC container. That along with daily development efforts should be enough to find myself ready for the event.

So what does all this mean? What does it mean to be ALT.NET? On a daily basis I find myself being a little frustrated at the fact that I'm apart of a large organization and yet... I'm the only one in my group who is employing fresh, innovative design ideas. As a contractor I came in and built a bridge between existing legacy C++ and Modern .NET with the help of CLI. I had no previous C++ skills.... the only thing I had at the time was passion, confidence, and the will to make the .NET platform play a key role in enhancing the legacy code base. This got me noticed, and so I became a part of the team full time. Even though I'm apart of the team, the fact still remains... I'm the only one implementing TDD, BDD, MVP,IoC, SRP,ISP, etc. I mean I've even tried to employ XP style approaches to some of the projects that I'm working on. Nothing formal, just some basic techniques like index cards for user stories, breaking up two weeks worth of work into two iterations. Even though I'm doing all this... it's completely going unnoticed.... mainly because no one knows about this stuff at all. Sigh... what does it all mean?

I'll continue to push myself and the .NET platform to the edge... because that's what's made me the developer that I am today. A lot of great development coming with emphasis on home automation, Micro Framework(embedded devices), integration with Media Center (Vista Ultimate) , Windows Home Server (mControl add-in), etc.

The way things are going I've decided to give it a little more time to see how it goes. They're finally making plans to migrate some legacy C++ code over to C#, and seeing as how I've got experience in Migration, Porting, and Total Re-Writes... I'd say it's right up my alley. :-)

Anyway, I'm gearing up for ALT.NET!! (A little over two weeks to go)

-Develop with Passion
Jean Paul S. Boodhoo

Tuesday, March 25, 2008

The House That .NET Built (Part 5)

Well... were almost home. The .NET service oriented, solar powered, wind powered, technology driven, automated home is almost complete. This will be the last post until it is completely done.
Below are a few pictures of the outside completed... minus the landscaping. Below the pictures are a few videos of the inside of the home insulated and dry walled.

All in all... it was a good Easter Sunday. :-)










(Up-stairs) 2nd floor


(Down-stairs) 1st floor


(Garage/Front) Outside

Sunday, March 16, 2008

Becoming a better Developer

In my quest to become a better developer I went out Friday night (after a movie with the family) to Barnes and Noble and planned on picking up Patterns of Enterprise Application Architecture by Martin Fowler. Instead I picked up Applying Domain-Driven Design and Patterns which is shown below. This book captures everything that Martin Fowler's book covers except it has a .NET flavor instead of the Java flavor that is expressed in Martin's book.

I'm already through the first three chapters... it's nice to read a book that I can relate to because of my development efforts. Anyway, with comments from Scott Bellware, and forwards from Martin Fowler and Eric Evans.... this book certainly lives up to it's expectations so far. :-)










Saturday, March 8, 2008

The House That .NET Built (Part 4)

Moving right along.... with one week to go before our first official walk through... we are very excited to see all the little things starting to go in to place. Tyvek House Wrapping, Roof, Windows, Sliding Glass Door, Furnace, Pex tubing run up to copper, and Tank less Water Heater rough-in.

I'm definitely making notes along the way for devices to be strategically placed in certain areas to monitor climate, watts, water, etc. :-)











The Winner Is... Spring.NET!!!!



After playing around with a few different Inversion of Control Containers I've come to the conclusion that the Spring.NET framework is definitely the way to go.

Not only does if give me a mature (IoC), but it has so much more....

Spring.Core – Use this module to configure your application using Dependency Injection.

Spring.Aop – Use this module to perform Aspect-Oriented Programming (AOP). AOP centralizes common functionality that can then be declaratively applied across your application in a targeted manner. An aspect library provides predefined easy to use aspects for transactions, logging, performance monitoring, caching, method retry, and exception handling.

Spring.Data – Use this module to achieve greater efficiency and consistency in writing data access functionality in ADO.NET and to perform declarative transaction management.

Spring.Data.NHibernate – Use this module to integrate NHibernate with Spring’s declarative transaction management functionality allowing easy mixing of ADO.NET and NHibernate operations within the same transaction. NHibernate 1.0 users will benefit from ease of use APIs to perform data access operations.

Spring.Web – Use this module to raise the level of abstraction when writing ASP.NET web applications allowing you to effectively address common pain-points in ASP.NET such as data binding, validation, and ASP.NET page/control/module/provider configuration.

Spring.Web.Extensions – Use this module to easily expose a plain .NET object (PONO), that is one that doesn't have any attributes or special base classes, as a web service, configured via dependency injection, 'decorated' by applying AOP, and then exposed to client side java script.

Spring.Services – Use this module to adapt plain .NET objects so they can be used with a specific distributed communication technology, such as .NET Remoting, Enterprise Services, and ASMX Web Services. These services can be configured via dependency injection and ‘decorated’ by applying AOP.

Spring.Testing.NUnit - Use this module to perform integration testing with NUnit.

With the all the modules above I can take baby steps with integration testing... once complete I can just add a DLL and I'm good to go. I also feel especially good about this framework because it's a direct port of Java's Spring Framework, which has been around for a while and very successful in major industries... including Financing. :-)

I'll be sure to post some example uses of the Spring.Core assembly which offers the Dependency Injection stuff. :-)

-Develop With Passion
Jean Paul S. Boodhoo



Wednesday, March 5, 2008

Which (IoC) Should I Use?

Today it became clear. I'm writing a Windows Forms Application using MVP(supervising controller) "Test First"... and the presenter is taking on the responsibility of calling in to other domains such as Services Layer, Persistence Layer, etc. The presenter is communicating entirely through interfaces which makes it nice and generic... I'm abstracting away the implementation details. So there's about six different contracts(Interfaces) that the presenter needs to get access to. Currently I'm using poor mans dependency injection via Constructor Injection... this is the act of constructor chaining where the overloaded constructor takes on the responsibility of wiring up the concrete types to the abstractions. While this works... it's kind of messy and code is beginning to smell. So I need to implement a Inversion Of Control Container... their are so many to choose from... with choices like... Spring.NET, Structure Map,Object Builder, and Unity... it's very difficult to make the choice of which to use. Since I've learned about Object Builder at the recent code camp... it's kind of fresh in mind, however Unity builds on top of Object Builder, and it has a seamless configuration option which allows a nice clean and easy to read mapping of types to Interfaces. Once the setup is complete... I can just use the container to call the abstraction methods.


Sample of poor mans dependency injection
-----------------------------------------------------

public class Presenter
{
IService m_service;
Presenter()this() //Constructor Chaining
{
//Default Implementation
}
Presenter()
{
m_service = new Service(); //Constructor Injection
}
}

VS. Unity Sample Below
------------------------------------------------

IUnityContainer container = new UnityContainer();

container

.Register<IService, Service>();

IService service = container.Get<IService>();



Unity is a much cleaner approach... unfortunately, not many people would be able to maintain my code if I were to go on vacation with out some major documentation... so I need to do the best I can with making this approach understandable to other developers on the team.



Until Next Time.....



-Develop with Passion
Jean Paul S. Boodhoo

Monday, March 3, 2008

The House That .NET Built (Part 3)

Wow! Framing is just about complete... and we can finally get a sense of the floor plan we picked out. As usual here are a some pictures and video at the bottom. My wife took the video this time, but she kept covering up the speaker on the camera, so that's the explanation for that.