Monday, August 22, 2005

Playing with Partial Classes in C#

I was reading a Partial Class Definition on MSDN and thought it looked simple enough and decided to take Partial Classes for a C# run.

Here it is.

Tuesday, August 16, 2005

Web UI Developers, for now, use the Firefox Browser

I am primarily a Microsoft platform developer. Microsoft makes a great IDE in the form of Visual Studio.Net and has a great language in C#, which is getting better with C# 2.0.

However, I must say, at least until IE 7 becomes more visible and out of beta, that Mozilla’s Firefox browser provides better tools for web developers through Firefox’s extensions for developers.

I especially like the Web Developer extension. Sure beats the Alt+Tab dance between the browser you are viewing your changes with and your CSS editor!

Sunday, August 07, 2005

How can we be sure we are singing from the same page of music? – Fit in the key of C#

To build on an earlier posting on the use of Fit with C#, here are examples of Fit fixtures implemented in C#. The fixtures I demonstrate are the ActionFixture, ColumnFixture and RowFixture.

I also briefly discuss the desire to test properties in addition to fields and methods with Fit. I have "tweaked" the source code to provide this. My initial tests work but I would like to further test the code and submit it to other Fit developers as I am sure this has already been considered. My guess is that I may not be implementing the RowFixture subclass correctly. I will provide my source code on this later following more tests and discussion.

UPDATE 7-10-2006: After posting the above info, I submitted a proposed patch to source forge, artifact 1255429, which deals with using properties instead of member variables. The patch was submitted to source forge in August of 2005. Nothing as of this update has been done, that I am aware of, so I thought I would put it out for public consumption and comment.

In more detail, fixtures deriving from RowFixture have instantiated classes with public variables, instead of exposing the instantiated object’s members via public properties. With these modifications you can write fixtures directly against objects under test, which are typically the actual application classes, exposing properties instead of variables to the RowFixtures. This enables the .Net developer to avoid writing additional code beyond the fixture and the actual application objects under test.

The new post: Testing .Net Properties with FIT

Friday, August 05, 2005

Resharper: Sharper indeed

ReSharper provides some needed editing features for Visual Studio.Net.

For example, if you have private local variables and you want to expose those guys via public properties just Alt+Insert (ReSharper > Code > Generate... via the ReSharper menu) in Visual Studio and you get:

Resharper Generate code menu

As you can see you can also easily generate a constructor, implement interface members, or override members from base classes.

There are many more “niceties” from ReSharper such as automatic indentation within bracket blocks {}. I got real tired of typing the brackets, separating them via hard return, and then tabbing to indent the first line in the block of code.

public void SomeMethod()
{
     //indented code here
}


Instead, when you enter a set of brackets for a block of code, ReSharper will insert your cursor between the brackets. Then, when you hit the Enter key the new line is indented for you! These are just a few of the great features of ReSharper.

I did not mention the Refactoring it provides. ReSharper rocks!!

Thursday, August 04, 2005

101 Samples for Visual Studio 2005, in VB.Net and C# -- Nice!

Via a post on the ServerSide.Net site from Paul Ballard, Microsoft has released a compilation of 101 code samples in both Visual Basic.Net and C# for Visual Studio 2005 and the .NET Framework 2.0.

Samples include base class library samples, data access samples, web development samples, and windows forms samples.

Nice!

I love Virtual PC!!!!

I love Virtual PC! Now I can do something more unique with my older workstations, one with Redhat and the other with Windows 2003 Server, since I now have Virtual PC where I can have several "virtual installs" of operating systems that run on my Windows XP Pro SP2 system!

I have 2 Windows 2003 server virtual installs (one with Fitnesse, PHP5 and the Netbeans IDE running on it and the other with Visual Studio 2005 Beta 2) and am installing SUSE Linux 9.3 in a separate install next!

This is most useful when doing development R & D on various OS/platform applications. Did I already say that I love Virtual PC?

Thursday, July 28, 2005

C# FIT Basic Setup on XP Pro

As you know from a previous post, I have been reading Fit for Developing Software by Rick Mugridge. What a great tool for communication and clarification of requirements between the customer(s) and software developer(s).

I am now at the chapter introducing Fitnesse. The use of a wiki format for Fit tests is powerful to say the least. More on that going forward.

Anyway, I thought it best at least to detail the steps of the basic setup of .Net's Fit on Windows XP Pro. So here you go!

Sunday, July 24, 2005

Open exchange of ideas...NOT

Here is a great Dilbert cartoon that unfortunately describes the mentality of many, not just managers, in the exchange of ideas in the corporate environment. I think it is true that one can keep the subordinates or co-workers ignorant and powerless, but only for so long. Then, the brightest and best either dumb down, which harms the organization, or move on to other employers, which also hurts the company. In either case, the ones who win are the competitors.

I must say I am thankful this is not the case where I work! Thanks Sarah and Reed!!

Saturday, July 16, 2005

Just got my copy of Fit for Developing Sofware!

I just got my copy of Fit for Developing Software by Rick Mugridge and Ward Cunningham! Stay tuned for musings from this book. I hope to be providing some of the book's code examples (which in are java in the book) in C#.

Tuesday, July 12, 2005

IT Conversations - It’s a small world indeed

Each morning, at least on weekdays, I jog my usual neighborhood loop. To make this less tedious I usually have my Rio MP3 player piping music or a podcast into my head. The last few days here in Northern Kentucky we have felt the effects hurricane Dennis. Just days earlier I watched as the hurricane ripped through the pan handle of Florida. I find it fascinating that within our vast ecosystem one pressure or influence affects another. Anyway, on my run this morning, I noted the cloud cover from Dennis. At the same time I was listening to an MP3 that was found as the result of “googling” for technology podcasts. What I found from Google was IT Conversations. You often here in agile development circles of the emergence of "organic" applications due to environmental pressures. Here, at least in my view, is the emergence of a great service due to pressures of the need for thought provoking audio in the technology “ecosystem.”

The IT Conversations site is a free, donation based podcast site that deals with everything from software development to social trends and how technology affects these domains.

I highly recommend IT Conversations and encourage all to go there. If you agree, please donate to keep the informative and entertaining podcasts coming.

Saturday, July 02, 2005

Configuring NUnit 2.2 to use Visual Studio 2005 Beta 2

I have been playing with Visual Studio 2005 Beta 2 lately. I do not have any Team System install on my test server yet. I was thinking how nice it would be to meanwhile, at least, have NUnit 2.2 working with VS.Net Beta 2.

Click here for the steps to make that happen.

I will be getting Visual Studio 2005 Team Suite Beta 2 on my server shortly. Until then, it is nice having NUnit2.2 to use with just the plain Visual Studio 2005 Beta 2 install.

Saturday, June 25, 2005

Language Oriented Programming

I was browsing my RSS feeds and noted an update on Martin Fowler's bliki dealing with Language Workbenches for Language Oriented Programming (LOP). This entry led to an article by Sergey Dmitriev entitled, Language Oriented Programming: The Next Programming Paradigm. As I was reading through the article I came across the statment:


In mainstream programming, most of the time spent 'programming' is really just finding ways to express natural language concepts in terms of programming level abstractions, which is difficult, not very creative, and more or less a waste of time. For example, today a good deal of development time is spent on object-oriented design (OOD). This is actually a fairly creative process where the programmer expresses classes, hierarchies, relationships, and such. The purpose of this exercise is to express the program in object-oriented terms such as classes and methods. The process of OOD is necessary because these classes and methods are the only abstractions that object-oriented languages understand. It seems like it is necessary and creative, but with Language Oriented Programming, OOD is not needed at all.
Okay, now you have my undivided attention. Having just spent a week in RUP training which was about taking use cases and performing "use case realization" which is completed to translate the anticipated business line usage senarios of the application in question, I was really interested.

The article then discusses the aspects of LOP. Then following this an overview of LOP and a JetBrains' Meta Programming System overview dealing with LOP is provided. Most interesting.
Needless to say, I will be reading more on LOP.

Saturday, June 18, 2005

RUP Development Iterations and TDD together

I have spent most of this week in Rational Unified Process (RUP) training, presented by the Ivar Jacobson International company. The training was engaging in that there were several opportunities for group discussion and hands-on exercises.

During a class discussion it was stated by the teacher that within the old waterfall lifecycle approach, when the project was nearing the production release date, testing was the portion of the project that got squeezed out due to a looming deadline. The discussion then moved to the fact that within the phases of RUP, iterative style development insures that testing for that particular iteration is done and not affected by timeline pressures.

When the instructor stated that, I quickly considered past situations within development iterations where testing time still got "squeezed" because of the various pressures to move to the next iteration. Because I know the value of the Test Driven Development (TDD) methodology I thought, what if, within the RUP phase iterations, TDD was utilized?

First, the TDD methodology could ensure that the developer tests are passing and that code coverage is almost complete. In addition, TDD would make certain that the code is refactored and ready for the next development iteration. TDD could also provide a living artifact to demonstrate to the stakeholders of the project that the entire bank of developer tests is passing. (You TDDers know the warm, fuzzy feeling you get when you see the green bar of tools like JUnit or NUnit.) Finally, the tests provide a quick and automated regression testing mechanism when any changes are made to code base in future iterations.

Thursday, June 16, 2005

The Rational Unified Process and Test Driven Development

Since I have spent most of this week in RUP training, presented by the Ivar Jacobson International company, I was reading a blog from Mike Bosch concerning the Rational Unified Process (RUP) and Extreme Proramming (XP).

I agree with Mike concerning "Unless you have a LOT of authority you will find it very exhausting to try and influence a culture change without buy-in from your management." I work at a large financial institution which whole heartedly supports RUP. In addition to having one of the "three amigos" own consulting company contracted to provide detailed courses on the four phases of RUP and their various disciplines, Dr. Jacobson has often provided great lectures to the application development teams that are broadcast to the various corporate team locations within the United States. In my view that is great. However any corresponding and/or competing methodology is typically viewed with skepticism and then ignored.

I have found that within the corporate environment I have been able to introduce Test Driven Development as a programming methodology that our dev team can use internally. In fact I am finding that it is a relatively easy sale because TDD is so effective concerning both the quality of code and efficiency of the team production! Moreover, the artifact of the tests is a great source of "developer oriented documentation" for new team members that are already familiar with developer testing tools such as JUnit or NUnit.

All in all, RUP is a tried and tested methodology for an organization as large as the one that I am currently employed. Yet, it is greatly enhanced by agile processes.

Monday, June 13, 2005

My First C# DotNetNuke Module

Click here to see the ramblings of my first C# DotNetNuke custom module. In the normal tradition, its a Hello World module. What else could it be, right?

Initial DotNetNuke "gotchas" with Windows XP Pro

After reading for sometime the great reviews of the opensource portal, DotNetNuke, I decided to download it and give it a spin. Wonderful framework but a few "gotchas" when installing on a Windows XP Pro OS workstation.

Click here to find out more.

Sunday, May 08, 2005

PDF to byte array with TDD

At work, I was tasked with reviewing and prototyping a Windows Service that will monitor a file directory, and invoke a web service that utilizes FileNet to archive reports that will be FTPed to the directory in question.

From the sample API of the web service, the first task was to get the report, that is in a PDF format, to a byte array that will be passed to the web method.

Click here to see the how Test Driven Development (TDD) made this task much easier and quicker to complete.

Monday, April 18, 2005

What to do with complexity

I was pursuing the Creating Passionate Users blog and noted a link to a new, interesting product that the Head First folks are coming out with called Head First Design Meditations. This looks to be a deck of cards that is, Designed to be used as a brainstorming and inspiration tool, the card deck will contain small bits of software design wisdom, insights, idioms, inspiring quotes and perhaps even a chuckle or two.

What I quickly noted on the page was the following quote by Alan J. Perlis: Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

Wow! I must admit that when I have encountered complexity, in both code and in life in general, I have ignored it, suffered it, and avoided it. Rarely, if ever, have I removed it. What comes immediately to my mind concerning the removing of complexity is Refactoring. This I try to do regularly with code. What is Refactoring? According to the Wikipedia Refactoring is the process of rewriting written material to improve its readability or structure, with the explicit purpose of keeping its meaning or behavior. Wikipedia defines readability as, Readability is a measure of the comprehensibility or understandability of written text.

The main reason I refactor is indeed pragmatic. I find that further updates to the code is easier to do if the current code is as clear in its intent and as simplistic in its structure as possible.

Perhaps those who really are geniuses remove complexity out of altruistic reasons, for myself as a mere mortal, I remove it so I can better understand how and why.

For more quotes by Alan J. Perlis, click here.

Saturday, April 09, 2005

XHTML and CSS: a union made in....

Because I sit all day hammering out code, I have to make a real effort to get enough exercise. What I often like to do is download and listen to a great weekly podcast, that is offered in both MP3 and WMA format, that is a recording of a show called .Net Rocks while I am taking my daily jog. This week’s show featured Rory Blyth and Scott Hanselman who discussed at length a great site, csszengarden.com that demonstrates the use of XHTML and CSS for website design. To date, I have used CSS primarily for font formatting, but not much else. However, a combination of both the show and the csszengarden web site have caused me to take another look at CSS (Cascading Style Sheets) and a new look at XHTML (Extensible HyperText Markup Language).

Check out my latest learning spike about using XHTML and CSS to form a great web design toolset.

Monday, April 04, 2005

NMock 101

Recently a new member of the development team questioned me on how various dependent objects, that are part of an implementation of an app we are building, could be tested using NUnit and NUnitASP, a set of unit testing tools. I stated that the simplest way I understand would be to "mock" the objects that the view (or the UI) and controller tiers under test are dependent upon. The tool that I am most familiar with is NMock. Since it had been a while since I had utilized NMock for testing purposes, I thought it would be good to review the documentation for the tool.

Click here to see the step-by-step process I used to create a demo of NMock using a TDD methodology with NUnit.