Tuesday, December 20, 2005

Re-distribute a user control!

Finally, you can re-distribute a user control without having to create a custom control, which is explained in this article. VERY COOL!

Tuesday, November 29, 2005

Console lib

Is it a full month since I wrote last time to this blog? Wow, I must have been really bored...

Anyway, here is a wonderful library I found, that allowed me to write console c# applications the same way I could do that in C using conio.h library.

Friday, October 28, 2005

Binary counting with fingers!

Great poster: http://howtoons.net/archives/final/800binary.html
I can use binary counting to count up to 1023 with just two hands!

Thursday, October 27, 2005

I thought they were mock objects?

I am using mock objects for a while now, and I never felt any difference between mock objects and stubs. However, this blog seems to indicate that real mock objects are the objects based on behaviour testing.

So, only about 20% of my mock objects were really mock objects. Other 80% were stubs.

Wednesday, October 26, 2005

ASP style of development?

A lot of my co-workers complained about my ASP style in ASP.Net development. The only reason for such a complaint is that I am using data-binding statements on ASPX pages and user controls, like this: <%# DataBinder.Eval(Container.DataItem, "City")%>. I never use any server-side scripting code on the page itself, all server-side code goes to code classes. However I do like to use data-binding statements to achieve better separation of presentation from business logic. Indeed, what is the alternative? The alternative is to handle OnDataBound() events, find the controls within each row and manually set properties on them. This is not ASP style, this is VB6 style of developing Windows apps. Is it better? No, you still have your presentation mixed up with the business logic, the methods become very long, there is indeed a lot of code written to do something which I can easily accomplish by using data-binding statements.

I would actually go to the extreme by trying to separate business logic from presentation. I would not use any code-behhind. I'll have all pages and user controls inherit from pages, but I would prevent Visual Studio from coupling these classes to the pages. This way if I add a control to the page it will not automatically appear in the class. All events should be registered by using control's attributes, like "onclick". The protected control variables will appear in the base classes only when I need to read properties of the controls. This way we can have the same base class for multiple pages or controls, avoiding duplication of the business logic, while being less strict about presentation (where some duplication is always allowed).

Tuesday, October 11, 2005

Building fire :)

This is just funny, taken from http://msdn.microsoft.com/security/default.aspx?pull=/library/en-us/dnvs05/html/vs05security.asp

"Currently, however, we can't build fire and forget applications. "

Why would you want to build fire? And why do you have to forget applications?

Monday, October 10, 2005

Friday, October 07, 2005

Service-oriented architecture

If you want to abstract from Microsoft propaganda, here is what I think SOA means:
  • It is orthogonal to Object-Oriented technology. You can write SOA apps using procedural languages and structural programming.
  • It is orthogonal to XML. You can use XML and Web Services but not have SOA. Or you can have a very good SOA without any XML.
Two examples to confirm my points are COM+ and BitTorrent. They are probably the best SOA applications, however they are not build on XML and Web Services (though new version of COM+ supports SOAP).

  1. COM+. Have you ever tried to configure firewall for COM+ app? You probably know that the client machines start acting as servers if they are in charge of coordinating transactions. This is the main feature of SOA: blurring distinction between client and server. Client becomes server, server becomes client. Or if you want, you don't have clients and servers anymore, you have services.
  2. BitTorrent: this is probably the best SOA app: every client machine must become a server, all computers are working in collaboration for one goal: downloading the files. No server or client - only services.

Monday, October 03, 2005

Iterative or feature-driven development?

I started a thread on Extreme Programming mailing list:

http://groups.yahoo.com/group/extremeprogramming/message/113227

I am still trying to control chaos on the projects I am working on. I felt that iterative development is too restricting and not agile enough. Business expects the time from inception to release to be as short as one week in some of the cases. There is no way to do that with two-week iteration.

My priorities will be:
  1. Automated QA tests.
  2. Automated (as much as possible) deployment
  3. Smart branching strategy
  4. Code&Design reviews.

Friday, September 23, 2005

Dynamic interfaces in VB 9

VB 9.0. One of hte coolest features is dynamic interfaces or strong duck typing, which will let you cast any type to any interface, and the cast succeeds as long as the all the methods in the interface match the methods in the object. Very cool!

Language feature

New thing from Microsoft: LINQ. Somewhat brings you closer to languages like Smalltalk or Ruby, but not quite. Will probably confuse prople a lot, because this is SQL, but a lame one: with SELECT at the end.

Wednesday, September 21, 2005

Boundary test

How often you find yourselves writing a unit test that really tests an external system, like database, external web service, etc.? XP does not recommend to write such tests, and recommends instead to write a harness for database, web service, etc. The reasoning is very simple: these tests are easier to write, they run much faster and testing only the code you wrote, not the code of third party. However I still believe there is a great value in these tests, which I will call boundary tests to distinguish it from unit tests, which are usually layer tests. The value of boundary tests is in testing connectivity to the services your application relies on. And if you use the principle of testing anything that can possible break, I can guarantee that connectivity to external services (and the services themselves!) break as often (or even more often) than the code we are writing.

Tuesday, August 30, 2005

Working again

Today is my first day @ Honeywell. Nice to be back to work again. I was given an architecturel document. It is nice to see that someone actually follows the standard laid out in "Documenting Software Architectures".

Saturday, August 27, 2005

Knoppix

OK, I downloaded a torrent of Knoppix 3.9 and burned it to CD. When I booted up from that CD after about 30 minutes I've got a nice picture of Earth, Sun and astronaut. No icons, on the desktop, no buttons, menus, even Ctl-Alt-Delete did not work. Do I have to run Linux to see a pretty picture?

Friday, August 26, 2005

session_end is evil

session_end is evil. Not only it is not get fired if you are using state server or sql server, it gets fired at random times: like an hour after the session is expired.

A good replacement for it could be this:
http://www.codeproject.com/aspnet/PageTracking.asp

Thursday, August 25, 2005

More XP SP2 troubles

You would think all the problems with SP2 are solved by now. Guess what, I had to spend tow hours trying to figure out how to run a COM+ application! I had to configure the least secure configuration of DTC to get it to work. You would think SP2 is more secure, but it does require you to run the application with elevated privileges.

Wednesday, August 24, 2005

SmartPart

This is a web part for SharePoint which allows you to load a user control.
http://weblogs.asp.net/jan/archive/2004/06/10/152932.aspx

I still lust for a tool to convert a user control to a custom control. We'll continue to search... :)

Upgrading to XP SP2

Two major issues:
  1. Could not access SQL server on localhost. Netstat reported that the server was not listening for connections. Turned out that my server was vulnerable to Sasser, therefore XP SP2 disabled TCP/IP connectivity to the server. After installing SQL SP3a it worked again!
  2. Was getting "Out of memory" error when trying to access AS/400 from the web app. All unit tests and windows apps were working. Had to change process model from "machine" to "system" in machine.config. Which made the system less secure, the exact opposite of what XP SP2 was going to do.

Conclusion: XP SP2 is too secure.

Tuesday, August 23, 2005

Drive letter changed:

Check this out, the driver letter change on Win2K Server, triggered by installation of new RAM! I loved the error message too: "Pagefile is too small or nonexistent" with recommendation to change the pagefile size, and then throwing me back to the login screen (trying to make fun, you bustards!). Thanks to KN article Q249321 I could remotely edit registry on the computer and finally log in. C: drive was changed to G: drive. After rebooting once again now I have both C: and G: and they are identical! Fun!!!

Monday, August 22, 2005

Unemployed

First day of being unemployed. Breakfast at 8AM on my veranda. Called to my parents. Checking out tech news. Have to go through 63 mails on GMail.