My current solution holds 32 projects. Many of the projects in my solution hold project references to other projects within the solution. The project references make XCopy deployment of our web app quick and easy. No problems here, right? Wrong! After many weeks of attempting to debug my web app, the debugger seemed to work in a very hit and miss fashion.
Here is the scenario...I have VS open. I make changed to a domain object class. I go to the Debug menu and select Run. My breakpoint are hit, and life is wonderful. Here is the catch. I stop debugging and make some more changes. I do to the Debug menu and select Start. This time, when my page opens in the browser, I get an error that the WebControls.dll can't be found. WTF?!? I stop debugging. I rebuild the solution outside of the debugger. Everything appears to be fine. I start the debugger again, only to see the same error. Okay, no need to panic. I will just close down VS and reopen (which becomes quite a lengthy chore if you are working over VPN and your solution gets the lastest version on load). That being done, I rebuild. No errors, everything looks fine. I start the debugger. By this point, about half of the time, the error is gone and things are fine. But the other half of the time, the error is STILL THERE!!! So what do I do? Occassionally I follow the theory that if I try the same thing over and over without changing anything, it is bound to work sooner or later, so I close down VS, reopen it, and give it another try. Eventually, I throw my hands up in the air and restart my machine. That always fixes the problem.
The thing is, it is difficult to meet estimate deadlines when I have to restart my machine at sporatic times throughout the day.
I am in no way suggesting that in my elevated state of frustration, it is impossible that I overlooked a simple and quick fix to my issue.
After being forcefully exposed to my rants, my co-worker, the JavaKid, finally asked me what was going on and how could he help. I told him that there was nothing he could do because the problem was that VS was the suckiest IDE in existance, end of story. Although the JavaKid loves to hear about the ways Microsoft can improve, he did ask me why I would choose to run the debugger in the way I was using it. He told me that there is a better way to debug a web app. So, to make a long story short (too late, huh?), he told me that it works much nicer with a web app if instead of selecting Debug/Start, you right click on the page you want to launch, View it in Browser (at which point I am fuming because I do NOT want to view it in browser, I want to DEBUG). Once the page is loaded in the browser, select Debug/Processes. In the list of processes, select aspnet_wp.exe, click Attach, and hit Okay. Now we are debugging! Since I have followed his advice, I have not seen that nasty error.
So the moral is: When building a web app, although the play button looks shiny and tempting, DO NOT PRESS IT! Attach to your running process instead. This tip has saved me many hours.
Also, if you tend to get the error about a resource cannot be copied because it is use by another process, try disabling your Indexing service and restarting IIS.
Wednesday, March 23, 2005
Monday, March 21, 2005
JavaScript - Bigger and Better?
I read an article today about the possible future of personal computer use, called
Goodbye, computer; hello, world! . In a nutshell, this article talked about an idea that may or may not be underway right now at Google. The idea is that Google would create their own operating system and allow users to subscribe to their mega-computer that would hold all of their personal applications. Theoretically, this would make the need for storing data on a PC obsolete. You could now travel to Geneva without lugging around your laptop and just hop on a computer over there, login, and voila! All of your applications are at your fingertips.
Okay, that would probably work for some non-proprietary data needs. I might feel comfortable publishing out my Quicken data to Google, as long as my privacy was guaranteed. I am not so sure this would ever work for business-level data, however.
Then came the part of the article that made me squirm. In order for this throw-away-your-PC model to work, web applications would have to become quicker. I will just quote directly the line about the technologies that Google is looking to use to assist their team in creating web apps that are as fast as desktop applications. This new marriage of technologies is called Ajax.
“Ajax, which is short for Asynchronous JavaScript + XML, combines JavaScript, dynamic HTML, and XMLHTTP to, in essence, let you build Web-based applications that run as quickly and seamlessly as local software.”
Maybe I am alone in this, but the idea of working with JavaScript as my programming language of choice is not a pleasant prospect. Actually, relying on any scripting language is something of which I would prefer to steer clear.
But it would be very cool to be able to write my applications for the web without having to be as considerate of loading and post back speed. And having an engine manage asynchronous requests from my web app to speed responsiveness would be very cool. So is it time for me to dig back out my JavaScript books that I have hoped to forget existed?
Goodbye, computer; hello, world! . In a nutshell, this article talked about an idea that may or may not be underway right now at Google. The idea is that Google would create their own operating system and allow users to subscribe to their mega-computer that would hold all of their personal applications. Theoretically, this would make the need for storing data on a PC obsolete. You could now travel to Geneva without lugging around your laptop and just hop on a computer over there, login, and voila! All of your applications are at your fingertips.
Okay, that would probably work for some non-proprietary data needs. I might feel comfortable publishing out my Quicken data to Google, as long as my privacy was guaranteed. I am not so sure this would ever work for business-level data, however.
Then came the part of the article that made me squirm. In order for this throw-away-your-PC model to work, web applications would have to become quicker. I will just quote directly the line about the technologies that Google is looking to use to assist their team in creating web apps that are as fast as desktop applications. This new marriage of technologies is called Ajax.
“Ajax, which is short for Asynchronous JavaScript + XML, combines JavaScript, dynamic HTML, and XMLHTTP to, in essence, let you build Web-based applications that run as quickly and seamlessly as local software.”
Maybe I am alone in this, but the idea of working with JavaScript as my programming language of choice is not a pleasant prospect. Actually, relying on any scripting language is something of which I would prefer to steer clear.
But it would be very cool to be able to write my applications for the web without having to be as considerate of loading and post back speed. And having an engine manage asynchronous requests from my web app to speed responsiveness would be very cool. So is it time for me to dig back out my JavaScript books that I have hoped to forget existed?
Friday, March 11, 2005
Visual Basic 6.0 Petition
If you have been reading my blog since the start, you will know that I come from a Visual Basic background. My first experiences delivering solutions to my business clients came in the form of VB 6.0 windows applications. I even occasionally opened the dreadful IDE that was Visual InterDev. Wow, did that ever suck. I thought it was pretty cool at the time, considering my other alternative of FrontPage and notepad if I wanted to develop on the Microsoft platform.
I also was very supportive of VB.net. I couldn't wait to get my hands on the first beta of the .net framework.
I did have to deal with some pains when it came to the applications I built using VBScript or VB 6.0 once the .net Framework was around. There really is no way that I have found to easily port code from 6.0 to .net. I had to decide for each of my client application's if I thought it would be better to continue to support the application in 6.0 or if it would be better to re-write the app in .net. After working with .net for a couple of weeks, I never wanted to go back to 6.0. Whenever I had the chance, I upgraded my clients. I even estimated an upgrade at about a tenth of the actual cost and resolved myself to doing the rest of the work for free in my personal time just so that I would not have to use Visual Studio 6.0 any more.
That is why I have trouble understanding the purpose of this "Save VB 6.0" petition that has been ciruclating. I understand how there may be very large legacy systems built in older versions of Visual Basic, but come on. Microsoft has continued to support Visual Basic 6.0 for years since the .net release. For legacy code, wrap it, convert it, or leave it. Again, it is completely possible that I missing the whole point, so if I am, please enlighten me. But I do not understand why Microsoft should continue to support an out-dated language. I am sure there are applications written in Lotus 1-2-3 that are still running out there, too. Is there still support for Lotus 1-2-3? Gosh, I hope not. What a dreary life that would be if you were the support person.
So VB 6.0 is a thing of the past. As a Visual Basic language supporter, I ask, what is so wrong with that?
I also was very supportive of VB.net. I couldn't wait to get my hands on the first beta of the .net framework.
I did have to deal with some pains when it came to the applications I built using VBScript or VB 6.0 once the .net Framework was around. There really is no way that I have found to easily port code from 6.0 to .net. I had to decide for each of my client application's if I thought it would be better to continue to support the application in 6.0 or if it would be better to re-write the app in .net. After working with .net for a couple of weeks, I never wanted to go back to 6.0. Whenever I had the chance, I upgraded my clients. I even estimated an upgrade at about a tenth of the actual cost and resolved myself to doing the rest of the work for free in my personal time just so that I would not have to use Visual Studio 6.0 any more.
That is why I have trouble understanding the purpose of this "Save VB 6.0" petition that has been ciruclating. I understand how there may be very large legacy systems built in older versions of Visual Basic, but come on. Microsoft has continued to support Visual Basic 6.0 for years since the .net release. For legacy code, wrap it, convert it, or leave it. Again, it is completely possible that I missing the whole point, so if I am, please enlighten me. But I do not understand why Microsoft should continue to support an out-dated language. I am sure there are applications written in Lotus 1-2-3 that are still running out there, too. Is there still support for Lotus 1-2-3? Gosh, I hope not. What a dreary life that would be if you were the support person.
So VB 6.0 is a thing of the past. As a Visual Basic language supporter, I ask, what is so wrong with that?
Wednesday, February 23, 2005
Ode to Trace
I have a project I have been working on wrapping up. We have gotten tons of user feedback, which thrills me to know that my tool will get used. On my list of items needing attention, however, one item loomed largely. I ignored the item for as long as I could. I cleared up everything else, and I had no choice but to stare my arch-nemesis directly in the face: performance. "Yikes", I murmured to myself, trembling. There were so many controls on my page, there were so many domain object getting loaded, the task of finding the offending performance hog seemed to be a huge undertaking. I fretted, I greived, and then I pulled myself out of my self-pity mode and came up with a plan.
From the good old days of .net Beta, when stepping through code without running into environment hang ups was only a distant fantasy, I remember my friend, Trace. So I set Trace=True in my aspx file, and went to town adding Trace.Write lines to my code. I began to get excited as I awaited my first trace output. I could envision the lines I would see, tellling me the expanded time that each snippet of my code began and ended execution. Lo and behold, when I saw the first Trace output, my troubles were over. I saw the offending control was something leftover from pre-version one of my form. This slow control was loading up over 50 times. I slashed the control from my code, and my page now loads about 60 times faster. Hooray! I have defeated the performance tyrant. So, in appreciation of Trace's beautiful output, I have decided to write an Ode...
Ode to Trace
Before I used you, the performance of my page was a disgrace
Rather than troubleshoot, I would have preferred an eye full of mace
As my hour of deployment drew near, I was in a time-race
When, in a flash of brillance (okay, that may be arguable) I turned on Trace.
Seriously, maybe everyone else in the developement community is using Trace all of the time. I had forgotten about it, and I am SO GLAD I remembered to use it today :)
From the good old days of .net Beta, when stepping through code without running into environment hang ups was only a distant fantasy, I remember my friend, Trace. So I set Trace=True in my aspx file, and went to town adding Trace.Write lines to my code. I began to get excited as I awaited my first trace output. I could envision the lines I would see, tellling me the expanded time that each snippet of my code began and ended execution. Lo and behold, when I saw the first Trace output, my troubles were over. I saw the offending control was something leftover from pre-version one of my form. This slow control was loading up over 50 times. I slashed the control from my code, and my page now loads about 60 times faster. Hooray! I have defeated the performance tyrant. So, in appreciation of Trace's beautiful output, I have decided to write an Ode...
Ode to Trace
Before I used you, the performance of my page was a disgrace
Rather than troubleshoot, I would have preferred an eye full of mace
As my hour of deployment drew near, I was in a time-race
When, in a flash of brillance (okay, that may be arguable) I turned on Trace.
Seriously, maybe everyone else in the developement community is using Trace all of the time. I had forgotten about it, and I am SO GLAD I remembered to use it today :)
Tuesday, February 15, 2005
To GAC or not to GAC, that is the question...
In a project with which I am involved, we have a .dll that holds common web controls. This .dll is shared by multiple web applications, however they all reside on the same server. Originally, when this .dll was shared by two web applications, we had both web projects in one solution and used project references. Then, when we deploy, we can just XCOPY the web applications’ files and bin folder. Viola.
Now we have some SharePoint sites that we want to share the common web controls. We can follow our previous architecture, and add the team sites to our solution and use project references. We can also create a new solution for the team sites, but add the existing controls project from SourceSafe to our new solution. In the latter scenario, we would have one master copy of the controls project in source safe.
However, I am not thrilled with the prospect of using XCOPY to create another bunch of instances of the controls .dll on the web server. I see an advantage that when one of our web applications goes live, we won’t have to worry about future changes to the controls .dll affecting our live web application. Having multiple copies of the same .dll on the same web server seems like a worse idea when I consider what we have to do through to address a bug fix or try to upgrade something, especially if we end up with different versions of the controls .dll in each web application’s bin folder.
I was noodling this issue and thought, “Hey, why not use the GAC? The end of .dll hell!”. All of the web applications will be on the same web server, and the GAC was created for just that purpose, right? I can still opt to have multiple versions of the controls .dll in the GAC if I so choose, or I can keep one version and have only one place to maintain it.
I have used the GAC in the past when dealing with a WinForms application, and after the initial set up, things went swell. Our team did create a utility to rebuild our GAC .dlls out of SourceSafe on demand, and we also agreed on a local structure where we published our debug .dlls so we could share each other’s projects without any headaches. We completely abandoned project references all together. There was some overhead, but I never had to restart VisualStudio because "a reference is being used by another process."
In my current situation, I am a little hesitant to use the GAC because I know that if one of the web applications gets moved to another web server, things will break. I have also read some articles where people have had trouble with strong naming and signing their assemblies. I know that changing course now will also require overhead to set it up so my teammates and I are able to work on the same projects without stepping on each other’s toes, and without requiring a manual copy of new versions of .dlls from SourceSafe to our local GACs. Putting our assemblies in the GAC will also make it difficult for another member of my company to quickly get my solution from SourceSafe and be able to compile and run my code (like our graphic designer). They would have to run an install or manually register the required .dlls to the GAC before their code would compile.
I am also still not crazy about the many versions of one .dll on the same web server, just asking to be out of synch with each other. And how will we manage which version is being used on each web application when we will keep one copy in SourceSafe?
I am undecided what to do. Do you have any experience, positive or negative, with using the GAC for web deployments? What would you do in this situation?
Now we have some SharePoint sites that we want to share the common web controls. We can follow our previous architecture, and add the team sites to our solution and use project references. We can also create a new solution for the team sites, but add the existing controls project from SourceSafe to our new solution. In the latter scenario, we would have one master copy of the controls project in source safe.
However, I am not thrilled with the prospect of using XCOPY to create another bunch of instances of the controls .dll on the web server. I see an advantage that when one of our web applications goes live, we won’t have to worry about future changes to the controls .dll affecting our live web application. Having multiple copies of the same .dll on the same web server seems like a worse idea when I consider what we have to do through to address a bug fix or try to upgrade something, especially if we end up with different versions of the controls .dll in each web application’s bin folder.
I was noodling this issue and thought, “Hey, why not use the GAC? The end of .dll hell!”. All of the web applications will be on the same web server, and the GAC was created for just that purpose, right? I can still opt to have multiple versions of the controls .dll in the GAC if I so choose, or I can keep one version and have only one place to maintain it.
I have used the GAC in the past when dealing with a WinForms application, and after the initial set up, things went swell. Our team did create a utility to rebuild our GAC .dlls out of SourceSafe on demand, and we also agreed on a local structure where we published our debug .dlls so we could share each other’s projects without any headaches. We completely abandoned project references all together. There was some overhead, but I never had to restart VisualStudio because "a reference is being used by another process."
In my current situation, I am a little hesitant to use the GAC because I know that if one of the web applications gets moved to another web server, things will break. I have also read some articles where people have had trouble with strong naming and signing their assemblies. I know that changing course now will also require overhead to set it up so my teammates and I are able to work on the same projects without stepping on each other’s toes, and without requiring a manual copy of new versions of .dlls from SourceSafe to our local GACs. Putting our assemblies in the GAC will also make it difficult for another member of my company to quickly get my solution from SourceSafe and be able to compile and run my code (like our graphic designer). They would have to run an install or manually register the required .dlls to the GAC before their code would compile.
I am also still not crazy about the many versions of one .dll on the same web server, just asking to be out of synch with each other. And how will we manage which version is being used on each web application when we will keep one copy in SourceSafe?
I am undecided what to do. Do you have any experience, positive or negative, with using the GAC for web deployments? What would you do in this situation?
Monday, January 31, 2005
DateDiff in C#
This post will probably only matter to those of us who have VB roots, which I get no end of heckling from my co-workers about. But as I was working today, one of the things I had to do was calculate the span between two dates in months. Piece of cake, I thought to myself. All I have to do is use the DateDiff and specify months...except where is DateDiff in C#??? It is AWOL!
So I tried to see what else I could come up with. I did uncover this thing called System.Timespan. Apparently, Timespan will give you the difference between two DateTimes in something called 'ticks.' You can then take the ticks, and convert them to days, hours, minutes, seconds, and milliseconds. The drawback is that if you want the difference in years or months, you have to do some hoaky manual calculation that may or may not jibe with what the span really should come out to. In my research, this was the best example of how to duplicate the DateDiff in C#.
So I tried to see what else I could come up with. I did uncover this thing called System.Timespan. Apparently, Timespan will give you the difference between two DateTimes in something called 'ticks.' You can then take the ticks, and convert them to days, hours, minutes, seconds, and milliseconds. The drawback is that if you want the difference in years or months, you have to do some hoaky manual calculation that may or may not jibe with what the span really should come out to. In my research, this was the best example of how to duplicate the DateDiff in C#.
Thursday, January 27, 2005
Estimates...Need I Say More?
It’s been one of those projects. I was the one who estimated it, so how can I complain when it takes me the majority of my estimate just to figure out what it is that the specification documents is really trying to tell me to do? How can I push back that it is a change for me to be able to understand the bits and pieces of detail that don’t fit together in any logical fashion? The answer is I cannot. So that is why I have been not posting lately and instead have been working as hard as I can to meet my deadlines, even when it means extra hours that I do not bill to the project.
I have a friend, Avonelle, who is an independent. She has a very different way of dealing with estimates. Instead of giving an estimate to her client and tracking her actual hours versus her estimated time so she can bill hourly, she assigns a “value” to her projects, and bills the “value.” Although she creates an estimate to help her decide what the value should be, the actual number of hours she works is immaterial. She is encouraged to be efficient with her time since her “hourly rate” decreases with every additional hour she has to put into the project. It is still in her best interest to deliver quality solutions to her clients if she wants repeat business, so her client should not suffer for Avonelle’s efficient use of time or cutting of corners.
I wonder if a large consulting company could ever take this approach to billing clients…
I have a friend, Avonelle, who is an independent. She has a very different way of dealing with estimates. Instead of giving an estimate to her client and tracking her actual hours versus her estimated time so she can bill hourly, she assigns a “value” to her projects, and bills the “value.” Although she creates an estimate to help her decide what the value should be, the actual number of hours she works is immaterial. She is encouraged to be efficient with her time since her “hourly rate” decreases with every additional hour she has to put into the project. It is still in her best interest to deliver quality solutions to her clients if she wants repeat business, so her client should not suffer for Avonelle’s efficient use of time or cutting of corners.
I wonder if a large consulting company could ever take this approach to billing clients…
Thursday, January 06, 2005
Microsoft Certification Tests
I am working on my MCSD.Net for C#. I have my MCSD for Visual Studio 6.0 and VB. I have been casually working on my certification for over 6 months. I got my first MCSD certification when I was fairly new to the field, and being certified seemed to be a very important marketing tool for a rookie. This time around, I am just having a hard time getting excited about studying and taking the tests.
I have taken and passed two tests so far. The first test I took was the 70-316 exam - Developing and Implementing Windows-based Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET. The second test I took was the 70-320 exam - Developing XML Web Services and Server Components with Microsoft Visual C# and the Microsoft .NET Framework. Why I didn't take exam 70-315 immediately after exam 70-316, I will never know. The two exams overlap quite a bit, and now I am going to have to re-memorize all of the facts on the test.
Anyway, I passed the web service test and I have never written or consumed a production web service. I would like to. I played with web services in my studying, and felt that I did learn a lot while studying for that test. But do I know enough to be certified in web services? Maybe, I guess.
I had to study just as hard for the Windows test. I have been involved in many WinForms .Net projects in my career. I have been involved in an enterprise-level implementation of a WinForms application. In this implementation, we integrated with Office 2003. We also built a build helper to go out and crawl Visual Source Safe for us to make it easier for our three-man project team to coordinate efforts without stepping on each other's toes or having to wait for one another. It was a cool project.
So here is what I struggle with. I should have been able to quickly and easily pass a certification test on .Net WinForms with minimal studying. I should have had to pour over the Microsoft Web Services information in MSDN and done a painstaking number of hours of work to be up to snuff enough on web services in order to become certified.
But the truth of the matter is, I had to study an equal amount of time for each test. I also found each test to be very silly in the minute details that I was tested on rather than being tested on everyday uses of Visual Studio and on the far-reaching implications that your architectural decision could make. For example, there was not one question on best practices for organizing your classes in a project. There was not one question on best practices for using coding standards, commenting your code, or having project-wide standards for the user interface design. Not once was I asked about what I should do as a developer to prevent cast errors when I am trying to persist data to a database with a field type of smalldatetime. I was not asked when validation should be used, and why. I was not asked what are the best practices for creating a usable menu structure in my application.
I was asked questions about how to set up a connection string. How many of you out there know the syntax for a connection string by heart? All I have to do in the field to figure that one out is open up google.com. But I can't use google to show me how to organize my code in a manner that will make it the easiest to refactor and maintain. So why doesn't Microsoft test us on these things?
I guess my concern is that certifications mean very little if an inexperienced person who picks up a book and memorized a few facts has the same chance of passing the tests as someone who has been studying software engineering and implementing enterprise solutions, using Microsoft tools, for years.
Is it meaningful to be certified? Is it merely a marketing tool that we can use to make us look like more bona fide professionals when seeking out clients? And how could Microsoft build more meaningful questions into their exams so that skills other than syntax memorization are tested?
I have taken and passed two tests so far. The first test I took was the 70-316 exam - Developing and Implementing Windows-based Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET. The second test I took was the 70-320 exam - Developing XML Web Services and Server Components with Microsoft Visual C# and the Microsoft .NET Framework. Why I didn't take exam 70-315 immediately after exam 70-316, I will never know. The two exams overlap quite a bit, and now I am going to have to re-memorize all of the facts on the test.
Anyway, I passed the web service test and I have never written or consumed a production web service. I would like to. I played with web services in my studying, and felt that I did learn a lot while studying for that test. But do I know enough to be certified in web services? Maybe, I guess.
I had to study just as hard for the Windows test. I have been involved in many WinForms .Net projects in my career. I have been involved in an enterprise-level implementation of a WinForms application. In this implementation, we integrated with Office 2003. We also built a build helper to go out and crawl Visual Source Safe for us to make it easier for our three-man project team to coordinate efforts without stepping on each other's toes or having to wait for one another. It was a cool project.
So here is what I struggle with. I should have been able to quickly and easily pass a certification test on .Net WinForms with minimal studying. I should have had to pour over the Microsoft Web Services information in MSDN and done a painstaking number of hours of work to be up to snuff enough on web services in order to become certified.
But the truth of the matter is, I had to study an equal amount of time for each test. I also found each test to be very silly in the minute details that I was tested on rather than being tested on everyday uses of Visual Studio and on the far-reaching implications that your architectural decision could make. For example, there was not one question on best practices for organizing your classes in a project. There was not one question on best practices for using coding standards, commenting your code, or having project-wide standards for the user interface design. Not once was I asked about what I should do as a developer to prevent cast errors when I am trying to persist data to a database with a field type of smalldatetime. I was not asked when validation should be used, and why. I was not asked what are the best practices for creating a usable menu structure in my application.
I was asked questions about how to set up a connection string. How many of you out there know the syntax for a connection string by heart? All I have to do in the field to figure that one out is open up google.com. But I can't use google to show me how to organize my code in a manner that will make it the easiest to refactor and maintain. So why doesn't Microsoft test us on these things?
I guess my concern is that certifications mean very little if an inexperienced person who picks up a book and memorized a few facts has the same chance of passing the tests as someone who has been studying software engineering and implementing enterprise solutions, using Microsoft tools, for years.
Is it meaningful to be certified? Is it merely a marketing tool that we can use to make us look like more bona fide professionals when seeking out clients? And how could Microsoft build more meaningful questions into their exams so that skills other than syntax memorization are tested?
Wednesday, January 05, 2005
One to One Relationships
After many weeks, I am back with a question for you all. How do you feel is the best way to handle a one-to-zero or one relationship in a database? Let me explain what I mean.
First, I feel that there are two scenarios where a one-to-zero or one relationship applies. The first example represents two distinct objects, such as an employee and a computer, where a business rule states that one employee cannot have more than one computer, and one computer can only belong to one employee. I would probably argue that in time, this will turn out to be a false business rule, as when one employee leaves, the computer is assigned to another employee. Or when the computer dies, the employee gets another one. But for now, lets just pretend that the one-to-zero or one applies here. I think it makes sense for there to be an employee table and a computer table. Each table would have its own primary key, and lets just assume that they key is an auto-incremented identity. How should the tables be related? Should we add an EmployeeID field to the Computer table? Or should we add a ComputerID field to the Employee table? Here, it really shouldn't matter. We might choose to put the ComputerID in the Employee table because we feel that "employee has a computer" makes more sense than "computer has employee." Either way, it shouldn't really matter, though.
But how about in the second situation where we have a one-to-zero or one relationship to represent a supertype/subtype relationship? For example, we have a supertype of Individual with subtypes of Employee, Contact, and Owner. The Individual table has fields for the first name, middle name, last name, address, phone number, SSN, and there is an auto-incremented identity column which holds the IndividualID. Let's assume that the Employee table has fields for the employee number, title, related department, hire date, start date, and end date. The Contact and Owner table also have unique field in them. So how do we relate the Employee table to the Individual table? How do we represent the "Employee is an Individual" relationship in the database?
I have seen this handled in two ways. First, we could have the primary key of the employee table be the IndividualID. This is also a foreign key to the Individual table. So the IndividualID would exist as the primary key of four tables, the Individual table, the Employee table, the Contact table, and the Owner table. In the Individual table, Employee table, and Contact table, the IndividualID would also be a foreign key to the Individual table.
Or, we could have the primary key of the Employee table be an auto-incremented identity field called EmployeeID. We could then store this ID as a foreign key in the Individual table. So the Individual table would end up with three foreign keys, the EmployeeID, ContactID, and OwnerID. Each of these fields would allow null, and only one field should contain a non-null value.
Which solution is the better one?
First, I feel that there are two scenarios where a one-to-zero or one relationship applies. The first example represents two distinct objects, such as an employee and a computer, where a business rule states that one employee cannot have more than one computer, and one computer can only belong to one employee. I would probably argue that in time, this will turn out to be a false business rule, as when one employee leaves, the computer is assigned to another employee. Or when the computer dies, the employee gets another one. But for now, lets just pretend that the one-to-zero or one applies here. I think it makes sense for there to be an employee table and a computer table. Each table would have its own primary key, and lets just assume that they key is an auto-incremented identity. How should the tables be related? Should we add an EmployeeID field to the Computer table? Or should we add a ComputerID field to the Employee table? Here, it really shouldn't matter. We might choose to put the ComputerID in the Employee table because we feel that "employee has a computer" makes more sense than "computer has employee." Either way, it shouldn't really matter, though.
But how about in the second situation where we have a one-to-zero or one relationship to represent a supertype/subtype relationship? For example, we have a supertype of Individual with subtypes of Employee, Contact, and Owner. The Individual table has fields for the first name, middle name, last name, address, phone number, SSN, and there is an auto-incremented identity column which holds the IndividualID. Let's assume that the Employee table has fields for the employee number, title, related department, hire date, start date, and end date. The Contact and Owner table also have unique field in them. So how do we relate the Employee table to the Individual table? How do we represent the "Employee is an Individual" relationship in the database?
I have seen this handled in two ways. First, we could have the primary key of the employee table be the IndividualID. This is also a foreign key to the Individual table. So the IndividualID would exist as the primary key of four tables, the Individual table, the Employee table, the Contact table, and the Owner table. In the Individual table, Employee table, and Contact table, the IndividualID would also be a foreign key to the Individual table.
Or, we could have the primary key of the Employee table be an auto-incremented identity field called EmployeeID. We could then store this ID as a foreign key in the Individual table. So the Individual table would end up with three foreign keys, the EmployeeID, ContactID, and OwnerID. Each of these fields would allow null, and only one field should contain a non-null value.
Which solution is the better one?
Tuesday, December 14, 2004
Gemini Update
I have downloaded Gemini, and I am playing with it. While it is free, there is a fee if you deploy to a web server, which I would definately do. The fee is so small that I think I could round up support internally. I have not had much of a chance to play with Gemini, as I have had to deploy a couple of different project this week, but there is one thing about Gemini that I absolutely love. When you install Gemini, you are walked through the virtual directory and SQL Server install. I love that the data driving my issue tracking system is available in SQL Server, in an open way, for me to browse and play around with. I love that I could easily create my own SQL Server Reporting Services customs reports for my issues without worrying about installing some crazy driver to get at my data.
Monday, December 06, 2004
Issue Tracking
A colleage of mine asked me how I felt about issue tracking at my current company. I have had some past experience with issue tracking. I have worked with a custom issue tracking web interface that had a nice roll-up of some issue statistics by project and user-type. There was no email notification built in, but you could view issues across projects easily.
I have had some experience working with Mercury Test Director. SWAT worked with my project team on my last project, and they recommended Mercury. On that project, we even had automated tests (although I am still not sure what percentage of our test cases ended up as automated tests). I thought Mercury was okay, but for that project we did not use the web version of issue tracking, and I thought it was a real bugger noting my issues in notepad until I got into the office the next day.
My current project is using the issue list in SharePoint as our issue tracking. While this solution is a good enough solution, it would be nice if my fellow team members could see all of thier issues at once from multiple projects. Sure, we could have set up one wss team site to handle all issues, but I don't think SharePoint security would effectively manage who can add issues to which project and who can see which issues, and so on.
So for a smaller consulting company, what is the best solution to issue tracking? I am not sure the complexity of Mercury would be a good fit (or the price tag). SharePoint really isn't meant for full-fledged issue tracking for a corporation. A custom solution would be fun to build, but I am not sure the amount of time we would have to invest would be worth it.
I did a little research, and although I am often annoyed at the lack of pricing information on product sites, here are some that look interesting:
I have had some experience working with Mercury Test Director. SWAT worked with my project team on my last project, and they recommended Mercury. On that project, we even had automated tests (although I am still not sure what percentage of our test cases ended up as automated tests). I thought Mercury was okay, but for that project we did not use the web version of issue tracking, and I thought it was a real bugger noting my issues in notepad until I got into the office the next day.
My current project is using the issue list in SharePoint as our issue tracking. While this solution is a good enough solution, it would be nice if my fellow team members could see all of thier issues at once from multiple projects. Sure, we could have set up one wss team site to handle all issues, but I don't think SharePoint security would effectively manage who can add issues to which project and who can see which issues, and so on.
So for a smaller consulting company, what is the best solution to issue tracking? I am not sure the complexity of Mercury would be a good fit (or the price tag). SharePoint really isn't meant for full-fledged issue tracking for a corporation. A custom solution would be fun to build, but I am not sure the amount of time we would have to invest would be worth it.
I did a little research, and although I am often annoyed at the lack of pricing information on product sites, here are some that look interesting:
So have you used any of these tools? Anybody have any reviews to contribute or any other tools to add?
BTW - Thanks to David Hayden for his blog posting about Gemini. I ran into a bunch of open source issue tracking tools (like Bugzilla), but had trouble finding a free .Net issue tracking tool.
Tuesday, November 30, 2004
ORM Instead Of ER?
I have been playing around with ORM for my modeling. I really like the simplicity of the model. I have the misfortune of relying on Visio for my modeling tool, but it isn't so bad. I do not have all of the ins and outs of the ORM down, and I am not sure I dig having to create an object for each attribute and labeling it as a value. I have been struggling with reverse engineering this model into SQL Server, too. I have not succesfully tagged my entities as tables.
So has anyone else used ORM instead of an ER diagram for database design? What do you think about ORM? Will you leave ER diagrams in the dust?
So has anyone else used ORM instead of an ER diagram for database design? What do you think about ORM? Will you leave ER diagrams in the dust?
Monday, November 29, 2004
Free Market
My previous post brought up an interesting, and hopefully not overly discussed, conversation topic: outsourcing software engineering to India.
This topic has been hot for the past number of years, and I think I fall in the minority when I say that I am not against outsourcing to India if the market in India can produce the same quality software products that are being produced here at a fraction of the cost.
I am not saying that I hope to have my job outsourced to India. What I am saying is that in a world where I believe in free markets, when competing for business, the company that can offer a product or service of equitable quality at the lowest price should win the business.
If I am unable to compete with the engineers from India, should I be angry with disloyal American companies who outsourcing? If my salary is much higher here than it would be were I living in India, should I fight for laws to prevent money from flowing out of our economy and into another? As a local consultant, am I offering services that can be easily replaced with foreign labor? Should I, instead of trying to stop open competition, figure out a way to offer a service to US companies that cannot be outsourced?
And if the implementation of a design spec can be outsourced, can the initial analysis also be outsourced? How about the project management? Are there things that we, as software engineers living in the United States, can offer that cannot be outsourced? Should we, as an engineering community, focus on growing our unique skills and ensuring our place in the world market?
So the question is this: can India offer the same quality software end-product that a local consulting company can offer at a lower price? I am leery of the possibility because on the projects in which I work, constant communication with my customer is paramount to success. I wonder how the communication barrier is overcome when dealing with an implementation team that lives in another culture. I am curious if anyone out there has experiences, good or bad, with outsourcing software engineering to India.
This topic has been hot for the past number of years, and I think I fall in the minority when I say that I am not against outsourcing to India if the market in India can produce the same quality software products that are being produced here at a fraction of the cost.
I am not saying that I hope to have my job outsourced to India. What I am saying is that in a world where I believe in free markets, when competing for business, the company that can offer a product or service of equitable quality at the lowest price should win the business.
If I am unable to compete with the engineers from India, should I be angry with disloyal American companies who outsourcing? If my salary is much higher here than it would be were I living in India, should I fight for laws to prevent money from flowing out of our economy and into another? As a local consultant, am I offering services that can be easily replaced with foreign labor? Should I, instead of trying to stop open competition, figure out a way to offer a service to US companies that cannot be outsourced?
And if the implementation of a design spec can be outsourced, can the initial analysis also be outsourced? How about the project management? Are there things that we, as software engineers living in the United States, can offer that cannot be outsourced? Should we, as an engineering community, focus on growing our unique skills and ensuring our place in the world market?
So the question is this: can India offer the same quality software end-product that a local consulting company can offer at a lower price? I am leery of the possibility because on the projects in which I work, constant communication with my customer is paramount to success. I wonder how the communication barrier is overcome when dealing with an implementation team that lives in another culture. I am curious if anyone out there has experiences, good or bad, with outsourcing software engineering to India.
Monday, November 22, 2004
What's in a Title?
I work for a consulting company. I have worked for consulting companies for over five years now. I am not sure what my title is, and I am not sure I care. It seems that when I am needed to do analysis work, I become a Business Analyst. When I am needed to design a database, I become a Database Administrator. When I am needed to lay out the foundation for a project, I become an Architect. I like this about consulting. As a result, I am not sure of one title that could fit my job. I am also not sure that it matters what my official title is.
I have heard of companies that use titles in lieu of paying their talent well. "We cannot afford a large raise for you this year, but how about we give you this fancy title of 'Senior What-a-ma-bob'." So what is the point of a title? Do titles help define our skill set? Do titles help communicate our level of excellence? Or are titles a way for management to placate us into feeling important without giving us monetary reward? What if we did away with titles all together?
I have heard of companies that use titles in lieu of paying their talent well. "We cannot afford a large raise for you this year, but how about we give you this fancy title of 'Senior What-a-ma-bob'." So what is the point of a title? Do titles help define our skill set? Do titles help communicate our level of excellence? Or are titles a way for management to placate us into feeling important without giving us monetary reward? What if we did away with titles all together?
Wednesday, November 17, 2004
Agile Methods vs. the Waterfall Method
I was taught about many different approaches to the software life cycle while I was in college. The waterfall approach to software projects was seen as the wisest way to go, since this approach addressed the concern that a change made at any phase of the life cycle ought to also affect previous phases’ documentation and testing. One of the last courses I took at school included a section that quickly covered agile approaches. In my great enthusiasm over these new ideas, I went to work and shared my enthusiasm with my co-workers. Wouldn’t it be great if we could skip over the weighty documentation phases and start producing a working solution while the business needs are still fresh in our minds? Wouldn’t it be great to work closely with other team members to help each other proof our architectures and brainstorm complex issues as they arise and before struggling alone? My co-workers laughed at my naïve enthusiasm. Who want to sit next to someone else and watch while they code all day? In our profession of high intellect and large egos, who wants to be dragged down by being forced to pair up? How can we start to build a solution before every detail of the problem is fully defined?
As some years have passed, or maybe as my employer has changed, the agile methods have really seemed to catch on. Iterative approached are being tested, and in my experience they are successful. I do not claim to be a guru on agile methods, and I do not claim to know the ins and outs of SCRUM versus Extreme Programming. But what is the key difference between the agile methods versus the traditional methods to software engineering?
I think the difference can be summed up in one word: communication.
While communication has always been an important part of software engineering, I fell that the traditional approaches encourage us to lay everything on the table from the start. Go through a phase of requirements gathering. Go through a phase of specification writing. Go through a phase of writing a detailed design document. Finally, build what you planned. Plan your work and work you plan, right?
I say wrong! To me, the key to the success of the agile projects I have worked with lay our ability as a development team to admit that we cannot ask all of the questions up front. Besides the fact that requirements change with time, so does our understanding of the business problems. And I have never seen a requirements document that is not laden with holes and ambiguities. A small detail missed in the requirements phase can be the downfall of the entire project.
Agile methods appreciate this risk and mitigate it through constant communication. There is no one phase where meetings are held with the end users. The end users are involved in meetings with the development team throughout the life of the project. The end users are part of the team and play an active role in communicating with the development team and working with the seeds of the end product from its infancy to its completion.
As a result of my experiences, I hope to never spend a year working on a functional specification again. I hope to never face another deployment phase of a project that follows a year of closed-door development. I hope to say goodbye to the waterfall approach once and for all and hello to agile development.
As some years have passed, or maybe as my employer has changed, the agile methods have really seemed to catch on. Iterative approached are being tested, and in my experience they are successful. I do not claim to be a guru on agile methods, and I do not claim to know the ins and outs of SCRUM versus Extreme Programming. But what is the key difference between the agile methods versus the traditional methods to software engineering?
I think the difference can be summed up in one word: communication.
While communication has always been an important part of software engineering, I fell that the traditional approaches encourage us to lay everything on the table from the start. Go through a phase of requirements gathering. Go through a phase of specification writing. Go through a phase of writing a detailed design document. Finally, build what you planned. Plan your work and work you plan, right?
I say wrong! To me, the key to the success of the agile projects I have worked with lay our ability as a development team to admit that we cannot ask all of the questions up front. Besides the fact that requirements change with time, so does our understanding of the business problems. And I have never seen a requirements document that is not laden with holes and ambiguities. A small detail missed in the requirements phase can be the downfall of the entire project.
Agile methods appreciate this risk and mitigate it through constant communication. There is no one phase where meetings are held with the end users. The end users are involved in meetings with the development team throughout the life of the project. The end users are part of the team and play an active role in communicating with the development team and working with the seeds of the end product from its infancy to its completion.
As a result of my experiences, I hope to never spend a year working on a functional specification again. I hope to never face another deployment phase of a project that follows a year of closed-door development. I hope to say goodbye to the waterfall approach once and for all and hello to agile development.
Wednesday, November 10, 2004
Education?
A question was posed to me asking how much education I expect a software engineer to have before I would consider hiring them. I don't like questions like this one, because it begs for a general answer to a question that I think deserves more careful scrutiny. I am not a fan of hard and fast rules for anything in life. Place two candidates in front of me, and the person with the formal education does not necessarily beat the high-school graduate in intelligence or skill.
While I do believe that education is important, I believe that education can come in the form of reading books, working, traveling, and just living life in general. Albert Einstein was a high school drop-out (okay, later in life he squeeked his way past earning a degree) who wrote his amazing papers without any academic instruction while working as a patent clerk. He hated the rigid structure of the classroom setting.
So in my estimation, a person's worth should be measured by their ability to present themselves, by their passion, and basically by their performance rather than by a piece of paper signifying their diligence to show up to and pass college level courses. Don't get me wrong, you can get a lot out of college. You can also get very little.
While I do believe that education is important, I believe that education can come in the form of reading books, working, traveling, and just living life in general. Albert Einstein was a high school drop-out (okay, later in life he squeeked his way past earning a degree) who wrote his amazing papers without any academic instruction while working as a patent clerk. He hated the rigid structure of the classroom setting.
So in my estimation, a person's worth should be measured by their ability to present themselves, by their passion, and basically by their performance rather than by a piece of paper signifying their diligence to show up to and pass college level courses. Don't get me wrong, you can get a lot out of college. You can also get very little.
Visual Studio Solution Files
I have been having problems with Visual Studio. I am running a solution file that has 20 projects. When I try to debug the web project in my solution, I often get an error about a missing assembly. Once I get this error, I have to at least shut down and restart Visual Studio, and often I have to restart my computer to resolve the issue. I did some research and found that there is a known error in Visual Studio when you have both project references and file references in your solution. There is a hot fix, but you have to call Microsoft to get it, and the hot fix sounds pretty unstable.
Has anyone else come across a similar problem? Has anyone installed the hot fix? Has anyone fixed this issue by getting rid of the solution file and only using file references?
Has anyone else come across a similar problem? Has anyone installed the hot fix? Has anyone fixed this issue by getting rid of the solution file and only using file references?
Thursday, November 04, 2004
Visual Designers?
Java Kid talks about visual designers, and asks if people rely on them too much. Here is what I have to say to that…once upon a time people coded on punch cards. I do not have first hand experience with punch cards, but I have heard that they were a treat. They were especially fun if you accidentally entered an O instead of a zero or if the cards got out of order.
When people started programming in DOS instead of using punch cards, I bet some people were up in arms. I wonder if the argument flew around that real engineers did not use DOS. Where is the discipline in DOS? Anybody can write programs in DOS, it takes someone with training and superior intelligence to program on punch cards! Look at all these rag-tag new-fangled youngsters with no experience hopping right in to the development community!
I also have known people who love notepad. All you need to write a good application is a text editor and a compiler, right? Visual Studio is for sissies, and intellisense is for people who are not careful enough to spell correctly when they are typing and for people who don’t already know which assemblies house which classes.
To that, I say bah!
I think that using visual designers fall right along side using intellisense while coding. If intellisense helps you work faster and cleaner, then I don’t buy the argument that we should experience a certain amount of pain in order to be respected as intelligent software engineers. In my opinion, visual designers sometimes come in handy. I use the visual designers when I would otherwise be writing a bunch of repetitive HTML. I can drag a control onto a page and position it with a click. In short, tools such as the visual designer can help me with simple and repetitive tasks and leave me more time to focus on my programming logic.
When people started programming in DOS instead of using punch cards, I bet some people were up in arms. I wonder if the argument flew around that real engineers did not use DOS. Where is the discipline in DOS? Anybody can write programs in DOS, it takes someone with training and superior intelligence to program on punch cards! Look at all these rag-tag new-fangled youngsters with no experience hopping right in to the development community!
I also have known people who love notepad. All you need to write a good application is a text editor and a compiler, right? Visual Studio is for sissies, and intellisense is for people who are not careful enough to spell correctly when they are typing and for people who don’t already know which assemblies house which classes.
To that, I say bah!
I think that using visual designers fall right along side using intellisense while coding. If intellisense helps you work faster and cleaner, then I don’t buy the argument that we should experience a certain amount of pain in order to be respected as intelligent software engineers. In my opinion, visual designers sometimes come in handy. I use the visual designers when I would otherwise be writing a bunch of repetitive HTML. I can drag a control onto a page and position it with a click. In short, tools such as the visual designer can help me with simple and repetitive tasks and leave me more time to focus on my programming logic.
Monday, November 01, 2004
User Acceptance Testing
Back when I started developing, my company followed the good old-fashioned waterfall method. We provided our customers with a rigorous requirements gathering phase, followed up by a design phase. Each phase resulted in a document detailing the findings, often in a numbered format so we could easily refer back to the requirement. There was sign off at the end of each phase, often followed up by a plethora of change orders as the next phase began.
When the design was solidified and approved by the client, the implementation phase was next. Our implementation phase was followed by deployment, and we were paid and the project was wrapped (theortetically) when the client gave us final sign off by agreeing to and walking through the user-acceptance tests to validate that each requirement was met and user interface was bug-free.
Nowadays I find myself working with agile approaches to software development, but I do still find value in client testing. I am not talking about handing the product over to the client and asking them to start using it. I am talking about creating some test scripts to help the users cover each logical path in the application, and building validation testing into the scripts. Since my company does not have a test team, I recently took a stab at writing a test script myself. How do the rest of you do this? Do you rely on the use cases that are created during design as your test scripts? Do you use an automated testing tool alone to test the user interface, or do you use an automated tool in conjunction with user-acceptance testing? Is user-acceptance testing out-dated?
When the design was solidified and approved by the client, the implementation phase was next. Our implementation phase was followed by deployment, and we were paid and the project was wrapped (theortetically) when the client gave us final sign off by agreeing to and walking through the user-acceptance tests to validate that each requirement was met and user interface was bug-free.
Nowadays I find myself working with agile approaches to software development, but I do still find value in client testing. I am not talking about handing the product over to the client and asking them to start using it. I am talking about creating some test scripts to help the users cover each logical path in the application, and building validation testing into the scripts. Since my company does not have a test team, I recently took a stab at writing a test script myself. How do the rest of you do this? Do you rely on the use cases that are created during design as your test scripts? Do you use an automated testing tool alone to test the user interface, or do you use an automated tool in conjunction with user-acceptance testing? Is user-acceptance testing out-dated?
Visual Studio .Net 2.0
What would you like to see in the new version of Visual Studio? The Java Kid points us to a forum where the Microsoft team asks developers to vote on new features.
Subscribe to:
Posts (Atom)