Tuesday, August 11, 2009

Log4net: Logging all the events.

Debugging is not always possible in the production environment. However, there are many exceptions thrown and we intend to see the flow of control using debugging statements.
One of the crude ways to do this is by printing debug statements to console. Little improvised way to do this may to print all the appropriate messages to a specific file.
But what if you want to track who printed that message(whcih object, method,) and you want to capture all the information in an organised way. you want to print a message to sql database or send it as an email. well we are programmers we can easily write code which does that. But think about the nuber of bugs the new code will induce into the project. Think about the number of hours you invest in writing, testing this functionality.
Thanks to open source we have a api which enables us to have this logging functionality in our applications. there are many apis out there but I decided to go with log4net. This is a dotnet version for the famous log4j.
I had a lot of trouble setting it up not that it was complex it was as easy as filliing out a medical school application (just kidding). Trust me it is very easy and there are many examples configuration code readily available for use. There were two methods to configure log4net in my application. One is that i have to write a section in log4net and the other is that I can have a seperate xml for the configuration settings. The current available versions of log4net was not built for 3.5 so I suspect that was the resaon the former method of configuring the application for dotnet was not working, I was getting warnings which I initially ignored. I ran some test log commands and it did not work the text was not created. then I suspected it was some file permissions problem. But when I created a seperate xml file consisting of the settings it all the warning messages disappeared and it worked like a charm.
By using the tested open source products like log4net. I need not worry about the bugs (if it is well tested and matured of course). It will save a lot of time required to develop this functionality.

Tuesday, July 28, 2009

Database design

Ahh my favorite at last!!! I was the sole incharge for the database for all the class projects I have done till date. So I feel very comfortable doing this. This project being a realtime scenario I was required to have more features with regards to security.
The main challenge was to understand the business problem. I was under the perception that the application accounts and server accounts are independent and there are no relation between them. It tuned that if this was taken as an assumption then admin would have to go through a lot of trouble to assign permission to the users. He would have to choose each and every user explicitly to provide them with acess to that account. Otherwise, users can be made into many small groups (user can be in more than one group) and assign groups to access that account. But this was rather clumsy approach. After two days of thinking with help of vinay we found a way of linking the server accounts, console accounts(accounts which will give access to actual application) and the application instance. Each application can have many instances such as development instance, testing instance, etc. so we considered application instance primary entity which is formed of the application name and the instance name. these instances have related accounts to them For example, suppose a siteminder application has a been installed on server1, it will be installed by a certain user. since serveral people must have access to this server account user will usually create a server account on the application name along with the application stage like If i am installing site minder for developers on server 2008 I will create an windows account siteminder_dev(username) and *** password. This password should be shared among all developer users. This account details are called ServerAccountsForApplication. To login the actual application installed on the server. Since it is a secured application I need to have a password and all developers have a user name and password (shared) same scenario as above. These application login details are called ConsoleAccountsForApplication. These both tables mentioned in bold are tied to aplication instance. This relation enabled me to give role based access to the user.

Requirements gathering

The tasks was to gather all the functional requirements. Which was discussed verbally. Since this is a single man show I decided not waste too much time by writing the requirements in a detailed document. I'd rahter use a list fucntional requirments to save time. I have it jotted down in paper which I will be transcribing soon post it here.

Saturday, July 25, 2009

Work breakdown structure

Today I was exposed to a new (actually old) way of planning for a project. Vinay taught me how to use Micrsoft project for making a work break structure. In my own words, wbs is a document in which we list all the tasks during the project life cycle and we use this task list to determine the time required, allocation of resources, precedence of tasks, determination of the shortest path to complete the project. Its helps to breakdown the project into smaller steps, to identify the critical path, to enable us to see the project from a prespective of a project manager.
Microsoft Project 2003 was used to create the wbs. Its an amazing tool. One of the key features is the way it shows the graph in a calender as we type in the tasks and as we assign the number of hours required for each tasks it updates the graph instantanesouly. Well this graph consists of the nodes which are tasks and the background is calender and the length of the tasks represent the time they take in calender. we can also assign the precedence of tasks. which will give the graph a structure. other wise all the tasks are shown in one single time block i.e the project assumes there are unlimited resources avilable to achieve the target and that one task is not dependent on the other. All this aside, to talk in more mathematical terms. Microsoft project will enable us to schedule all the tasks properly and to assign the resources at the critical points which will decrease the congestions and shorten critical path. It helps us to solve one big operation research problem. To increase efficiency. Psycologically speaking having listed down all tasks we can easily keep our goals short and focused. As we see task by task striken off our confidence builds up. Here is my current wbs












Project Start:

Project Finish:
Mon 7/27/09

Thu 9/3/09




Tasks




ID
Task Name
DurationStartFinishResource Names% Complete
1
Password Vault
28.38 daysMon 7/27/09Thu 9/3/09 0%
2
Project Kickoff Phase
0.5 daysMon 7/27/09Mon 7/27/09 0%
3
Identify Stakeholders
0.5 daysMon 7/27/09Mon 7/27/09Developer0%
4
Requirements
2.5 daysMon 7/27/09Wed 7/29/09 0%
5
Conduct Functional Requirment Meeting
4 hrsMon 7/27/09Mon 7/27/09Developer0%
6
Requirment Document
8 hrsTue 7/28/09Tue 7/28/09Developer0%
7
Create Use Cases
8 hrsWed 7/29/09Wed 7/29/09Developer0%
8
Design
9.25 daysThu 7/30/09Wed 8/12/09 0%
9
Identify business entities and relationships
3 hrsThu 7/30/09Thu 7/30/09Developer0%
10
Database schema design
8 hrsThu 7/30/09Fri 7/31/09Developer0%
11
Identifiying business rules
8 hrsTue 8/11/09Wed 8/12/09Developer0%
12
Identifying subsystems
6.88 daysFri 7/31/09Tue 8/11/09 0%
13
Design forms
30 hrsFri 7/31/09Thu 8/6/09Developer0%
14
Information flow diagrams
10 hrsMon 8/10/09Tue 8/11/09Developer0%
15
Screen layout diagrams
15 hrsThu 8/6/09Fri 8/7/09Developer0%
16
Configure Build Test (CBT)
13 daysWed 8/12/09Mon 8/31/09 0%
17
Configure
0.5 daysFri 8/28/09Fri 8/28/09 0%
18
Setting up repository
4 hrsFri 8/28/09Fri 8/28/09Developer0%
19
Build
10.75 daysWed 8/12/09Wed 8/26/09 0%
20
Develop database
2 hrsWed 8/12/09Wed 8/12/09Developer0%
21
Develop Procedures
12 hrsWed 8/12/09Thu 8/13/09Developer0%
22
Build Admin forms
24 hrsThu 8/20/09Mon 8/24/09Developer0%
23
Build Login module
8 hrsTue 8/25/09Tue 8/25/09Developer0%
24
Build User forms
8 hrsWed 8/26/09Wed 8/26/09Developer0%
25
Build Application Forms
32 hrsFri 8/14/09Wed 8/19/09Developer0%
26
Testing
2.25 daysThu 8/27/09Mon 8/31/09 0%
27
Test database Integrity
2 hrsMon 8/31/09Mon 8/31/09Developer0%
28
Test Database Procedures
4 hrsFri 8/28/09Fri 8/28/09Developer0%
29
Test Forms
8 hrsThu 8/27/09Thu 8/27/09Developer0%
30
User Aceptence Testing (UAT)
2 daysMon 8/31/09Wed 9/2/09 0%
31
Testing
16 hrsMon 8/31/09Wed 9/2/09Developer0%
32
Deployment
1.13 daysWed 9/2/09Thu 9/3/09 0%
33
Install database
2 hrsWed 9/2/09Wed 9/2/09Developer0%
34
Create Website
3 hrsWed 9/2/09Wed 9/2/09Developer0%
35
Deploy code
1 hrWed 9/2/09Wed 9/2/09Developer0%
36
Configure database and other runtime settings
3 hrsThu 9/3/09Thu 9/3/09Developer0%



Resources




IDNameGroupMax UnitsPeak Units
1Developer 100%100%



Assignments




Task IDTask NameResource NameWorkStartFinish% Work Complete
3Identify Stakeholders Developer4 hrsMon 7/27/09Mon 7/27/090%
5Conduct Functional Requirment MeetingDeveloper4 hrsMon 7/27/09Mon 7/27/090%
6Requirment DocumentDeveloper8 hrsTue 7/28/09Tue 7/28/090%
7Create Use Cases Developer8 hrsWed 7/29/09Wed 7/29/090%
9Identify business entities and relationshipsDeveloper3 hrsThu 7/30/09Thu 7/30/090%
10Database schema designDeveloper8 hrsThu 7/30/09Fri 7/31/090%
11Identifiying business rulesDeveloper8 hrsTue 8/11/09Wed 8/12/090%
13Design formsDeveloper30 hrsFri 7/31/09Thu 8/6/090%
14Information flow diagramsDeveloper10 hrsMon 8/10/09Tue 8/11/090%
15Screen layout diagramsDeveloper15 hrsThu 8/6/09Fri 8/7/090%
18Setting up repositoryDeveloper4 hrsFri 8/28/09Fri 8/28/090%
20Develop databaseDeveloper2 hrsWed 8/12/09Wed 8/12/090%
21Develop ProceduresDeveloper12 hrsWed 8/12/09Thu 8/13/090%
22Build Admin formsDeveloper24 hrsThu 8/20/09Mon 8/24/090%
23Build Login moduleDeveloper8 hrsTue 8/25/09Tue 8/25/090%
24Build User formsDeveloper8 hrsWed 8/26/09Wed 8/26/090%
25Build Application FormsDeveloper32 hrsFri 8/14/09Wed 8/19/090%
27Test database IntegrityDeveloper2 hrsMon 8/31/09Mon 8/31/090%
28Test Database ProceduresDeveloper4 hrsFri 8/28/09Fri 8/28/090%
29Test FormsDeveloper8 hrsThu 8/27/09Thu 8/27/090%
31TestingDeveloper16 hrsMon 8/31/09Wed 9/2/090%
33Install databaseDeveloper2 hrsWed 9/2/09Wed 9/2/090%
34Create WebsiteDeveloper3 hrsWed 9/2/09Wed 9/2/090%
35Deploy codeDeveloper1 hrWed 9/2/09Wed 9/2/090%
36Configure database and other runtime settingsDeveloper3 hrsThu 9/3/09Thu 9/3/090%






The Business Problem

Few Days ago when I was chatting with my brother on how I wanted to work on a real time project on my own. He told me about a small business problem they were facing in their company and he asked if I could write an application which could solve it.

The Problem is that their company has many applications which are hosted in a number of servers. These account credentials are shared among many users i.e. different users login to the system(application/ server) using a shared user accounts. These accounts expire periodically and they have to be updated. When the update happens it becomes a painful process to send out an email to every one regarding the change.

This was a fairly simple business problem. It can be easily solved by using a central repository of accounts and each user is either given access can or cannot be given access.

But when the project details were sketched out it did not seem as simple s it looks.

Keep reading for more details about the project