Wednesday, December 19, 2007

Changing CSS having no effect!

In the week just gone by, I received a web app from one of my colleagues who was on medical leave. This was supposed to be a prototype of what I will be developing in the days to come. However, there were many issues with the UI of the site. The color scheme though looked good did not match with the logo of the company and had to be changed.

It took me some time to realize that the CSS file being used was one within the App_Themes folder and not the one outside. I had been making changes to the wrong file, hence the changes I was making were not reflecting. But hang on!! Now I was making changes to the correct file but still I could not see the changes reflecting in the front end. I double checked and was stumped. Just moments ago the changes made to the CSS were reflecting in the UI. What could be the possible reason now?

Somehow I had the feeling that I should refresh the page once(probably because of my experience with Service Desk Customization) and Bingo!!

Now I again I made some changes mainly changing the logo, but again it wasn't reflecting. I refreshed. Nothing!! Now what could be the reason? Thankfully I had a backup of the original CSS file. I compared that with the modified one. I realized what was happening. To work faster I was using the build style option in Visual Web Developer. When you use this a Window opens where you can visually set the CSS properties. I was using this to set the background image to the one I had created. The location of this image was "App_Themes/Theme1/Images/Image1.gif". So what was happening was the in the CSS the same url for the image was getting stored. But as my CSS file was already located at "App_Themes/Theme1/" the correct url for the image should have been "/Images/Image1.gif". I changed the Url and Voila!!

As I had posted earlier, Microsoft is always trying to simplify things by allowing you to code Visually. But this Visual coding style has pitfalls and is a sure source of many bugs in applications. My advice to all is "Be Extra Careful when writing code Visually!"


Thursday, December 13, 2007

About Gathering & Understanding Requirements, and AGILE Development Model

All Software Engineering text books talk about how important it is for a Software Team to understand the requirements that their software will fulfill. So a person who is gathering requirements from the stakeholders needs to really understand what is desired. Requirements gathering is THE most important stage in the SDLC. Yeah, even I was aware that!

But again textual knowledge and practical knowledge are 2 different cups of tea(or coffee if you're an American reader :P ) I never really understood its importance until I myself was developing software. (okay I was customizing something already built, but then again I was developing features to meet the requirements from a certain POV..) My development was basically to do what I was told to do. Never really thought about the requirements!! But when whatever I was told to do wasn't impressing the stakeholders, I was puzzled. My senior used to tell me the requirement and then tell me what should I do to achieve it. But since this wasn't resulting in something which was desired, I was intrigued. The problem wasn't that I was being communicated incorrect information. Rather I would say it was incomplete information. From the point of view of the functionality required I was told only a part. But later as i discovered, what I was being asked to develop was something that would integrate 2 business process to make one complete process. Also whatever solutions were being suggested by my senior would provide the User with functionality that the Business Process demanded but unfortunately, not what the User demanded. Whatever was being developed initially would never be accepted!

The problem here is that nowadays people define the process flow and the requirements based on that(at least whatever I have come across...I am sure things are not so bad in other companies..) But a very important factor is to understand who are the people who will use the software and what could be the features that they want. Unfortunately even in the age of Orkut, companies are failing to recognize the fact that a person who is exposed to easy to use web applications like Orkut will hardly like to use a web-app with a boring interface like Service Desk. They will use it not because they like it but because they have to. And this in my view is a factor that decreases productivity and which will drive Enterprise Applications in the coming years.

Another important aspect is if the Users are aware of whether the requirements they want is something which they will use. Most of the times that may not be the case and the person gathering requirements should question the user at each and every stage of the requirement gathering. A very good example is what I encountered today. The Web App I will be developing in the coming days has a forum feature where anybody can post questions. However only people who are considered SME's in that particular area will be allowed to answer the question!! First of all, why shouldn't I, not being an SME, be allowed to answer. I may know things that the SME might not or I may be able to provide an answer quickly as the SME(s) might be busy with some issues in the production systems. Secondly if the SME is my dear colleague who sits right next to me would I post on a forum or ask directly to him. The forum thing will work if your organization has a large volume of employees. But in this case, I have a hunch that we are building software which will never be used.

Anyway, whatever the case maybe, what I am learning is programming in C# and ASP.NET and hence I am satisfied! Also the AGILE model of development is followed so should be interesting!

More about agile development some other time!! Till then.... Happy Programming!!

Saturday, December 8, 2007

Web Basics

My preparation for the Application Development Foundation Exam of MCTS hasn't been going very well. Mostly because it contains a lot of things which are new to me and I will take some time to understand. However this morning I was just having a look at Web Client Development Exam, and read the first chapter. This was mainly because the contents of the first chapter were interesting and more aligned with what I am doing or will be doing now onwards. Here is just a brief of what I read, and is being posted more as a ready reference for me than anything.

The first thing that is talked about the Web Server and how it has changed from being a simple server returning data(response) to requests by the web browser without any state, to being a complex contraption managing state between web pages, accepting data and responding to it. Also, the growing importance of web browsers with Client Side scripting technologies like AJAX creating new ways of addressing things.

Mostly, it is an introduction about the HTTP or the Hyper Text Transfer Protocol.(I was once dumb enough to think that whatever acronym ended with a P had to be some protocol. Though FTP, HTTP, SMTP, SNMP etc. are all protocols this doesn't necessarily hold true for everything. In an interview once I was asked about OLAP. I was definite that I had heard about it somewhere but answered in the negative. Once outside I was discussing with a friend as to what could OLAP be and came up with Object Layer Access Protocol!! For the uninitiated it is On-Line Analytical Processing.)

It talks about the various HTTP methods like GET, POST, HEAD etc. and also something about Distributed authoring and Versioning or DAV, something built on top of HTTP 1.1 which enables easier web development in a team scenario. I also got to know about the standard codes in HTTP. Remember the 404 Page not Found Error!!

Basically there are 5 Status-Code Groups

4XX when there is error on the browser
5XX When there is an error on the server

HTTP uses MIME types and you should know some of the common MIME types. You also learn a bit about how data is posted back to server, HTTP GET and POST and finally about POST BACK and HTTP debugging!

I am finding this interesting! Might just post some more cool stuff to know about the web!

The New VWD 2008 Express

I wasn't aware that its already out! Yes, Visual Studio 2008 Express Editions were available for download from Monday, 19 Nov, 2007 says the news channel on my newly installed Visual Web Developer 2008 Express. Yeah I installed it last night! Still exploring and will post what I like about it, but in the meantime you can check out Scott Mitchell's review on 4guysfromrolla.

To Install Visual Web Developer 2008 Express, go here

Wednesday, December 5, 2007

A Little About Databases

One of the huge disadvantages of using Microsoft Products I find is that you tend to do things improperly! Let me share with you something I learnt today.

I have installed the SQL Server 2005 Express Edition as the default database to use with Visual Studio for my projects. Working in an Enterprise Software Services Firm I am aware that you have special roles for a database administrator. The DBA will never share the system admin or db admin login credentials with you. For your application to access the database in a safe manner a new user is generally created for you to use! At least in my limited experience that is what I have come to know!

So for my demo project I decided to create a new user and not use the sa login. I named this user dba. When deciding on what would be the default schema of this user I decided on db_owner to avoid any access issues later on. ( My database knowledge is limited to RDBMS concepts, writing Queries, Sp etc. I have never undergone any training or ventured on my own into what one would call the DBA's domain). Using this user I created the tables required for my application. The tables created appear as db_owner.assets.

Now I am using the same user to connect from my app to db. I had no issues in visually building the Connection String which I promptly stored in my web.config file. I had no issues in building TableAdapters with simple SELECT statements as well. However, no I decided to graduate to the next level and create my own Stored Procedures. I try to do this Visually once again but I get a failure message saying the schema dba does not exist or does not have sufficient permissions. OOPS!!

How is that possible? I made dba the db_owner. I check and surely dba still is db_owner. I wonder what could be wrong. Maybe I should try and create the stored procedure from Management Studio Express instead of Visual Studio. Fails again with the same message!

I examine the stored procedure to find "CREATE PROCEDURE dba.assets AS ...". Oh! the schema. When dba created the tables they where created as db_owner.assets. So I expanded the nodes in the Management Studio Express and went to schemas to find that indeed no schema named dba existed. So I created a schema named dba as I saw fit and then tried creating the stored procedure. Voila!

Microsoft assumes a lot of things when it Visually creates anything for you. It sure makes things a lot simple and easy to use but can lead to simple errors like this. If only such an error were to creep up in a production environment!!In this case Microsoft should have taken care that the default schema for dba was db_owner.But that is what software is all about I guess; finding new improvements from time to time.

Friday, November 30, 2007

Value & Reference Types in C#

Sometime in Ocotber when I had started to brush up my concepts about C#, there was a serious doubt in my mind. I was confused as to how were arguments passed in C# and what exactly were value and reference types.

Recently I read an article which is the best I have read so far on this topic. Haven't found anything like that in books also. So if you are confused or just want to revise on the concepts, read this article.

This was really helpful in understanding the concepts which are very important for Certification. I might post some points to remember but you know ... posting also consumes quite a lot of time....!!

Thursday, November 29, 2007

FYI-ASP.NET Resources

Since I was back from vacation I have been trying to build a momentum in my learnings of C#. The internet is as good a source as any but still I have a habit of buying books, even though I may not finish reading it.Recently , I was just at Crossword and stumbled upon the C# Black Book. Ever since I got into programming i have found a Black book at my side always handy. It doesn't necessarily give you the complete concept but the practical examples and real code that you get in the book can serve as a good source for reference. And yeah, without thinking much, I bought it.

I was trying to build a simple web app for inventory management. For this I was using the new membership controls that Microsoft have provided you in ASP.NET 2.0. A very good resource to understand this new feature and indeed almost anything regarding ASP.NET is the site 4guysfromrolla. "When you think ASP, think" No doubts about that! I am already fan of Scott Mitchell,founder of the site. Go through his articles on membership and you will understand why. He has also written a lot of articles on a whole range of features which I am sure will be very useful. After going through his article, I was able to merge the database schema for membership with my own schema of course resolving issues with help from msdn forums.

He has also written about how to build a 3-tier application on msdn. This was something I had been looking for a while and was ecstatic when I read the article. You can read that here.

A lot of things happening at the professional front as well. Hopefully things will sort out for the good.

Tuesday, November 20, 2007

The Break

I was on vacation for quite some time now. But good news is I am back and hopefully rejuvenated to get alive and kicking once again! Gotta buck up! Come on!!

Thursday, October 18, 2007

About Certifications and More....

Without wasting any time I have begun work on C# and how I can add value to myself. Industry recognized certifications is the way ahead! In case you are unaware about certifications, they are proof of your competence. You may be knowing Java but is there a standard way to test your profiency in the language? Yes there is! Sun Microsystems will test you (for a price of course!) and if you pass the test you will get a certificate from Sun saying that you are a Sun Certified Java Programmer or SCJP as it is popularly known. The test is not a cakewalk by any means, though you wouldnt call it very tough as well. Like any other exam, planned preparation will see you through. Many of my friends have cleared it and some with exceptional scores. And like Sun Microsystems there are a whole range of Companies that provide you with options to get certified in their products. Certifications add value to your resume. Of course there is a lot of difference between certification knowledge and working knowledge. However, a combination of both will really make you the expert in that field. That is why many of the certifications in their "Who should appear for the test?" FAQ tell that the ideal candidate would have worked on the technology for about year or so. However many of us in India take the test even though we have no working knowledge of the particular technology/product. I guess we have been brought up like that.

So much do you have to shell out to appear for the exam? Well that varies from exam to exam but the simple programming ones cost you around $50-100. That is about INR 2000-4000. Not too expensive I would say given the salaries that people are getting these days in the IT sector in India. And if you are already working for a company chances are that your company will refund the amount back to you. So that's pretty cool!

Thomson Prometric is the most popular vendor offering tests in various certifications across the globe.

So while I am still in the learning phase of C# and the .NET framework, I will also start preparing for the certifications. That is because if I got to have the edge in the market I must get certified. In the course of the next few posts I will be posting articles about things you should know about C# and the .NET framework that might help you in the certification exam. My first target is to clear the 70-536 Application Development Foundation and then the 70-528 Web Client Development after which I would be a MCTS in Web Application Development. Lets see how this turns out! Godspeed!

To know more about Microsoft Certifications, please go here.
To know more about Sun Certifications, please go here.

Wednesday, October 17, 2007

The Answer

In my previous post I had written about the dilemma I was facing. Well it seems that the dilemma is no more! And the answer is I will be using ASP.NET and Microsoft tools for developing whatever I develop henceforth.

So how did I arrive at such a decision? Firstly, if you have read my previous post, I do have a soft corner for Microsoft Software and Technologies. This is because I have used them before and find it easy to pick up.

Secondly, my work in the new role will revolve around .NET. Hence, the obvious choice seems to be .NET. Through this week I realized that developing a full-blown web-app in any language/technology/platform/framework involves in-depth knowledge. And as I have to work on .NET I might as well use it.

So the decision has been made. Its going to be C# and ASP.NET 2.0 all the way for the next few months.

Also Mr. Bob Tabor's videos I downloaded from msdn tilted the balance towards .NET and Visual Studio. For more about that visit MSDN Beginner Developer

In the posts to follow this, I will post about things that I learn about .NET, probably about how to get certified and other useful things as well.

Wednesday, October 10, 2007

The Dilemma

I am facing a dilemma that many of you would have already faced or will face in the near future. I was planning to get into Web Development completely and had a nice idea for a simple web app. But as I am a beginner I am unaware of the various frameworks/languages/techniques/design patterns using which a robust web application can be made.

My good friend Darshan Santani sent a presentation which compared various options. PHP/Ruby on Rails/Java using Struts/JSF, ASP.NET etc. Each option had its pros and cons and at the end, the presenter had made a very simple conclusion:"The option with which you are at ease is the most suitable."

Having done my final sem project on VB, I am very much used to Visual Studio as an IDE. Though I have explored NetBeans and Eclipse, the ease I find in using Visual Studio is not there. You could say that I am a prisoner of Microsoft Software which has handicapped me in using only Microsoft software. With Microsoft coming out with Express editions of its tools and other software being used by developers like Visual Studio and SQL Server Express editions which are available for free, rookies like me who are used to the Microsoft way of software development can now use the these express editions at no cost. It is as good as Open Source IDE's for Java like Eclipse or NetBeans. So now that I have the express editions to pursue my interests why should I opt for Java? The answer lies in the fact that whatever Microsoft is providing you is only just sufficient for you to learn stuff.

But if you want to do some serious stuff then you will have to shell out a pocketful to get the appropriate software from Microsoft. Impressive strategy I must say! So though I am not into anything really serious at this moment, If I build my competency in .NET then I would have to probably shellout $1000 for just a Windows Server Operating System. Compare that with Ubuntu Server Edition which is FREE and probably is much more secure. But learning Java at this stage means to invest the one resource I am short of - TIME!!

So you are aware of the dilemma now! Any suggestions will be helpful as to what I should do- but at the moment it looks like .NET to me.

Monday, October 8, 2007

Hello World!

The first example that any book on any programming language will give you is that of a program to print "Hello World".

So I have titled this post as Hello World, wishing all you readers a big hello. Welcome to my blog on the technology that I am learning which I want to share with all you people out there.

I am working as a Sofware Engineer in a Software Services Firm catering to the parent company which is a Retail giant in the world. Apart from the work that I do I am generally interested in technology, specially the Internet. Hence I thought it was high time that I started sharing whatever I learn with the world out there. I have greatly benefitted from the numerous blogs and posts by various people and I hope that whatever I post here will be beneficial for someone. I have a busy schedule and might find it difficult to post regularly but I will try my best and hope that this blog does not turn out to be one that is deleted.

People interested in contributing to this blog are invited. Please send me a mail at singh[dot]shashishekhar[at]gmail[dot]com if you are interested in forming a blogging team.