Documente Academic
Documente Profesional
Documente Cultură
NET
Projects
By
Shivprasad Koirala
Sham Shaikh
Visit us http://www.questpond.com for free interview question ebook.
The eBook is free but below are the limitation of this free ebook:-
-- The book has only 5 projects which are far less than what the actual book contains.
-- Practical Videos and code walkthrough of the projects is not available for download.
-- The book also has lot of installations provided in CD even that is not available for
Download.
Finally hard copy is a hard copy if you are interested below are the ways you can buy the
book:-
• Buy directly from the Author call 09867628636. If you are buying from the Author
you get a chance to meet him and believe us you will enjoy it. Please send DD of
rupees 300 in favor of ( Please send us detail that you want a hard copy or Ebook
CD)
Shivprasad Bist
E – 8 , Amar Nager , Hoechst Colony , Opposite Shriram towers
Mulund West Mumbai 80.
Page 1 of 215
Ray McLennan, director,Motilal (UK) Books of India,367 High Street.
London Colney,
St.Albans, Hertfordshire,AL2 1EA, U.K.
Tel. +44 (0)1727 761 677,Fax.+44 (0)1727 761
357,info@mlbduk.com,www.mlbduk.com
• mail at bpb@bol.net.in
Prakash books
http://www.prakashbooks.com/details.php3?id=17875&c=Computer Books
Amazon
Page 2 of 215
http://www.amazon.co.uk/NET-Interview-Questions-Shivprasad-
Koirala/dp/8183331475/sr=1-1/qid=1171080126/ref=sr_1_1/026-1891118-
8556445?ie=UTF8&s=books
Prakash books
http://www.prakashbooks.com/details.php3?id=19008&c=Computer Books
Amazon
http://www.amazon.co.uk/exec/obidos/ASIN/8183331033/qid%3D1136610981/026-
1344994-2263615#product-details
Page 3 of 215
You can buy the above book from
Prakash books
http://www.prakashbooks.com/details.php3?id=23073&c=Computer%20Books
http://www.amazon.co.uk/JAVA- interview-Questions-Koirala-
Shivprasad/dp/8183331734/ref=pd_ecc_rvi_2/203-1007750-6035147
Page 4 of 215
Page 5 of 215
Table of Contents
INTRODUCTION...........................................................................................................................................................10
Dedication ................................................................................................................................................................10
Foreword ..................................................................................................................................................................10
About the authors....................................................................................................................................................10
Who should read this book ....................................................................................................................................11
Details of the book ..................................................................................................................................................11
What’s in the CD.....................................................................................................................................................12
PART I – THE FUNDAMENTALS ...........................................................................................................................13
CHAPTER 1 SDLC AND PROJECT DOCUMENTATION.......................................................................................13
What does this book target....................................................................................................................................13
The growth of a software professional................................................................................................................13
SDLC (Software development Life Cycle)..........................................................................................................16
Waterfall................................................................................................................................................................ 17
Iterative model ...................................................................................................................................................... 18
Evolutionary model............................................................................................................................................... 19
V-model ................................................................................................................................................................ 19
Which is the best model? ...................................................................................................................................... 21
Essential documentation in projects....................................................................................................................22
UML...........................................................................................................................................................................22
Three views of the project from UML perspective............................................................................................... 23
Structure diagram .................................................................................................................................................. 23
Behavior diagram .................................................................................................................................................. 24
Model management diagram................................................................................................................................. 24
Overall Explanation of the UML diagrams........................................................................................................... 25
Class diagram ........................................................................................................................................................ 25
Object diagram ...................................................................................................................................................... 25
Composite structure diagram ................................................................................................................................ 25
Deployment diagram............................................................................................................................................. 26
Component diagram .............................................................................................................................................. 26
Package diagram ................................................................................................................................................... 26
Activity diagram ................................................................................................................................................... 26
Use case diagram .................................................................................................................................................. 26
State machine diagram / Protocol state machine diagram .................................................................................... 26
Overview diagram................................................................................................................................................. 26
Sequence diagram ................................................................................................................................................. 26
Communication diagram....................................................................................................................................... 26
Timing diagram..................................................................................................................................................... 26
Which diagram is important.................................................................................................................................. 26
Use case diagram over view.................................................................................................................................. 27
Actors and Goals................................................................................................................................................... 27
Detail Explanation of the Use Case template........................................................................................................ 28
Included and Extended use case............................................................................................................................ 30
Differentiate between Included use case and extended use cases?....................................................................... 32
Class diagram ........................................................................................................................................................ 32
Associations in Class diagrams ............................................................................................................................. 32
Multiplicity............................................................................................................................................................ 33
Aggregation and composition............................................................................................................................... 34
Composite structure diagram ................................................................................................................................ 35
Reflexive associations........................................................................................................................................... 36
Generalization and specialization ......................................................................................................................... 36
Estimation in projects............................................................................................................................................ 37
Introduction to Function Points............................................................................................................................. 37
Basics of Function Points...................................................................................................................................... 38
Application Boundary........................................................................................................................................... 38
Page 6 of 215
Elementary Process............................................................................................................................................... 38
Dynamic and static elementary process................................................................................................................ 39
Elements of Function Points ................................................................................................................................. 39
Internal Logical Files (ILF)................................................................................................................................... 39
External Interface File (EIF) ................................................................................................................................. 40
Record Element Type (RET)................................................................................................................................ 40
DET (Data element types)..................................................................................................................................... 41
Data Communications........................................................................................................................................... 43
Distributed data p rocessing................................................................................................................................... 43
Performance .......................................................................................................................................................... 44
Heavily used configuration ................................................................................................................................... 44
On-Line data entry ................................................................................................................................................ 45
End-user efficiency ............................................................................................................................................... 46
On-Line update..................................................................................................................................................... 46
Complex processing.............................................................................................................................................. 47
Reusability ............................................................................................................................................................ 47
Installation ease..................................................................................................................................................... 48
Operational ease.................................................................................................................................................... 48
Multiple sites......................................................................................................................................................... 49
Facilitate change ................................................................................................................................................... 49
Function point template explanation...................................................................................................................63
Testing Document....................................................................................................................................................64
UPDATE ADDRESS....................................................................................................................................................65
CHAPTER 2 OOPS PRIMER ....................................................................................................................................65
Why OOPs................................................................................................................................................................65
Fundamentals of OOPS..........................................................................................................................................66
Abstract classes and Interfaces.............................................................................................................................68
CHAPTER 3 UNDERSTANDING THE IDE..............................................................................................................69
The IDE.....................................................................................................................................................................69
Windows form Code walk through.......................................................................................................................72
The IIS .......................................................................................................................................................................74
Web Application Code walk through...................................................................................................................74
CHAPTER 4 DATABASES AND ADO.NET ............................................................................................................81
MSDE Basics ...........................................................................................................................................................81
Difference between SQL and MSDE....................................................................................................................81
Installation of MSDE..............................................................................................................................................82
Basic SQL Commands............................................................................................................................................85
ADO.NET basics .....................................................................................................................................................86
Introducing the .NET Data Providers .................................................................................................................88
OLE DB.NET data provider..................................................................................................................................88
SQL Server.NET data provider.............................................................................................................................88
ODBC.NET data provider.....................................................................................................................................88
The Command Object.............................................................................................................................................90
The Command Object’s Methods.........................................................................................................................91
Understanding DataReader ..................................................................................................................................93
Understanding Dataset..........................................................................................................................................95
Sample code .............................................................................................................................................................95
Microsoft Data Application blocks......................................................................................................................96
PART II – THE FUN PART.........................................................................................................................................98
INTRODUCTION TO THE FUN PART .......................................................................................................................98
CHAPTER 5 – LETS ROCK: - THE MANDELBROT PROJECT.............................................................................98
What will you learn in this project.......................................................................................................................98
Overview of Mandelbrot project...........................................................................................................................98
How to start the Mandelbrot project................................................................................................................ 100
Code explanation.................................................................................................................................................. 101
CHAPTER 6 – FILE SEARCH MODULE................................................................................................................ 107
What will you learn in this project.................................................................................................................... 107
Page 7 of 215
Overview of File search Application................................................................................................................ 107
Fundamentals to complete the project.............................................................................................................. 108
File System............................................................................................................................................................ 108
Threading Concepts............................................................................................................................................. 109
Delegates and event concept.............................................................................................................................. 111
Class Diagram of File search Application ...................................................................................................... 114
Code Explanation................................................................................................................................................. 115
Enhancement in File Search Project................................................................................................................ 118
PART III – PROFESSIONAL PROJECTS .......................................................................................................... 119
CHAPTER 7 – RELIABLE COMPUTER CHAT APPLICATION.......................................................................... 119
What will you learn in this project.................................................................................................................... 119
Deliverables in CD for this Project .................................................................................................................. 119
Overview of Chat application ............................................................................................................................ 119
How to start the chat application...................................................................................................................... 120
Starters Chat code................................................................................................................................................ 120
Whats wrong with the above code..................................................................................................................... 124
Estimation of the Chat Application................................................................................................................... 125
External Input (EI) explanation......................................................................................................................... 125
External Inquiry (EQ) explanation................................................................................................................... 125
Internal Logical File (ILF) explanation........................................................................................................... 126
Explanation of Total Estimation........................................................................................................................ 127
Use Case ................................................................................................................................................................ 130
Details of the Use Case ....................................................................................................................................... 130
Caching fundamentals in ASP.NET .................................................................................................................. 132
Class diagram....................................................................................................................................................... 133
Code explanation.................................................................................................................................................. 137
Consuming the class library............................................................................................................................... 137
Auto refresh fundamentals.................................................................................................................................. 138
Login page explanation....................................................................................................................................... 139
Login button click logic....................................................................................................................................... 139
Displaying the chat message and the users..................................................................................................... 140
Change room and Send messages..................................................................................................................... 142
CHAPTER 8 – JOB S ITE APPLICATION.............................................................................................................. 143
What will you learn in this project.................................................................................................................... 143
Deliverables in CD for this Project .................................................................................................................. 143
How to load the jobsite....................................................................................................................................... 143
Overview of the Job Site Application................................................................................................................ 148
Estimation of the Job Site Application............................................................................................................. 149
Explanation of ILF ............................................................................................................................................... 149
Explanation of EIF and EO ................................................................................................................................ 149
Explanation for EQ .............................................................................................................................................. 150
Explanation for EI................................................................................................................................................ 150
Explanation for GSC ........................................................................................................................................... 150
Final Estimation................................................................................................................................................... 151
Use Case Explanation ......................................................................................................................................... 152
E-R Diagram Explanation.................................................................................................................................. 157
Architecture Explanation.................................................................................................................................... 159
Class Diagram Explanation............................................................................................................................... 161
Code Explanation................................................................................................................................................. 163
Entity collection relation ship............................................................................................................................ 163
Explanation of clsMenu and clsMenus............................................................................................................. 163
Explanation of the user class ............................................................................................................................. 164
Calling the validation bridge............................................................................................................................. 165
Explanation of the businessvalidation bridge................................................................................................. 165
Explanation of the reflection.............................................................................................................................. 166
Page 8 of 215
Explanation of Validation library..................................................................................................................... 167
Setobject to validate............................................................................................................................................. 168
Explanation of Data access................................................................................................................................ 169
Explanation of UI ................................................................................................................................................. 170
CHAPTER 9 – QUADRA CLIENT W EB SERVICES ............................................................................................ 171
What will you learn in this project.................................................................................................................... 171
Deliverables in CD for this Project .................................................................................................................. 171
How to start the Quadra client.......................................................................................................................... 172
Web service Fundamentals................................................................................................................................. 173
Overview of the Quadra Client Application.................................................................................................... 178
Estimation of the Quadra Client Application.................................................................................................. 178
Use Case Explanation ......................................................................................................................................... 181
Class Diagram Explanation............................................................................................................................... 183
Setting up the quadra client webservice...........................................................Error! Bookmark not defined.
Code Explanation................................................................................................................................................. 184
CHAPTER 10 – POINTS TO BE NOTED IN PROJECTS ....................................................................................... 185
PROJECTS COMING UP IN SECOND EDITION.................................................................................................... 189
Call centre project............................................................................................................................................... 189
MSC Accounting package................................................................................................................................... 190
INTERVIEW QUESTIONS ....................................................................................................................................... 190
.NET Interview Questions Book......................................................................................................................... 190
SQL Server Interview Questions Book ............................................................................................................. 199
JAVA Interview Questions Book........................................................................................................................ 206
Page 9 of 215
Introduction
Dedication
This book is dedicated to my kid Sanjana, whose dad’s play time has been stolen and
given to this book.I am thankful to my wife for constantly encouraging me and also to BPB
Publication to give new comer a platform to perform. Finally at the top of all thanks To two
old eyes my mom and dad for always blessing me. I am blessed to have Raju as my Brother
who always keeps my momentum moving on.
From Shaam
This book is dedicated to my mom and dad for all the hard work done to see this day where
I am today.
Foreword
First thing I never thought that I will be able to complete this book. It was the worst phase
of career which I had gone through.Thanks to my family to support me, give me confidence
to make this book a success. This book has seen its own ups and downs to reach the final
light. I started this book with one of my friends Rajesh Nair and Pravin Joshi. Rajesh nair is
almost the co-author of the book. But because of their own software project dead lines they
had to fall of in between. But yes that does not upset me a bit. The value they had put in the
initial stages has made this book matured to a huge extent. I am also grateful to Mr. Sainath
to put his experience which has brought the value of book to an elite level. Thanks to
Shaam for all the effort. It was his tiresome three months of continuous writing that we
have finally made it. I hope this book really serves as a good bed for freshers to make
hands on and feel how projects are accomplished in international companies.
Shivprasad Koirala
He works in a big multinational company and has over 8 years of experience in software
industry. He is working presently as project lead and in past has led projects in Banking,
travel and financial sectors.
But on the top of all, I am a simple developer like you all guys there doing an 8 hour job.
Writing is something I do extra and I love doing it. No one is perfect and same holds true
for me .So anything you want to comment, suggest, point typo / grammar mistakes or
Page 10 of 215
Technical mistakes regarding the book you can mail me at shiv_koirala@yahoo.com.
Believe me guys your harsh words would be received with love and treated to the top most
priority. Without all you guys I am not an author.
• Developers who want to understand how project are completed using SDLC and
proper documentation.
• Developers who want to know how estimation, use cases, requirement analysis, test
cases and design documents are executed in live projects.
• Programmers who are looking for quick hands on projects.
• Senior and junior developers who are looking of how to do practical
implementation of OOPS in project.
• Developers who are looking at practically implementing UML.
• Developers who are looking at how estimation is done practically in software
projects.
• Book has in all six projects (Job Site, Chat application, File search, Job Site client,
Mandel brot and batch uploading) with three professional projects completed with
proper controlled SDLC and documentation.
• This book will give you a three dimension view of the project i.e from the
developer, architecture and project manager perspective.
• Full source code of all six projects with proper documentation included in the CD.
• All professional projects have Use cases, UML, Estimation and proper test plan.
This not only makes yo u practically confortable from coding point but also from
project point of view.
• There are decent videos which explain the source code and some basic
fundamentals in a detail fashion thus making yo u comfortable for real projects.
• MSDE is provided in the CD so that you can exploit sql server to the maximum
during database projects.
• Other than technical aspects this book also provides important points to be noted in
the project. For instance your attitude and behavior during the project.
• This book shows in depth of how to increase reusability by using Microsoft
Application blocks. This is excercised by using microsft data application blocks in
the job site project.
• Interview questions to judge yourself during interview. After completing the project
you would like to have a glance through the questions so that you are in a better
position during .NET interviews.
• Threading, Session management, webservices, ADO.NET and many such features
are explained with a project implementation which gives clearer idea of the subject.
Page 11 of 215
• Before the projects detail theory explanation of UML, Estimation, and SDLC and
design documentation is provided to the reader which will make him more
confortable while executing the project.
• Some applications are coded from two perspective one from an ok developer
perspective and the other from a good programmer perspective. Thus giving two
view points of the development perspective.
What’s in the CD
• Source code folder: - This folder has basically all the source code of projects
present in this book.
o Mandelbrot project
o Windows file search project
o Chat application project.
o Job site project ( Quadra job site)
o Job site client project ( Quadra client )
• Videos folder: - This folder contains videos from the perspective of this book.
Watching those videos will make you confident about the project. Below are the
various videos with what they explain :-
o IISPractical: - Gives a practical understanding of what exactly IIS is.
o IISTheoryExplanation :- Gives you theoritcial explanation of IIS.
o WindowsIDE :- Explains how to use VS.NET IDE in a efficient way.
o FunctionPointTemplate :- Explains how to use the function point template
for estimation.
o MandelBrotCodeWalkthrough :- Explains the Mandel brot code
walkthrough.
o BadChatApplicationCodeWalkThrough :- Explains the bad chat code
walkthrough.
o StarttheJobSiteProject :- This video will help you to make job site project up
and running.
o JobWebSiteFunctionalWalkThrough :- Gives functionality walkthrough for
the Job site application.
o JobSiteCodeUnderstanding :- Gives a code walkthrough of the jobsite
application.
o QuadraClientExplanation :- Gives a detail functionality explanation of the
quadr client project.
o QuadraClientCodeUnderstaing :- Gives a code walkthrough of the quadra
client code walkthrough.
Page 12 of 215
• Installable folder: - This folder contains following necessary installable required for
this project.
o Windows Media player and codec installable to view videos of this book.
o Data access application blocks for the DAL component of the project.
o MSDE 2000 Database (MSDE2000A.exe) as a database for this book.
o SQL Server 2000 Evaluation version. This software is in the CD so that we
can install the SQL Client to connect to MSDE 2000.
The prime goal of this book is to make a programmer comfortable to work practically on
C# projects adhering to proper software quality processes. In my childhood times I wanted
to learn cycling. That’s because all the village girls liked boys who can ride cycle :- ). So I
some how managed to get myself in my village cycle training school, it was a four day
course. In the cycle training school I was taught theory for three days and then on the
fourth day I touched the cycle. But I was never confident enough to drive the cycle
independently. But one fine day one of my good friend just made me sit on the cycle and
continuously made me drive the cycle for three hours. LOL!!! I learnt it.
The same holds true for Software field one actual implementation is 1000 times worth than
big GURU talks. But there is one more important thing – Software quality process. I did
learn riding the cycle but for one week continuously I was struggling to manage brakes,
turns etc. In short I learnt to ride the cycle but not in a controlled and quality manner.
That’s a different thing I learnt to control the cycle over a period of time. So the second
aspect this book will target is not only to enable you practically but in a controlled fashion
so that you give quality code rather than quantity code.
Page 13 of 215
If you are self taught programmer or working in a company which is not process oriented
the title of this section can sound a bit bureaucratic to you. A good software product other
than source code has proper documentation and process at place.
Every young developer in his initial part of the software career is hot blooded and full of
enthusiasm. The only goal he has in his mind is to complete the project. For these kind of
young developers source code is the most important section in the complete project.
As time passes by and the young developer starts gaining experience depending on the type
of the company and his number of year of exp his view point changes.
As the developer becomes senior source code becomes an insignificant entity and
documentation forms the most important part of the project from his perspective.
Below is the breakup and view point depending on maturity level of software professional.
0-2 Years of experience: - Developers having experience in this range give importance to
source code. They take pride and enjoyment to write cryptic and heroic logic. Developers
falling in this category think documentation as bureaucratic. If not controlled properly they
rarely will think to even comment codes. But yes software professionals in this experience
range have great technical enthusiasm. They love to get involved technically.
3-5 Year of experience: - Software professional in this category have lot of maturity in
technical section. They take pride in architecture work of the project. In fact many of the
developers would like to see themselves as architecture in the coming times. That’s a
different thing as they get to more senior position they want to see themselves as project
managers rather than in to technical. Software professional in this range think source code
with proper comments and technical documentation as the most important deliverable.
They have less focus on project planning, estimation and testing.
9 and above Years: - This is the time he becomes a complete senior (he becomes a bit fat).
Source code deliverable becomes one of the smallest entities of the project. Planning,
monitoring, People issues, escalation and estimation become prime focus for him. He starts
following processes like CMMI and SIX SIGMA religiously. From this book i am not
trying to communicate that estimation, planning or project management is not a important
part. But as people become seniors why is that they start loosing technical touch. When we
know technical forms an important aspect of software projects.
In short the right proportion between management and technical is important. When a
software professional starts his career technical is the only thing for him and when he is at
his peak management is everything. If a professional makes a proper balance of both these
entities we have the MR Perfect with us.....And I know there are still many MR Perfect in
the software industry or else we would not have come so far.
Page 14 of 215
Figure 1.1 : - Viewpoints of software developer
Above figure shows how senior and junior view project deliverables. Projects in this book
will have all the above documents which will give us a complete view of the project.
If we do not have documentation in project you will probably complete the project but
when new people join knowledge transition becomes a huge task. The biggest advantage of
documentation is that the project becomes resource independent and which is a huge
success for any project. I know how difficult it is to convince juniors and developers
working in small scale software house the importance of documentation and proper process
to complete a project. How many times it has happened that you wanted to change your
project and your project manager did not allow you?. Yes because he knew that you are a
hero of the project and your leaving will create him problems. So first thing never be a hero
on a project rather work in co-coordinated fashion and make project independent of you.
Page 15 of 215
The best way to attain independency in project is by proper documentation. Clear cut
documentation makes new developers to join the project in much easy fashion and you can
move to new heights in the organization.
Now two cents!!!! For the seniors who do over documentation the project ;-). I still
remember one of my seniors who told me to document how a developer should behave in
the project. The above said document is related to project, but if it is not there it will not
affect the project in any way. In short introduce documents in project which are really
needed rather than just pushing something for namesake.
Every activity has a life cycle and software developme nt process is not an exception for the
same. Even if you are not aware of SDLC you still must be following it unknowingly. But
if a software professional is aware about SDLC he can execute the project in a much
controlled fashion. One of the big benefits of this awareness is that hot blooded developers
will not start directly execution (coding) which can really lead to project running in an
uncontrolled fashion. Second it helps customer and software professional to avoid
confusion by anticipating the problems and issues before hand. In short SDLC defines the
various stages in a software life cycle.
But before we try to understand what SDLC is all about. We need to get a broader view of
the start and end of SDLC. Any project started if it does not have a start and end then its
already in trouble. It’s like if you go out for a drive you should know where to start and
where to end or else you are moving around endlessly.
Above is a more global view of the how the start and end of SDLC. Any project should
have entry criteria and exit criteria. For instance a proper estimation document can be an
entry criteria condition. That means if you do not have a proper estimation document in
place the project will not start. It can be more practical, if half payment is not received the
Page 16 of 215
project will not start. So there can be list of points which needs to be completed before a
project starts. Finally there should be end of the project also which defines saying that this
is when the project will end. For instance if all the test scenarios given by the end customer
is completed that means the project is finished. In the above figure we have the entry
criteria as an estimation document and exit criteria as a signed document by the end client
saying the software is delivered.
Below is the figure that shows typical flow in SDLC which has five main models .As per
use developers can select model for their project.
• Waterfall - Big Bang and Phased model.
• Iterative - Spiral and Incremental model.
Waterfall
Let’s have a look on Waterfall model which is basically divided into two subtypes:-
• Design stage : - Use case document / requirement document is the input for this
stage. Here we decide how to design the project technically and produce technical
document which has Class diagram, pseudo code etc.
• Build stage:- This stage follows the technical documents as an input so code can be
generated as an output by this stage. This is where the actual execution of the
project takes place.
• Test stage:- Here testing is done on the source code produced by the build stage and
final software is given a green flag. In this book we will have a test plan documents
for this stage.
• Deliver stage : - After succeeding in Test stage the final product/project is finally
installed at client end for actual production. This stage is start for the maintenance
stage.
Page 17 of 215
Figure 1.3: - SDLC in action (Waterfall big bang model)
In this model, it is assumed that all stages are freezed that means it’s a perfect world. But in
actual projects such processes are impractical.
In this model the project is divided into small chunks and delivered at intervals by different
teams. In short, chunks are developed in parallel by different teams and get integrated in
the final project. But the disadvantage of this model is there is improper planning may lead
to fall of the project during integration or any mismatch of co-ordination between the team
may cause huge failure.
Iterative model
Incremental model
Page 18 of 215
In this model work is divided into chunks like phase waterfall model but the difference is
that in Incremental model one team can work on one or many chunks which was unlike in
phase waterfall model.
Spiral model
This model uses series of prototype which refine on understanding of what we are actually
going to deliver. Plans are changed if required as per refining of the prototype. So every
time in this model refining of prototype is done and again the whole process cycle is
repeated.
Evolutionary model
In Incremental and Spiral model the main problem is for any changes in between SDLC
cycle we need to iterate through the whole new cycle. For instance, During the
final(Deliver)stage customer demands for change we retreat the whole cycle again that
means we need to update all the previous (Requirement, Technical documents, Source
code & Test plan) stages.
In Evolutionary model, we divide software into small units which can be earlier delivered
to the customer’s end which means we try to fulfill the customer’s needs. In the later stages
we evolve the software with new customers needs.
V-model
This type of model was deve loped by testers to emphasis the importance of early testing. In
this model testers are involved from requirement stage itself. So below is the diagram
which shows how for every stage some testing activity is done to ensure that the project is
moving as planned.
For instance,
• In requirement stage we have acceptance test documents created by the testers.
Acceptance test document outlines that if these test pass then customer will accept
the software.
• In specification stage testers create the system test document. In the coming section
system testing is explained in more elaborate fashion.
• In design stage we have integration document s created by the testers. Integration
test documents define testing steps of how the components should work when
integrated. For instance you develop a customer class and product class. You have
tested the customer class and the product class individually. But in practical
scenario the customer class will interact with the product class. So you also need to
test is the customer class interacting with product class properly.
• In implement stage we have unit documents created by the programmers or testers.
Lets try to understand every of this testing phase in more detail.
Unit Testing
Page 19 of 215
Starting from the bottom the first test level is "Unit Testing". It involves checking that each
feature specified in the "Component Design" has been implemented in the component.
In theory an independent tester should do this, but in practice the developer usually does it,
as they are the only people who understand how a component works. The problem with a
component is that it performs only a small part of the functionality of a system, and it relies
on co-operating with other parts of the system, which may not have been built yet. To
overcome this, the developer either builds, or uses special software to trick the component
into believe it is working in a fully functional system.
Integration Testing
As the components are constructed and tested they are then linked together to check if they
work with each other. It is a fact that two components that have passed all their tests, when
connected to each other produce one new component full of faults. These tests can be done
by specialists, or by the developers.
Integration Testing is not focused on what the components are doing but on how they
communicate with each other, as specified in the "System Design". The "System Design"
defines relationships between components.
The tests are organized to check all the interfaces, until all the components have been built
and interfaced to each other producing the whole system.
System Testing
Once the entire system has been built then it has to be tested against the "System
Specification" to check if it delivers the features required. It is still developer focused,
although specialist developers known as systems testers are normally employed to do it.
In essence System Testing is not about checking the individual parts of the design, but
about checking the system as a whole. In fact it is one giant component.
System testing can involve a number of specialist types of test to see if all the functional
and non- functional requirements have been met. In addition to functional requirements
these may include the following types of testing for the non- functional requirements:
There are many others, the need for which is dictated by how the system is supposed to
perform.
Acceptance Testing
Page 20 of 215
Acceptance Testing checks the system against the "Requirements". It is similar to systems
testing in that the whole system is checked but the important difference is the change in
focus:
Systems testing checks that the system that was specified has been delivered. Acceptance
Testing checks that the system will deliver what was requested.
The customer should always do acceptance testing and not the developer. The customer
knows what is required from the system to achieve value in the business and is the only
person qualified to make that judgment. This testing is more of getting the answer for
whether is the software delivered as defined by the customer. It’s like getting a green flag
from the customer that the software is up to the expectation and ready to be used.
As it is an educational book we will build up virtual project for clear understanding the
process so we will use Big Bang waterfall model. In waterfall project output of every stage
will be freezed as explained earlier no changes will be accepted once the requirement
document is freezed.
Page 21 of 215
Essential documentation in projects
In the previous section we discussed the various SDLC lifecycle models. For every stage in
the model we have documents created according to phases such as:-
• Requirement stage we have the Use case document
• Design stage we have the Technical document
• Build stage we have the source code
• Test stage we have the Test result document
• Deliver stage we have the sign off document
There are different documentation for every project and these documents change from
company to company and project to project.
For instance, some company will have 3 documents and some will have 12 documents in a
project depending upon project manager or the policy of the company to execute a project.
This book will include only 5 documents in a project which are as follows:-
• Requirement document
• Estimation document
• Use case document
• Technical document
• Test plan document
• Source code
Let’s try to understand in detail each document used in a software project
• Requirement document:-A requirement document can be a single English
document, probably a recorded audio or video conversation or can be a
complicated use case. In short it’s something raw which comes from the end client.
• Estimation document: - After getting requirement from the user we can judge cost
for the project. In this book we will be using the function point estimation model.
There is a complete chapter which is dedicated to function point in this book.
• Use case document:- This is a section of UML which basically describes in detail
the requirement document which serves as an input to the Design stage
• Technical document:- This document contains detail of how the project being
executed such as pseudo code, class diagram, objects diagram, etc.
• Test result document : - This document is written by the testers which describe the
test plan which needs to be executed and thus giving project a green flag to
production.
• Source code: - This is not basically a document but one of the important
deliverable which maps to the execution phase of SDLC cycle.
Note: - See the SDLC in action figure given above which shows how the
documents are mapped to SDLC cycle.
UML
The main object of UML is to make the project understanding more crisp and clear. It is a
global computer industry modeling language to communicate between software
professional in a project. UML helps us to create documents, artifacts & also give
Page 22 of 215
visualization so that we can understand the complex software engineering process of a
project.
There are 12 diagrams in UML they are divided into 3 main views as below:-
• Structure diagram
• Behavior diagram
• Model management diagram
Structure diagram
They are used to show static structure of an application. Let’s try to understand what the
word static signifies. For instance in a civil construction when the engineer makes a model
of a civil construction. The outer structure of the building and bridge will remain same but
yes the inner part of the structure for instance the structure of room and passages (one
room, two rooms etc) can vary. Same holds true when we talk about software industry there
are static part and dynamic part of project. For example classes in project will rarely
change. Yes the attributes and methods in the class will change as user adds new
functionalities. For instance in the below figure you can see the Invoice header will have
multiple invoice details. The structure and relation between Invoice header and Invoice
detail will never change. But yes the invoice can pass through multiple stages like open
invoice, closed invoice or pending invoice which is dynamic.
1) Class diagrams
2) Object diagrams
3) Component diagrams
Page 23 of 215
4) Deployment diagrams
Behavior diagram
UML gives us five Behavior diagram. They are used to show dynamic structure of an
applicatio n. Let’s try to understand what does a dynamic structure of a project means. In a
typical software project we can have business validations. Business validations of a project
are of very dynamic nature. For instance an invoice can have lot of states for instance open
invoice, closed invoice and paid invoice. And your software will change the invoice object
from one state to other state. This is a dynamic nature of the project.
Model management diagram gives a view how different application modules are managed ,
grouped and classified. For instance the below figure shows how Accounting, Payment and
common routines are grouped and organized.
Page 24 of 215
Figure 1.7: - Model Management diagram in action
UML provides three diagrams by which we can get the Model Management view. Below
are the three diagrams:-
1. Packages
2. Subsystems
3. Models
Use to show real-world entities, elements of analysis and design, or implementation classes
and their relationships
Object diagram
Use to show a specific or illustrative example of objects and their links. Often used to
indicate the conditions for an event, such as a test or an operatio n call
Use to show the how something is made. Especially useful in complex structures-of-
structures or component-based design.
Page 25 of 215
Deployment diagram
Use to show the run-time architecture of the system, the hardware platforms, software
artifacts (deliverable or running software items), and software environments (like operating
systems and virtual machines).
Component diagram
Use to show organization and relationships among the system deliverables
Package diagram
Use to organize model elements and show dependencies among them
Activity diagram
Use to the show data flow and/ or the control flow of a behavior Captures workflow among
cooperating objects
Overview diagram
Use to show many different inter- action scenarios (seque nces of behavior) for the same
collaboration (a set of elements working together to accomplish a goal)
Sequence diagram
Use to focus on message exchange between a group of objects and the order of the
messages.
Communication diagram
Use to focus on the messages between a group of objects and the underlying relationship of
the objects
Timing diagram
Use to show changes and their relationship to clock times in real-time or embedded
Systems work
In above section we have seen the basic definitions of all the UML diagrams. But in real
projects we do not draw all the diagrams instead we look towards the complexity of the
project or necessity of the project and accordingly we decide the diagrams and then
Page 26 of 215
diagrams are added to the technical document or the requirement document. So in this book
we will use two basic diagrams extensively:-
• Use case diagrams
• Class diagrams
The other diagram will be used if required and their respective explanation will be
provided at the same time. Let’s try to understand in detail the two basic diagram used
in the project. The first one is the Use case diagram and explained as the follows
Every use case will have the below two components actors and goals. Actors are stake
holders of the system. Stake holders provide requirement to your project and oppose in case
of any issues. Normally software users are the actors. For instance in an accounting
application accountant forms as an actor and for the same accounting application we have
cashier and charted accountant as another form of actors for the system. Every actor has
goal to perform when using the system. There are two types of actors:-
• Primary Actor:- This actor actually initiates the use case on the system.
• Secondary Actor:-While Secondary Actor contacts other actors or use cases to meet
the Primary Actor’s goal.
In the below example we have Ticket Reservation system here travel agent is a actor who is
using reserving ticket application and booking a ticket, canceling a ticket and refunding a
ticket. So booking, canceling and refunding of a ticket are goals performed by an actor. The
figure below shows the diagrammatic view to represent relationship between actors and
goals. But the diagram does not show the details of the goals.
Page 27 of 215
Figure 1.8:- Actors and Goals in action
So for the same we need to document it using use case documents which is explained in the
coming section. In the next section we will go through a use case template which we will
use in most of the project. Use case templates can be used to expand on the above diagram
in more detail manner.
Below is the use case template which we will be using in most of our project. So let’s
understand every section of the template.
• Use case: - In order to identify particular use case we do unique numbering to it
like UC001, UC002 or QUEST POND 001, QUEST POND 002 etc as there are
N number of use cases in a project.
• Use case name:- It is a particular action taken by the user on the system or task
get done from the system in the form such as booking a ticket, Canceling a
ticket etc in actual which represents an action.
• Description:-It basically describes the details of a user case in a textual form.
• Primary actor:-Primary Actor is nothing but the user who actually initiates the
goal. For example in a travel agency the director sees the report booking done
by customers. So here the director acts as a primary actor who is fully
interested in how much booking is done over a period of time. But he is not
interested in making a booking as that’s the work of the travel agent. So in
“Make booking” use case the travel agent acts as a primary actor and the
director as the secondary actor. But in case of “View booking” use case the
travel agent acts as a secondary actor and the director as a primary actor.
Page 28 of 215
• Trigger:- Things which makes use case starts through an actor is called Trigger.
For example user starts the application.
• Pre-condition:- These are conditions in a use case to be considered as pre-
requirements such as to book a air ticket we need to have server connection and
also we have to validate in to the system then only the actor can book a ticket
for the customer.
• Assumptions: - These are assumptions which we define for the system.
• Failed end conditions:-This state signifies when the use case will fail. For when
User Id and Password is not proper id displayed on the Login screen it signifies
login failed condition.
• Actions : - This is the basic action by which the main scenario of the use case
starts such as login onto the system or to make booking of tickets we actually
perform actions like click on Login----File----New----Booking menu which in
return opens the page of booking section.
• Main scenario:-It describes the basic step which should be executed by the
user.
For instance below is the alternate scenario step which is different than the main
scenario:-
• Note and open issues: - Some pending task about the use case which the
customer needs to make more clarification. For example from where does
Page 29 of 215
exactly the booking of air tickets happens, is it directly from the customer itself
or from the traveling agency.
Included and extended are the types of use cases which can be used to club together such
common sequences.
Included use case:-Below figure shows the included use case in an shoppingmall.com
project and uses the Included use case in the form of “check credit cards” for customers.
Let’s try to understand the following example of a customer where he orders the flowers,
greeting cards and cassettes but the payment is always done through the credit card. So
here flowers, greeting cards and cassettes always have to execute the check credit card
(common use case). So we make the check credit card use case as an included use case.
Page 30 of 215
Figure 1.10:- Included Use case in action
This kind of common interaction can be put in a common use case and called whenever
needed.
Extended use case system:-While writing use case it is possible to have multiple version of
the same use case. For instance you have to add a new customer and then you can also
update a customer. So update customer use case is an Extension of add new customer use
case.
Page 31 of 215
Differentiate between Included use case and extended use cases?
If you need to deliver the use case with the base use case then it will form an included use
case type of relationship. But if use case can be delivered later and have steps in common
then its base use case forms an Extended use case type of relationship. The one thing in
common is that they have some common steps in sequence.
Class diagram
In this book for all projects the other diagram that will be extensively used is the class
diagram.Class is basically prototype which helps us create objects. Class defines the static
structure of the project. A class represents family of an object. By using Class we can
create uniform objects.
In the below figure you can see how the class diagram looks. Basically there are three
important sections which are numbered as shown in the below. Let’s try to understand
according to the numbering:-
• Class name:- This is the first section or top most section of the Class which
represents the name of the Class (clsCustomer).
• Attributes:- This is the second section or the middle section of the class which
represents the properties of the system.
• Methods: - This section carries operation or method to act on the attributes.
Page 32 of 215
In this figure, we can see Order class and the Payment class and arrowed line showing
relationship that order class is paid using payment class in other words order class is going
to be used by payment class to pay the order. The left to right marked arrow basically
shows the flow that order class uses the payment class.
In case payment class using the order class then the marked arrow should be right to left
showing the direction of the flow.
Multiplicity
Multiplicity can be termed as classes having multiple associations or one class can be
linked to instances of many other classes. If you look at the below figure the customer class
is basically associated with the address class and also observes the notations (*, 0 and 1).If
you look at the right hand side the (1….*) notation indicates that at least one or many
instance of the address class can be present in the customer class. Now towards left hand
side we have (0….*) notation indicating that address class can exist without or many
customer class can link him.
In order to represent multiplicity of classes we have to show notations like (1….*), (0….*)
as shown in below figure.
Note: ‘*’ means “many” where as ‘(0, 1)’ means “(zero or at least one)”
respectively.
Page 33 of 215
Figure 1.15: - Multiplicity in Classes
Aggregation Association signifies that the whole object can exist without the Aggregated
Object. For example in the below figure we have three classes university class, department
class and the Professor Class. The university cannot exist without department which means
that university will be closed as the department is closed. In other words lifetime of the
university depend on the lifetime of department.
In the same figure we have defined second Association between the department and the
Professor. In this case, if the professor leaves the department still the department continues
in other words department is not dependent on the professor this is called as Composition
Association.
Note: - The filled diamond represents the aggregation and the empty
diamond represents the composition. You can see the figure below for more
details.
Page 34 of 215
Figure 1.16: - Aggregation and composition in action
Page 35 of 215
Reflexive associations
In many scenarios you need to show that two instances of the same class are associated
with each other and this scenario is termed as Reflexive Association. For instance in the
below figure shows Reflexive Association in the real project. Here you can see customer
class has multiple address class and addresses can be a Head office, corporate office or
Regional office. One of the address objects is Head office and we have linked the address
object to show Reflexive Association relatio nship. This is the way we can read the diagram
Regional address object is blocked by zero or one instance of Head office object.
Page 36 of 215
Figure 1.19:- Generalization and Specialization
Note: - In all the projects in the book we will be using class diagram
heavily.
Estimation in projects
One of the important sections in any project is estimation. Any project started with out
estimation means the software company has already decided to work for charity. In this
book we will be using one of the most used estimation technology function points to do
estimation. Please read this chapter again and again so that you do not have issues while
going through the estimation sheets in every project.
“This document contains material which has been extracted from the IFPUG
Counting Practices Manual. It is reproduced in this document with the
permission of IFPUG.”
Function Point Analysis was developed first by Allan J. Albrecht in the mid 1970s. It was
an attempt to overcome difficulties associated with lines of code as a measure of software
size, and to assist in developing a mechanism to predict effort associated with software
development. The method was first published in 1979, then later in 1983. In 1984 Albrecht
refined the method and since 1986, when the International Function Point User Group
(IFPUG) was set up, several versions of the Function Point Counting Practices Manual
have been coming out.
“The best way to understand any complicated system is breaking the system
in to smaller subsystem and try to understand those smaller sub-systems .
Page 37 of 215
In Function Point you break complicated huge system into smaller systems
and estimate those smaller pieces, then total up all the subsystem
estimate to come up with final estimate.”
Application Boundary
The first step in FPA is defining boundary. There are two types of major boundaries:
I will state features of external application boundary, so that internal application boundary
would be self explained.
• Does it have or will have any other interface to maintain its data, which is not
developed by you. Example: Your Company is developing an “Accounts
Application” and at the end of accounting year, you have to report to tax
department. Tax department has his own website where companies can connect
and report there Tax transaction. Tax department application has other
maintenance and reporting screens been developed by tax software department.
These maintenance screens are used internally by the Tax department. So Tax
online interface has other interface to maintain its data which is not your scope,
thus we can identify Tax website reporting as External Application.
• Does your program have to go through a third party API or layer? In order
your application interacts with Tax Department Application probably your
code have to interact through Tax Department API.
• The best litmus test is to ask yourself do you have full access over the system.
If you have full rights or command to change then its internal application
boundary or else external application boundary.
Elementary Process
As said in introduction FPA is breaking huge systems in to smaller pieces and analyzing
them. Software application is combination of set of elementary processes.
Page 38 of 215
Note:-Elementary process is not necessarily completely independent or can
exist by itself.So, we can define elementary process as small units of
self contained functionality from user perspective.
• Input data screen where user inputs data in to application. Data moves from
the input screen inside application.
• Transaction exported in export files in XML or any other standard.
• Display reports which can come from external application boundary and internal
application boundary.
Static elementary process maintains data of application either inside application boundary
or in external application boundary.
Page 39 of 215
Figure 1.20: - ILF logical relationship
Page 40 of 215
Figure 1.21:- ILF logical relationship
Please note the whole database is one supplier ILF as all belong to one logical section.
RET quantifies the relationship complexity of ILF and EIF.
• Each DET should be User recognizable. Example in the above given figure
we have kept auto increment field (Supplierid) for primary key. Supplierid field
from user point of view never exists at all , its only from software designing
aspect, so does not qualifies for DET.
• DET should be non-recursive field in ILF. DET should not repeat in the same
ILF again, it should be counted only once.
• Count foreign keys as one DET. “Supplierid” does not qualifies as DET but
its relationship in “supplieraddress” table is counted as DET. So “Supplierid_fk”
in supplieraddress table is counted as DET. Same folds true for
“Supplieraddressid_fk”.
Page 41 of 215
always have one FTR in any EP.
• It’s a dynamic elementary process [For definition see “Dynamic and Static
Elementary Process” Section] in which data is received from external
application boundary.
Example: - User Interaction Screens, when data comes from User Interface
to Internal Application.
• EI may maintain ILF of the application, but it’s not compulsory rule.
Example: - A calculator application does not maintain any data, but still the
screen of calculator will be counted as EI.
• Most of time User Screens will be EI, again no hard and fast rule. Examp le: -
An import batch process running from command line does not have screen,
but still should be counted as EI as it helps passing data from External
Application Boundary to Internal Application Boundary.
• It’s a dynamic elementary process in which result data is retrieved from one or
more ILF or EIF.
• In this EP some input request has to enter the application boundary.
• Output results exits the application boundary.
• EQ does not contain any derived data. Derived data means any complex
calculated data. Derived data is not just mere retrieval but are combined with
additional formulae to generate results. Derived data is not part of ILF or EIF,
they are generated on fly.
• EQ does not update any ILF or EIF.
• EQ activity should be meaningful from user perspective.
• EP is self contained and leaves the business in consistent state.
• DET and processing logic is different from other EQ’s.
• Simple reports form good base as EQ.
Note:- No hard and fast rules that only simple reports are EQ’s.Simple
view functionality can also be counted as EQ.
Page 42 of 215
• EP is self contained and leaves the business in a consistent state.
• DET is different from other EO’s.So this ensures to us that we do not count
EO’s twice.
• They have derived data or formulae calculated data.
Major difference between EO and EQ is that data passes across application boundary.
Example: - Exporting Accounts transaction to some external file format like XML or
some other format. Which later the external accounting software can import. Second
Important difference is in EQ its non-derived data and EO has derived data. Which means
EQ is a simple report but EO can have complex derived data like sum, count, summary etc.
There are 14 points considered to come out with VAF (Value Added factor) and its
Associated rating table.
Data Communications
How many communication facilities are there to aid in the transfer or exchange of
information with the application or system?
Rating Description
0 Application is pure batch processing or a standalone PC.
1 Application is batch but has remote data entry or remote Printing.
2 Application is batch but has remote data entry and remote Printing.
3 Application includes online data collection or TP (Teleprocessing) front end
to a batch process or query system.
Page 43 of 215
How are distributed data and processing functions handled?
Rating Description
0 Application does not aid the transfer of data or processing Function between
compone nts of the system.
1 Application prepares data for end user processing on another component of
the system such as PC spreadsheets and PC DBMS
2 Data is prepared for transfer, then is transferred and processed on another
component of the system (not for end-user Processing).
3 Distributed processing and data transfer are online and in One direction
only.
4 Distributed processing and data transfer are online and in Both directions.
5 Processing functions are dynamically performed on the most Appropriate
component of the system
Performance
Did the user require response time or throughput?
Rating Description
0 No special performance requirements were stated by the
User.
1 Performance and design requirements were stated and
Reviewed but no special actions were required.
2 Responsetimeorthroughputiscriticalduringpeakhours.Nospec
ialdesignforCPU utilization was required. Processing
deadline is for the next business day.
3 Response time or through put is critical during all business
hours. No special design for CPU
utilizationwasrequired.Processingdeadlinerequirementswithi
nterfacing systems Are constraining.
4 In addition, stated user performance requirements are
stringent enough to require performance analysis tasks in the
Design phase.
5 In addition, performance analysis tools were used in the
design, development, and/or implementation phases to
meet The stated user performance requirements.
Table :- Performance
Rating Description
Page 44 of 215
0 No explicit or implicit operational restrictions are included.
1 Operational restrictions do exist, but are less restrictive than a typical
application. No special effort is needed to meet the Restrictions.
2 Some security or timing considerations are included.
3 Specific processor requirement for a specific piece of the Application is
included.
4 Stated operation restrictions require special constraints on the application
in the central processor or a dedicated Processor.
5 In addition, there are special constraints on the application in The
distributed components of the system.
Rating Description
0 All transactions are processed in batch mode.
1 1% to7% of transactions is interactive data entry.
2 8% to15% of transactions is interactive data entry.
3 16% to23% of transactions is interactive data entry.
4 24% to30% of transactions is interactive data entry.
5 M orethan30% of transactions is interactive data entry.
Page 45 of 215
End-user efficiency
Was the application designed for end-user efficiency? There are seven end- user efficiency
factors which govern how this point is rated.
Rating Description
0 None of the above.
1 One to three of the above.
2 Four to five of the above.
3 Six or more of the above, but there are no specific user Requirements related
to efficiency.
4 Six or more of the above, and stated requirements for end-user efficiency are
strong enough to require design tasks for human factors to be included (for
example, minimize keystrokes, maximize defaults, use of templates).
5 Six or more of the above, and stated requirements for end-user efficiency are
strong enough to require use of special tools and processes to demonstrate
that the objectives have been achieved.
Table : End user efficiency
On-Line update
How many ILF’s are updated by On-Line transaction?
Rating Description
0 None of the above.
Page 46 of 215
1 Online update of one to three control files is included. Volume of
updating I slow and recovery is easy.
2 Online update off our or more control files is included. Volume of
updating is low and recovery easy.
3 Online update of major internal logical files is included.
4 In addition, protection against data lost is essential and has been
specially designed and programmed in the system.
5 In addition, high volumes bring cost considerations into the
Recovery process. Highly automated recovery procedures With
minimum operator intervention are included.
Complex processing
Does the application have extensive logical or mathematical processing?
Rating Description
0 None of the above.
1 Any one of the above.
2 Any two of the above.
3 Any three of the above.
4 Any four of the above.
5 All five of the above
Table :- Complex processing
Reusability
Was the application developed to meet one or many user’s needs?
Rating Description
0 No reusable code.
1 Reusable code is used within the application.
2 Less than 10% of the application considered
Page 47 of 215
more than one user's needs.
3 Ten percent (10%) or more of the application
considered more than one user's needs.
4 The application was specifically packaged
and/or documented to ease re-use, and the
application is customized by the user at source
code level.
5 The application was specifically packaged
and/or documented to ease re-use, and the
application is customized for use by means of
user parameter maintenance.
Table :- reusability
Installation ease
Description Rating
0 No special considerations were stated by the user, and no special
setup is required for installation.
1 No special considerations were stated by the user but special
setup is required for installation.
2 Conversion and installation requirements were stated by the user
and conversion and installation guides were provided and
tested. The impact of conversion on the project is not considered
to be important.
3 Conversion and installation requirements were stated by the user,
and conversion and installation guides were provided And tested.
The impact of conversion on the project is Considered to be
important.
4 In addition to 2 above, automated conversion and installation
Tools were provided and tested.
5 In addition to 3 above, automated conversion and installation
Tools were provided and tested.
Operational ease
How effective and/or automated are start-up, back up, and recovery procedures?
Rating Description
0 No special operational considerations so other than the normal
Back- up procedures were stated by the user.
1-4 One, some, or all of the following items apply to the Application.
Select all that apply. Each item has a point Value of one, except as
Page 48 of 215
noted otherwise.
Effective start- up, back-up, and recovery processes were Provided,
but operator intervention is required.
Effective start- up, back-up, and recovery processes were provided,
but no operator intervention is required(count as Two items).
The application minimizes the need for tape mounts.
The application minimizes the need for paper handling.
5 The application is designed for unattended operation. Unattended
operation means no operator intervention is required to operate the
system other than to startup or shutdown the application.
Automatic error recovery is a feature Of the application.
Multiple sites
Was the application specifically designed, developed, and supported to be installed at
multiple sites for multiple organizations?
Description Rating
0 User requirements do not require considering the needs of More than one
user/installation site.
1 Needs of multiple sites were considered in the design, and the application
is designed to operate only under identical Hardware and software
environments.
2 Needs of multiple sites were considered in the design, and the application
is designed to operate only under similar Hardware and or software
environments.
3 Needs of multiple sites were considered in the design, and the application
is designed to operate under different Hardware and or software
environments.
4 Documentation and support plan are provided and tested to support the
application at multiple sites and the application is as described by 1 or 2.
5 Documentation and support plan are provided and tested to support the
application at multiple sites and the application is as described by 3.
Table :- Multiple sites
Facilitate change
Was the application specifically designed, developed, and supported to facilitate change?.
The following characteristic s can apply for the application
Sr no Facilitate factors
0 None of above
1 Flexible query and report facility is provided that can handle simple requests;
for example, and/or logic applied to only one internal logical file (count as
one item).
Page 49 of 215
2 Flexible query and report facility is provided that can handle requests of
average complexity for example, and/or logic applied to more than one
internal logical file (count as two items).
3 Flexible query and report facility is provided that can handle complex
requests, for example, and/or logic combinations on one or more internal
logical files (count as three items).
4 Business control data is kept in tables that are maintained by the user with
online interactive Processes, but changes take effect only on the next business
day.
5 Business control data is kept in tables that are maintained by the user with
online interactive Processes and the changes take effect immediately (count
as two items)
Table : Facilitate change factors
Rating Description
0 None of the above.
1 Any one of the above.
2 Any two of the above.
3 Any three of the above.
4 Any four of the above.
5 All five of the above
Table :- Facilitate change
All the above GSC are rated from 0-5.Then VAF is calculated from the equation
below:-
Note: - GSC has not been accepted in software industry widely. Many
software companies use Unadjusted Function point rather than adjusted.
ISO has also removed GSC from its books and only kept unadjusted function
points as the base for measurement. Read GSC acceptance in software
industry Rating Tables for All elements of Function Points
Below shown are look up tables which will be referred during counting.
EI Rating
Table
Data Elements
FTR 1to 4 5 to 15 Greater than 15
Less than 2 3 3 4
Equal to 2 3 4 6
Greater than 2 4 4 6
Table :- EI rating table
Page 50 of 215
This table says that in any EI (External Input), if your DET count (Data Ele ment) and
FTR (File Type Reference) exceed these limits, then this should be the FP (Function Point).
Example, if your DET (data element) exceeds >15 and FTR (File Type Reference)
is greater than 2, then the Function Point count is 6. The rest down tables also show the
same things. These tables will be there before us when we are doing function point count.
The best is put these values in Excel with formulae so that you have to only put quantity
in the appropriate section and you get the final value.
Note :- We have provided a excel template for estimation. You can also
see the video of how to use the estimation sheet which will automate your
estimation to a great extent.
EO Rating Table
Data Elements
FTR 1 to 5 6 to 19 Greater than 19
Less than 2 4 4 5
2 or 3 4 5 7
Greater than 2 5 7 7
EQ Rating Table
Data Elements
FTR 1 to 5 6 to 19 Greater than 19
Less than 2 3 3 4
2 or 3 3 4 6
Greater than 2 4 6 6
Table :- EQ rating table
Page 51 of 215
Steps to Count Function Points
This section will discuss the practical way of counting the FP and coming out with a
Man/Days on a project.
• Counting the ILF, EIF, EI, EQ, RET, DET, FTR (this is basically all sections
discussed above): This whole FP count will be called as "unadjusted function
point".
• Then put rating values 0 to 5 to all 14 GSC. Adding total of all 14 GSC to
come out with total VAF. Formula for VAF = 0.65 + (sum of all GSC factor/
100).
• Finally, make the calculation of adjusted function point. Formula: Total
function point = VAF * Unadjusted function point.
• Make estimation how many function points you will do per day. This is also
called as "Performance factor".
• On basis of performance factor, you can calculate Man/Days
Page 52 of 215
Figure:- 1.22 Custom screen
There is one ILF in the above screen:
• The customer ILF.
ILF Customer
Description Number of DET Number of RET
There are total 9 DETs, all 9 1
add and update buttons,
even the credit check
button, the address list box,
check box active, all text
boxes.
There is only one RET, the
customer addresses.
So according to the above Total function 7
ILF ranking table
Table :- ILF for the customer
Page 53 of 215
EIF lie outside the application boundary.
EI Update Customer
Description Number of DET Number of RET
Page 54 of 215
There are total 9 DETs, all add and
update buttons, even the credit
check button, the address list box,
check box active, all text boxes.
There are 3 FTRs, one is the 9 3
address and the second is the credit
card information and third is
customer himself.
So according to the above ranking Total function 6
table
While counting EI I have seen many people multiplying it by 3.That means we are going
to do all CRUD functionality (ADD, UPDATE, and DELETE).This is not fair as it just
shows laziness of the Cost estimation team. Here the customer screen has add and update.
I can say the 2 * 6 that's = 12 FP for this EI customer. But later when some refers to your
FP sheet he will be completely lost.
Page 55 of 215
while the customer is editing the customer data.
• EQ does not contain any derived data. The above customer data which is
displayed does not contain any complex calculations.
So now, let’s add the total function point got from above tables:
Function Point Section Name Counted
ILF Customer
EO Credit Card check system 4
EIF credit card information 5
EI Customer (Add and 12
update)
EQ display customer edit 3
information
Total Unadjusted 31
Function Points
Table :- Total of all function point
So unadjusted function point comes to 31.Please note we have said this as Unadjusted
functio n as we have not accounted other variance factor of project (Programmers leaving
job, Language we will use, what architecture etc etc).
In order to make it adjusted function point, we have to calculate and tabulate the GSC
and come out with the VAF.
GSC Value(0-5)
Data communications 1
Distributed data processing 1
Performance 4
Heavily used configuration 0
Transaction rate 1
On-Line data entry 0
End-user efficiency 4
On-Line update 0
Page 56 of 215
Complex processing 0
Reusability 3
Installation ease 4
Operational ease 4
Multiple sites 0
Facilitate change 0
Total 22
Table :- GSC
VAF = 0.65 + ((sum of all GSC factor)/100). = 0.65 + (22/100) = 0.87.
This factor affects the whole FP like anything, be very particular with this factor. So now,
Calculating the
Now we know that the complete FP for the customer GUI is 27 FP. Now calculating the
Efficiency factor, we say that we will complete 3 FP per day that is 9 working days. So, the
whole customer GUI is of 9 working days (Note do not consider Saturday and Sundays in
this). I know upper manager people will say make it 7 FP per day and over load the
programmer. That’s why programmer works at night.
The main intention of introducing this section is because estimations are heavily affected
by which software life cycle you follow. Because deliverables change according to SLDC
model the project manager chooses for the project. Example for waterfall model we will
have Requirement documents, Design documents, Source code and testing plans. But for
Prototyping models in addition to the documents above we will also need to deliver the
Rough prototype. For build and fix model we will not deliver any of the documents and
the only document delivered will be source code. So according to SDLC model
deliverables change and hence the quotatio n. We will divide the estimation across
requirement, design, implementation (coding) and testing .In what way the estimation has
to divide across all deliverables is all up to the project manager and his plans.
Page 57 of 215
Phase Percentage distribution Distribution of man/
effort days across phases
20-25 % of total effort can be allocated to testing phase. Test cases are non-deterministic.
That means if test passes it takes “X” amount of time and if it does not then to amend it
take “Y” amount of time etc etc.
Final Estimation
One programmer will sit on the project with around 1000 $ salary / Month. So his 12.6
days salary comes to 290 dollars approx. The upper quotation format is in its simplest
format.
Every company has his quotation format accordingly. So no hard and fast rule of quotation
template. But still if interested http://www.microsoft.com/mac/resources/
templates.aspx?pid=templates has good collection of decent temp lates.
Page 58 of 215
To:
TNC Limited, Western road 17, California.
Quotation number: 90
Date: 1/1/2004
Customer ID: Z- 20090DATAENTRY
Quantity Description Discount Taxable Total
1 Customer Project 0% 0% 466 dollars
Quotation Valid for 100 days
Goods delivery date with in 25 days of half payment
Quotation Prepared by: - XYZ estimation department
Approved by :- SPEG department XYZ.
Table – Final bill
CustomerSampleFP.xls is provided with the CD which has all estimation details which
you can refer for practical approach.
GSC factors have been always a controversial topic. Most of the software companies do
not use GSC, rather than they base line UAFP or construct there own table depending on
company project history. ISO has also adopted function point as unit of measurement,
but they also use UAFP rather than AFP. Let’s do a small experiment to view relationship
between FP, AFP, GSC and VAF. In this experiment we will assume UAFP = 120 and then
lot graph with GSC increment of five. So the formulae is VAF = 0.65 + (GS/100).
Here’s the table with every five incremental values in formulae and plot.
FP GSC
78 0
84 5
90 10
96 15
102 20
108 25
114 30
120 35
126 40
132 45
138 50
144 55
150 60
156 65
Page 59 of 215
162 70
The following are the observation from the table and plot:-
• Graph is linear. It also captures that nature of complexity is linear.
• If the GSC value is zero then VAF is 0.65. So the graph starts from
UAFP*0.65.GSC = 35 AFP = UAFP. So the VAF = 1.
• When GSC < 35 then AFP < UAFP. That means complexity decreases.
• When GSC > 35 then AFP > UAFP. That means complexity increases.
Readers must be wondering why 0.65? There are fourteen GSC factor from zero to five.
So the maximum value of VAF = 0.65 + (70/100) = 1.35. In order that VAF does not
have any affect i.e. UAFP = FP VAF should be one. VAF will be one when GSC is 35 i.e.
half of 70. So in order to complete value “1” value “0.65” is taken. Note value is 0.35
when GSC is 35 to complete the one factor “0.65” is required.
But following is the main problem related to GSC. GSC is applied throughout FP even
when some GSC does not apply to whole function points. Here’s the example to
demonstrate GSC problem.
Page 60 of 215
Let’s take 11th GSC factor “installation ease”. The project is of 100 UAFP and there is
no consideration of installation previously by client so the 11th factor is zero.
Page 61 of 215
Table :- GSC with Installation ease 5
So VAF = 0.65 + (23/100) = 0.88 so the FP = 100 * 0.88 = 88. The difference is of only
5 FP which from no way a proper effort estimate. To make an auto updation for a software
versioning can no way be done in 5 function points , just think downloading new version,
deleting the old version , updating any database structure changes etc etc. So that’s the
reason GSC is not accepted in software industry. Best ways is baseline you’re UAFP and
make your estimation on base of UAFP.
Major software project fail not because of programmer’s or project managers but due to
moody and changing customers. In one of our huge projects we had good programmers,
very enthusiastic. The project started of well but customer called ten times in a day to
change something or other. Believe me programmers get pissed if the customer is changing
his plans every fortnight. Well from this book point of view we have to evaluate this
changes which can be addition or deletion of requirements. Function point group has
come out with a methodology called as “Enhancement Function Points”.
ADD: - This is new function points added. This value is achieved by counting all new EP
(Elementary process) given in change request.
CHGA: - Function points which are affected due to CR. This value is achieved by counting
all DET, FTR, ILF, EI, EO and EQ which are affected. Do not count elements which are
not affected.
VAFA: - This is VAF factor which is because of CR. Example previously the application
was desktop and now is changed to web so the GSC factor is affected.
DELFP: - When CR is for removing some functionality this value is counted. It’s rare that
customer removes functio nalities (at least in India), but if they ever estimator has to take
note of it by counting the deleted elementary process.
Once we are through with calculating enhanced function points, it time to count total
Function points of the application.
Page 62 of 215
UFPB: - Function points previously counted before enhancement.
ADD: - Newly added functionality which leads to new function points after enhancements.
Enhancement function points is not covered from practical angle in this book and is left
to the user’s as exercise. CR (Change request) is covered in more detail in Change request
chapter.
In order to use FP in our project in easy fashion we will be using function point excel
template to automate our estimation. In both Jobsite and chat application you can find the
estimation sheet. When you open the sheet you can see the below section as shown in
figure below. Total Estimation has the full consolidation of the estimation.ILF, EIF, EO,
EQ, EI and GSC serves as an entry she et for all the necessary inputs.
The main Action takes place in total estimation sheet. Below is the image snippet which
shows the various sections in the total estimation sheet. Let’s try to understand in numbered
fashion what exactly the sheet means:-
1 - These columns are pulled from individual ILF, EIF, EI, EO and EQ sheets.
2 - This column (Unadjusted function points) is the total of ILF, EIF, EO, EQ and EI.
3 - GSC is the total of all GSC section from the GSC sheet.
4 - Based on GSC we get the total adjusted function points. Please refer the function point
chapter in case you have doubts regarding what is EI, EO, EQ etc. We also input how much
FP a programmer can complete in one day. This depends on what kind of programmer are
you recruiting on the project. For instance if you have seniors in your project then you can
enter probably 2 FP per day as seniors will be more productive.
Page 63 of 215
5 - Here we distribute percentage wise man days according to the SDLC phases. But one
important point to be noted is the total FP is nothing but the execution phase of the project.
So we need to assign 100 % to execution and from that 100 % we take whatever percentage
and distribute it to the other phases.
6 - In this column we define how many developers will be working on the project.
Note: - You can also watch the video explanation of the FunctionPoint
Template from the CD. In this book we have shipped a complete book “How
to prepare software Quotation”. This free E-book basically explains in
detail manner other estimation technology widely used in projects.
Testing Document
The success of every project is test, test and test. All the professional projects in this CD
have a test plan at the end. Below is the simple paste of a sample. This is basically an
address application. The below action is when user updates the address. So basically we
define steps with pass and failed conditions.
Page 64 of 215
Update Address
Note :- All the professional projects in this book will all have the
above documentation in project folder. That means every professional
project will have use case document , test plan , estimation and a
technical document.
Why OOPs
Object oriented programming enables programmers define not only the data, but also its
associated behaviors/functions that can be applied to the data. It also enables programmers
to create relationships between one object and another. For example, objects can inherit
characteristics from other objects.
To understand the importance of OOP we need to first understand the problem with
procedural/structural programming practices. Procedural programming was suitable for
small projects. But as the program grew in size, along with it grew the maintenance
nightmare. Also, since the modules were tightly integrated changes in one part of the
module inadvertently breaks the other part. Team development was not truly achievable.
The next big problem with procedural programming was with respect to reusability. It was
very difficult to write truly reusable code, with minimum maintenance.
So why OOP? OOPs facilitates code reuse, team-development, eliminate redundant code,
easy management of software complexity etc. To understand how OOP practices enable us
to write better, maintainable software, we need to understand some of the fundamental
aspects of OOP.
Page 65 of 215
Fundamentals of OOPS
To understand the fundamentals of OOPS, we need to be familiar with some of the terms
programmers frequently use while developing object oriented software.
Abstraction
Abstraction refers to the act of representing essential features without unnecessarily
including the background details or information i.e. representing a complex problem in
simple terms. Classes provides a mechanism to abstract the required attributes such as first
name, last name in case of “Person” class and functions to operate on these attributes.
Classes are also known as “Abstract Data Type or ADT”.
Inheritance
Inheritance is a technique with which an object of one class acquires attributes and
behaviors from an object of another class. This is one way to achieve reusability in OOP.
Inheritance models “is-a” relationship. For e.g. a “car” is an automobile. In this case
the “automobile” is called the base class and “car” is called as derived class or inherited
class. This type of reuse is often called white-box reuse. This term refers to the fact that
with inheritance, the parent class implementation is often visible to the subclasses.
Below is how practically encapsulation and inheritance is implemented in C#. The “:” says
that clsJobSeeker is the child of clsUser class and that’s how we define inheritance in C#.
The private key shows how the complication is hidden from the external world.
Page 66 of 215
private string _SurName;
private string _Address;
private string _PhoneNumber;
}
Composition
When reuse is achieved by composing another object, the technique is known as
composition. Composition models “has-a” relationship. This approach requires that the
objects have well-defined interfaces since the internals of the objects are unknown.
Because objects are treated only as "black boxes," this type of reuse is often called black-
box reuse
Below is the code snippet which shows how composition is implemented in C#. Ine the
below scenario clsUser is composed of clsMenus objects. So we create clsMenus object
inside the clsUser class.
Polymorphism
The ability of different objects to respond to the same message in different ways is called
polymorphism. Polymorphism is also the ability of an object to take more than one forms,
for e.g. an operation may exhibit different behavior in different instances. The behavior
depends upon the types of data used in the operation. There are basically two types of
polymorphism i.e. static and dynamic polymorphism. Method overloading is an example
of static polymorphism whereas overriding would be an example of dynamic
polymorphism.
Below is how we implement polymorphism in project practically. There are two methods
Login and Login with userId. So if the external consumer who is using this component
calls only the login method it loads all the user and if they pass the userid then it will load
only that user details.
Page 67 of 215
Message
An object in isolation is of no use. Its value comes from its interactions with other objects.
This interaction takes place through messages. A message consists of three parts
(i) A receiver object
(ii) A method the receiver knows how to execute
(iii) Parameters, if any.
Cohesion
Cohesion is a measure of how much an item, say for e.g. a class or method, makes sense.
Objects with low cohesion are more likely to be changed. A method is highly cohesive if it
does one thing and only one thing. High cohesion is desirable.
Coupling
Object coupling describes the degree of interrelationships among the objects that make up a
system. The more any one object knows about any other object in the system, the tighter
the coupling is between those objects. In other words, coupling is a measure of how two
items, such as classes or methods, are interrelated. When one class depends on another
class they are said to be coupled. When one class interacts with another class, but does not
have any knowledge of the implementation details of the other class they are said to be
loosely coupled. When one class relies on the implementation of another class, they are
said to be tightly coupled. Always try for loose coupling among objects.
Abstract Class
Abstract are classes that cannot be instantiated, and are frequently either partially
implement ed, or not at all implemented. Abstract classes are useful when creating
components because they allow you specify an invariant level of functionality in some
methods, but leave the implementation of other methods until a specific implementation of
that class is needed. When implementing an abstract class, you must implement each
abstract method in that class, and each implemented method must receive the same number
and type of arguments, and have the same return value, as the method specified in the
abstract class. Classes can inherit from only one abstract class.
Interface
An interface is a reference type and it contains only abstract members. We cannot have
any implementation code in the interface. The interface contains only declaration for its
members. Interface’s members can be events, methods, properties and indexers. An
interface is also known as a “contract”. The entire client which uses the interface must
fulfill the contract by implementing the interface. A class can implement multiple
interfaces.
Page 68 of 215
Decide between Abstract class and Interface
If you want to provide common, implemented functionality among all implementations of
your component, use an abstract class. Abstract classes allow you to partially implement
your class, whereas interfaces contain no implementation for any members.
If the functionality you are creating will be useful across a wide range of disparate objects,
use an interface. Abstract classes should be used primarily for objects that are closely
related, whereas interfaces are best suited for providing common functionality to unrelated
classes.
Below is how interface and abstract classes are used in project. In order to define a
interface we use the interface keyword and to define abstract class we use the abstract
keyword.
Note :- 60 % of the software projects do not use OOPS or are either far
from the reality of OOPS.In this project book have a close look ah the
chat application and job site of how the classes are made.
In today’s competitive world no language can come up if there is no RAD tool companion
with the language. JAVA has ECLIPSE, VB6, VC++ and VFP had Visual studio and so on.
In the same way C# and VB.NET have Visual Studio.NET as the RAD tool. As this is a C#
Page 69 of 215
projects books lets get introduced to this beautiful tool which will help us to develop C#
projects effectively and in more speedy manner.
When you try to create new project using VS.NET you will see something as show in the
below figure. On the right hand side pane you can see different project templates like
Windows application, Class library etc. But let’s not get confused by all the templates at
once. Concentrate on the two important templates “Windows Application” and “ASP.NET
Web application”. On the left hand side of the pane you can see you can create these
templates using any of the languages.
Page 70 of 215
Figure 3.2: - Complete IDE view
When you open a new project using Visual Studio.NET you will see a complicated
environment as shown in the above figure. Don't panic....You remember the first time you
took a drilling machine to put nails on the wall and found how complicated it was as
compared to a simple hammer. But surely as time passed by you praised the effectiveness
and speed by which you can use drilling machine rather than hammer.
The above whole environment is called as the IDE (Integrated development environment).
The major part of the whole IDE is occupied by the designer pane (its marked with double
head arrows as shown above).On the left hand side you can see the tool box which has
reusable components like text boxes , combo box etc which you can drag on the designer
pane. On the right hand side of the pane you can see the solution explorer. Solution
explorer gives view of your files and folder structure in your project. In order to build the
project yo u can click on the build option. You have two options one is you can build the
project or you can build the solution. Solution is a combination of one or more projects
(We will come to projects concept when we actually develop the project).
Page 71 of 215
Figure 3.3: - Compile, Debug and Run C# Projects
In order to run the application you will need to press F5 or click on Debug – Start. If you
get the above screen you have already made your first C# project. Definitely it has no
practical importance….But yes you did it.
When you created the above application you will see the designer has some code which is
already present by default. Let’s try to understand this sample code as we will frequently
come across it. Below figure depicts the pre-defined code inserted by the designer.
Page 72 of 215
Figure 3.4: - Code walk through for Windows application
A Windows Form is a Windows Form because it inherits its functionality from the
System.Windows.Forms namespace. This namespace is used across all .NET languages
that must implement Windows Forms applications. All windows application will follow the
above sequence defined in the image. The main entry point of the application is the “static
void main ()” method. You can also see “[STAThread]” attribute marked on the method.
This attribute is especially meant for COM Interop used in application. The “[STAThread]”
ensures that the thread in which the application runs is single threaded. With single
threaded model we can ensure that communication with COM components works perfectly
well. COM components run under single thread apartment and it’s essential that the entity
using him sho uld also run in a single thread.
In the above figure we have also mapped the sequence with code snippets. So you can
easily visualize that there are four important sequences and below is a detail explanation of
the same:-
• The first code snippet to execute is the main entry method i.e. Static void Main ().
This is the entry point for any windows application.
• Second section which is executed is the constructor of the form or UI. Every form
is a class. The constructor in turn calls the InitializeComponent() method.
• The InitializeComponent () section is the section where you can do all initialization
activity. Because InitializeComponent () is called by the constructor it will be
executed only once when the form object is created. InitializeComponent () section
can also be used to bind the event handlers with the method names.
Page 73 of 215
• The InitializeComponent () section then triggers the Form1_Load event.
The IIS
In this section we will discuss about IIS (Internet Information Service) which is basically
an answer to Microsoft’s web server.
As you see from below figure the web server sits between the websites & end user.
Here is the process how it actually interacts with the server:-
• User request for a website from his browser. for e.g. :- www.questpond.com
• The webserver processes the page and sends back the HTML/ASP page back to the
end user.
Page 74 of 215
Figure 3.6: -.NET and IIS
Now we have understood the fundamental of IIS. Let us try to understand how VS.NET
interacts with the IIS.
As you can see in the below figure. The developer opens the VS.NET and request
visual studio to create a web project. VS.NET then creates a project file on IIS.
From the below figure you can see visual studio creates project which is default named as
“webapplication1” with some default files.
The default important files created are:-
• WebApplication1.csproj
• Global.asax
• AssemblyInfo.cs
• Web.config
• Webform1.aspx.cs / resx / .aspx
• Webapplication1.csproj file: - This file is like a index file and also defines
which file is present in a visual studio project. We always open this file using
VS.NET and that in turn loads all the other files. As you can see in the below
figure we have opened “csproj” file in notepad you can see that it is actually
pointing towards other file such as assemblyinfo.sys etc.In short, it is a file
which says what kind of file are present in a project.
Page 75 of 215
Figure 3.8: - CSproj data
• Global.asax file: - It allows you to write code in application level event. If you
open global.asax file you will find the following events. Try to open in notepad
you will come across many events. So let’s understand the events in more detail
fashion. The first four events are very important rest all are included for
knowledge sake which are as follows :-
• Application_Start: This event happens once in the beginning when any user
hits IIS application. Once this event has occurred it does not happen again
for every user.
• Application_End: In end when application ends this event happens. It is
used to cleanup memory and variables. When we say application end it can
Page 76 of 215
happen both when the server restarts, when IIS resets and when you change
the global.asax.
• Session_Start: This event happens when any new user visits the websites.
• Session_End: This event actually happens when user close the browser.
Page 77 of 215
Figure 3.10:-assemblyinfo.cs file
3) Web.config file :- This is the most important file in the web project. This is used to
define settings for ASP.net application. It is basically in XML format. Lets try to
open in notepad and understand in detail the web.config file which are as follows:-
Web.config file is a perfect place to save application configuration settings in ASP.net.For
instance, if we consider database connection string it can be placed in web.config file and
can easily access in ASP.net.and connection can also be changed to other database server if
required.
Lets have a look on example of Web.config file:-
Page 78 of 215
</appSettings>
<system.web />
</configuration>
Page 79 of 215
Impersonate is act by which application (ASP.NET) is executed by authenticated
(ASPNETWindows) account while accessing is provided by IIS. Here we can specify an
specific account instead of ASPNET Windows account by changing the syntax as follows
The ASP.NET Web.config file can control many more settings like Session State, Tracing
and Authorization & Authentication etc.
Below is the figure, where it shows ASP.net lifecycle in action. In the below figure you
will find two sections the left section is the sequences of events happens and the right
section shows actual coding which happens behind ASP.net.
The whole point is to understand the sequence of events to put right code in right event. As
we dive in to projects you will easily able to map the below events.
Page 80 of 215
Figure 3.15: - ASP.NET page life cycle
We have avoided using SQL 2005 in this book because for that we need VS.NET 2005 and
.NET 2.0 and this book is targeted for huge audience so we have kept backward
compatibility. “SQL server express edition” is the scaled down form of SQL 2005 you can
download from “http://www. microsoft.com”.
MSDE is a royalty free, redistributable and cut short version of the giant SQL SERVER
database. It’s primarily provided as a low cost option for developers who need database
server which can easily be shipped and installed. It can serve as good alternative for
Microsoft Access database as it over comes quiet a lot of problems which access has.
Below is a complete list which can give you a good idea of differences:-
• Size of database: - MS ACCESS and MSDE have a limitation of 2GB while SQL
SERVER has 1,048,516 TB1.
• Performance degrades in MSDE 2000 when maximum number of concurrent
operations goes above 8 or equal to 8. It does not mean that you can not have more
than eight concurrent operations but the performance degrades. Eight connection
performance degradation is implemented by using SQL SERVER 2000 work load
governor (we will be looking in to more detail of how it works). As compared to
SQL SERVER 2000 you can have 32,767 concurrent connections.
• MSDE does not provide OLAP and Data ware housing capabilities.
• ?MSDE does not have support facility for SQL mail.
• MSDE 2000 does not have GUI administrative tool such as enterprise manager,
Query analyzer or Profiler.
But there are round about ways by which you can manage MSDE 2000:-
• Old command line utility OSQL.EXE.
Page 81 of 215
• VS.NET IDE Server Explorer: - Inside VS.NET IDE you have a
functionality which can give you a nice GUI administrative tool to
manage IDE.
• ?SQL SERVER WEB Data administrator installs a web based GUI
which you can use to manage your database. For any details refer
http://www.microsoft.com/downloads/details.aspx?familyid=c039a798
-c57a-419e-acbc-2a332cb7f959&displaylang=en
• SQL-DMO objects can be used to build your custom UI.
• There are lots of third party tools which provide administrative
capability GUI (Graphic User Interface).
• MSDE does not support Full text search.
Installation of MSDE
Let us make walk through of how to install MSDE and create database objects.
• Run “MSDE2000A.exe” from CD and click ‘install’ > accept agreement ‘I agree’
> select target folder for installation shown as below.
Page 82 of 215
• Once the installation is completed we need to create new instance in which we can
create database as shown in the figure below we need to run the setup command
prompt with the following parameter using instance name, password and security
mode as shown in the figure.
‘sa’ password specifies password for ‘sa’ user in SQL server.
Page 83 of 215
Figure 4.4: - Start the service
• Now let us connect to MSDE instance using the client tools so click on Start >
Program > Microsoft SQL server > click ‘Enterprise manager’ > click ‘Microsoft
SQL server’ > right click on SQL server groups > click new SQL server registration
> Add server, while adding server you need to do as our example
“PERSONAL/MyJobsite” and click “add” button > authentication mode, if you
remember while creating instance we have given mode as ‘SQL’ so we need to
follow the second option in the authentication mode dialog box i.e. SQL server
login > add user ID and password for SQL server, if you remember we have
provided ‘sa’ user and ‘sa’ password so add the same and click ‘Finish’. SQL
server should be registered to your Enterprise Manager.
Page 84 of 215
Figure 4.6: -Connectionstring setup
• In order to create database, right click on database > click new database > give
database name.
In order to manipulate and create object in database we need to use SQL (Structured Query
Language). Let us make a quick walk through of basic SQL syntax in order to run SQL
commands we need to open Enterprise Manager > click on ‘Tools’ in the menu bar > click
on ‘SQL Query Analyzer’. This will open up a window where you can write a command
and execute the same as the below screen shots.
Page 85 of 215
Figure 4.8: - Running the query analyzer
Below are the basic SQL commands which you need to create new project and then
• CREATE TABLE: - This command creates a login table with two fields, user name
and password and both field are of 20 characters each.
• INSERT: - This command inserts data into the login table with the value (user name
= shiv1 and password = shiv1).
• SELECT: -This type of command selects all the data from login table.
• SELECT with criteria: - This will select the data where [user name = “shiv1”] is.
• UPDATE: - This SQL command updates the password for the given user name.
• DELETE: - This basically deletes the particular value from the login table.
ADO.NET basics
ADO.net is the latest kid on the data access framework block. ADO.net works in
disconnected mode unlike earlier data access technologies which used to work in connected
mode. What this implies is that, connection is made to the data store as and when only
required i.e. while reading or updating data. ADO.net uses XML (Extensible Markup
Language) behind the scenes as is indicated in the figure below.
Page 86 of 215
Below is the simplified diagram view of primary objects in the ADO.NET object model.
Here in ADO.NET classes are divided into two sections: -
• Consumers
• Data providers.
• SQL Server Database
The two main components of the ADO.net architecture are the Data Provider and the
DataSet.
Let us dig into the details of the ADO.net architecture. The .NET framework class library
provides the following namespaces that contains types for ADO.NET.
• System.Data
• System.Data.Common
• System.Data.OleDb
• System.Data.SqlClient
• System.Data.SqlTypes
• System.Data.Odbc
Page 87 of 215
Introducing the .NET Data Providers
The connection object in ADO.NET provides us a way to connect to the data source.
Connection object also supports transactions. Let’s have a look at some of the important
properties and methods of the Connection Object.
Page 88 of 215
• DataSource: This property represents the source of the data store. In the
OleDbConnection class, this property represents the path and filename of the data
source. In the SqlConnection class, this is the name of the instance of database
server to which to connect.
• State: This property represents the state of the connection. Its value is a bitwise
combination of the members of the System.Data.ConnectionState enumeration i.e.
Broken, Closed, Connecting, Executing, Fetching and Open.
The following are the common methods of the connection cla sses:
• Close: This method is used to close the database connection. If connection pooling
is enabled, the connection object is returned to the pool. Closing a connection rolls
back any pending transaction.
• Dispose: As usual once we are done with the work, we can clean up the resources
by disposing off the connection. This method destroys the connection object.
Page 89 of 215
Let’s see an example of connection object in action.
So, now you have got a basic idea of how to connect to different databases. See the
similarities in the above code. Just use the correct connection object and you are done with
it.
The command object represents an SQL statement or stored procedure that can be executed
on the server.
Page 90 of 215
• CommandText: The SQL statement or the name of the stored procedure to
execute at the database server.
• Connection: This represents the connection object used by the Command object.
• CommandTimeout : The number of seconds the command object will wait before
terminating and attempt to execute a command. On timeout and exception is
thrown.
• Parameters : This property represents the collection of parameter object within the
command object.
• Transaction: This property represents the transaction object with which the
command object is associated.
• ExecuteScalar: Executes the command object’s query that returns a single value.
This is one of the way by which you can optimize your query where only single
value is returned.
Page 91 of 215
• Dispose: Releases the resources on the Command object. Used to force garbage
collecting, ensuring no resources are being held after our connection is used.
Incidentally, by using the Dispose method you automatically call the Connection
object's Close method as well
Page 92 of 215
/// Associate the connection object with the command object
cmd.Connection = con;
Hopefully, you get your feet with the command object too. Let’s see what’s more in store
for us.
Understanding DataReader
DataReader plays a very important role in the overall ADO.net framework. The
DataReader is the read-only, forward cursor over a rowset of ADO.NET data. The
DataReader is implemented in ADO.net as SqlDataReader, OdbcDataReader, and
OleDbDataReader etc. It’s important to note that the all the DataReader class implements
IDataReader interface. So, if tomorrow you need to write your own DataReader for your
own customized database, then you know what to do.
When you get the results into the DataReader, its’ important to note that the “cursor” or
logical row pointer in the returned data is just before the first row. So, you need to call
.Read() method once to read any data. Read() will return true as long as there is an
additional row to be read.
• Read: The read method moves the record pointer to the first row, which allows the
data to be read by column name or index position.
• HasRows: This method is introducted in .NET v1.1. HasRows checks if any data
exists, and is used instead of the Read method.
Understanding Dataset
Data Set is the memory representation as shown in the figure below. DataSet can be
considered as simplified RDBMS in memory. One of the most important features of
DataSet is that it always gets disconnected from database; in short it does not know which
Page 93 of 215
data it is carrying and also goes a step further that it can contain data from multiple
databases.
DataSet is composed of two primary objects: -
• Data table collection: - Object that has multiple data tables and in turn data tables
have rows, columns and constraints.
• Data relation collection: - Object contains one or more data relation. Data relation
provides simple way of navigating from master row in one table to related row in
another table for example you can navigate from a customer table to customer’s
address table using data relation collection object within a data set.
Page 94 of 215
both DataAdapter object and Connections object as private properties and also
adds some additional functionality that makes connecting to data source both
simpler and more powerful.
Understanding Dataset
• DataReader provides forward-only and read-only access to data, while the DataSet
object can hold more than one table (in other words more than one row set) from
the same data source as well as the relationships between them. Dataset can move
back and forth as compared to datareader which can only move in forward
direction.
• Dataset is a disconnected architecture while DataReader is connected architecture.
• DataSet can persist contents while DataReader cannot persist contents, they can
only forward it.
Sample code
Now that we have gone through the theory of ADO.NET let us look at one complete
sample code for the same. In the below code snippet we are going to call a
“StoredProcedure” – “getUserByUserNameAndPassword”. This “StoredProcedure” takes
two parameters “UserNameAndPassword” below sample code is numbered and let us try
understand the same: -
(1) In this step we open the connection object “SqlConnection” class takes the
connection string as an input to its constructor.
(2) and (3) As said before, the “StoredProcedure” takes two parameters
“UserNameAndPassword” in these two steps we create the command object and
two parameters objects. The command object has two important parameters
“CommandType” and “CommandText” we have set the “CommandText” to store
procedure name and “CommandType”as store procedure.
(4) and (5) Now we open connection object and SQL data reader object.
Page 95 of 215
Figure 4.13: - ADO.NET basic code
In the previous section we have looked at various steps to connect to database using
ADO.NET. But in actual projects it is difficult to write all these steps again and again for
every stored procedure. Microsoft made one step advanced by introducing “Microsoft
Enterprise Library” to increase reuse and bring down the development time. So let us look
at how to use ‘Microsoft Data Application Blocks’ to increase the productivity in the
project.
Page 96 of 215
Figure 4.14: - Path of the Data application block DLL
Once you have installed ‘Microsoft Data Application Blocks’ setup you will get the
following files as shown in the figure below you need to get refer the
‘Microsoft.ApplicationBlocks.Data.DLL’ in your project and also include the same
namespace using the statement “using Microsoft ApplicationBlock.Data;”. Below is the
code snippet which calls the same stored procedure which was shown in the previous
section. If you count the number of code lines it has been reduced from “15 lines” to “1
line” as shown in the below figure.
Page 97 of 215
Figure 4.16: - One line execution
This book we have divided in to two parts the fun part and the professional part. There are
two projects in fun part and three projects in professional part of the book. The main
intension of segregating in two parts is one is for warm up and the other is moving towards
professionalism. So the fun part will be more of logic warm up and the second section will
be targeted towards becoming professionals. It’s like growing up from a junior programmer
to a senior programmer. So lets start the journey of a developers life from rags to riches.
Let’s start with a small project on Mandelbrot. Are you confused by the name or you must
be thinking what kind of project is this. Well it’s interesting and will make your first C#
Page 98 of 215
project more interesting. Let me give you some gurugyan (Knowledge) about Mandelbrot.
We are going to go bit mathematical in this so tolerate me. But yes just as we enter maths
below figure shows the mathematical art generated by Mandelbrot and yes we are going to
display the same thing.
Now that you have understood complex numbers lets move ahead to understand
Mandelbrot set. Mandelbrot set is set of numbers which reside inside the set. To determine
that is whether a number is inside the set or outside the set we use the following equation:-
Page 99 of 215
Z = Z2 + C
C is the number we are testing. Z starts out as zero, but it changes as we repeatedly iterate
this equation. With each iteration we create a new Z that is equal to the old Z squared plus
the constant C. So the number Z keeps changing throughout the test. As we iterate our
equation, Z changes and the magnitude of Z also changes. The magnitude of Z will do one
of two things. It will either stay equal to or below 2 forever, or it will eventually surpass
two. Once the magnitude of Z surpasses 2, it will increase forever. In the first case, where
the magnitude of Z stays small, the number we are testing is part of the Mandelbrot set. If
the magnitude of Z eventually surpasses 2, the number is not part of the Mandelbrot set.
So was we test and plot the graph we should get the above image. So what are you guys
waiting for lets get the above decent Mandelbrot image.
Code explanation
The keyword struct can be used to declare a structure. The general form of a structure
declaration in C# is as follows.
Where the modifier can be private, public, internal or public. The struct is the required
keyword.
For example
The objects of a struct can be created by using the new operator as follows.
The individual members of a struct can be accessed by using the dot (.) operator as showing
below.
mstruct.x = 70;
mstruct.y = 90;
Remember that unlike classes, the strcut object can also be created without using the new
operator
The structs in C# seems to similar to classes. But they are two entirely different aspects of
the language. The classes are reference types while a struct is a value type in C#. The
objects of class types are always created on heap while the objects of struct types are
always created on the stack. But C# structs are useful for small data structures that have
value semantics. Complex numbers, points in a co-ordinate systems etc are good examples
for struct types.
So the below code structure snippet has one structure and 3 classes.The structure represent
the complex number. MandelBrot and Julia class inherit from the fractal class. The one big
reason why MandelBrot and Julia class is inheriting from fractal is because they have lot of
things in common. So below is the numbered explanation:-
2 - Fractal abstract class which has some basic methods which will be then overridden by
its child classes MandelBrot and Julia.
3 , 4 - The final solid classes which define the implementation for Julia and MandelBrot.
1 - clsFractal.cs is the file in which we have one structure and three classes as explained in
the previous section.
1 - The private properties m_Real and m_Imaginary which will hold value of the complex.
Below is the code snippet of the three classes Fractal, MandelBrot and Julia. Fractal forms
the parent class. MandelBrot and Julia inherit from Fractal class. In both the constructur we
have defined the boundary between which the plot should happen. You can see in the code
snippet below 1 and 2 define the boundary of the corner and side for MandelBrot as well as
Julia respectively.
In the Fractal class we have an inner class called as ColorMap. This inner class
loads the 256 color array in in- memory so that we can use the same to plot the
graph. Below is the numbered explanation of the same.
2 and 3 define the factor and the construct the color array of 256 colors.
4 - Use the FromArgB function to fill the array with all color values.
The whole point of making this method is basically we do not need to construct the
whole color array again and again.We have also made the Color() array static so
that it stays in memory and shared across all objects.
The draw function forms the heart of the project. Below is the code snippet. We
have numbered the same so that we can understand every line of it.
1 and 2 - We create a Bitmap object with a specific height and width on which we
will draw the Julia or the MandelBrot set.
3 - Create the object of the complex structure with the range within which the
complex number should fluctuate.
4,5,6 and 7 -- Loop with the given width and iterations. Also use the color array
defined in the static object to plot the graph. We are using drawrectangle to plot the
results.
Note: - Though this project is simple and does not really construct
somethng fruitful. But it can serve as good warm project for start up.
There is also a video of the mandelbrot code walkthrough in the CD. You
can go through the same for better understanding.
In this chapter we will develop a simple file search application. Following are the key
features of File search module:-
• User should be able specify the folder location in which file and its contents has to
be searched.
• User should be able search files by File name, Keyword and File type.
File System
As the whole project is based on searching files, we need to understand how file system
works in .NET. The System.IO namespace offers classes, methods, and properties that are
necessary for working with directories and files. As such file system is huge by itself but
we will only see what’s needed from the current project perspective. We need two things
from the project perspective browse the folders , browse files with in folders to check if the
any file with that name exits and read the file contents so that we can check if the keyword
exist in the file contents.
using System.IO;
If you want to browse through the directory we can use GetDirectories from the Directory
class. Be low is the code snippet for the same. strDirectory is the directory which is
browsed.
If you want to browse the files you need to use the GetFiles function from the Directory
class. strDir is the directory and strFiletype specify which types of files to be searched for
instance *.doc , *.txt etc.
If you want the read the file we can use the FileStream and the stream reader class. To read
a file is a five step process. Below is a sample code snippet with detail commenting.
Threading Concepts
In order the application does not hang we need move the entire heavy duty search on a
different thread. You must be wondering what is heavy duty in this project. The below
figure will give you a clear indication of the heavy duty we will be performing in this
project. Below figure shows a folder structure for SQL Server directory. Let’s say we want
to find the defaultaliases file. In order to find default aliases you need to make seven
recursive. The file is lying in the 1033 folder. So you start from the top branch Microsoft
SQL Server and go on inside recursively searching for the file.
[STAThread]
static void Main()
{
Application.Run(new frmFileSearch());
}
In short our heavy duty recursive logic should run on a different thread. Below is the code
snippet of how to use threads. Thread is created by using the thread class and passing the
method which will run on the thread.
One more core concept we will need in this project is delegates and events. It’s possib le to
code this project with out using delegates and events but then there will too much heavy
coupling between modules.
Note: - There are two types of programmers one who can complete a project
and the other who completes a project with elegancy and proper decision
making. Such kind of small decision while implementing projects shows the
programmers thinking and the approach.
Event-based programming is one of the features of object oriented programming. The main
purpose of events is to decouple functiona lity of one object from other object that will
depend or use it. Second using events are clean approaches to implement asynchronous
mechanism.
As said before the file recursive search is a heavy duty mechanism. So here’s what we will
like to do we start the file search recursive mechanism and go to do something else. This
recursive mechanism logic then runs on a separate thread. When the logic receives some
In order to achieve events in .NET we will need to use delegates and events. A delegate is
like a pointer to a method. Unlike a simple function pointer, delegate is type safe. We
define a delegate to specify the signature of methods we would like to call through the
delegate. We can then create a delegate object and bind it to any method whose signature
matches that of the delegate.
simpleDelegate();
Now let’s try to understand the second concept what are events? Delegates are main bricks
for events in C#. Any event has a publisher and a subscriber as shown in figure below. The
publisher pushes events and subscriber then uses those events to call the event handlers.
There are total five steps to get events working in C#. Three at the publisher end and two at
the subscriber end.
• Declare a delegate
In the next section you will be clearer on how we will be actually using Events and
Delegates for this project.
Above is the class diagram it has two entities one is the GUI which is “frmFileSearch” and
the other is the class “clsFileReader”. “frmFileSearch” is the main UI which was shown in
overview section of this project. “clsFileReader” class is responsible for the following
functionalities :-
• Browse directory.
• Browse files with in directories
• Raise events when its finds a match to the “frmFileSearch” UI.
frmF ileSearch class is the UI of the project and is responsible for the following
functionalities :-
• Capture from the user folder path, file name to search, keywords etc.
• Display results on the data found.
Code Explanation
Note: - You can find code walkthrough for this application in video “File
Search code walkthrough” in Video folder. You can find code in the source
code folder in “File Search” folder.
In this section we will make a code walkthrough of important code snippets in the file
search project. First let’s make a code walkthrough of clsFileReader class. It has two
delegates FoundContent (this delegate will be called when keywords are found in the file
content) and FoundFile (this delegate will be called when file name specified is found in
the directory). For each of these delegates we have events objFoundContent and
objFoundFile.
We have defined four properties for the class which will set by the UI:-
We have defined two methods Search and Doesexist. Search method does a recursive
search to find the files. Below is the code snippet which defines the properties and
methods.
The most important part is the recursive search subroutine Search (). Below is the code
snippet which shows the search subroutine. We have put inline comments so that you can
understand the logic of the same.
// If there is keyword specified by the user then see that it exists with
// in the file contents.
if (strKeyWord.Trim().Length != 0)
{
if (doesExist(strFile,strKeyWord))
{
objFoundContent(strFile);
}
// In a directory we can have multiple sub directories. So make a
//recursive call to the Search() method again. This recursive call will
// continue until we have browsed all the directory inside the directory.
strDirectory = strDir;
Search();
}
}
There are two important for each loop in the above code. One for the directories and other
for the files inside the directory. The most important section is the recursive call which is
made to the subroutine itself so that we can browse any directory depth. You can see in the
above code snippet at the end we are calling the Search () method recursively.
The next part is the UI code. From the UI code the Search button click is where all the UI
action is happening.
After you have walked through the fun part it’s now time to become a bit professional. In
this section we will have professional projects with complete SDLC cycle, proper
documentation, architecture and estimation.
Reliable computers is a mid-scale organization mainly into selling of computers. For past
one year the company sales have grown into multiples geographical location. Currently in
order to give customer support Reliable computers uses phone to interact with his client but
this medium is not very cost-effective from small customer’s point of view. So the
company wants to builds Web Chat application. Where the small customers can have chat
with customer support engineers.
Following are the requirement for the Web Chat application:-
The difference between a programmer and a good programmer is coding with elegenace
and maturity. In order to see what the exact difference is between an ok programmer and
good programmer we will code the chat application twice. Once with a mind set of how an
ok programmer will code and one how a good programmer will code. In this section we
will look in to how an ok programmer will code. Then we will code the same application
with proper SDLC cycle. This will also clear differences between good and bad
programming.
Note :- In CD for the chat application we have two type of code one with
proper SDLC cycle which is present in ChatApplication folder. The other
folder NotPlannedChat has the chat application which is coded from an ok
ok programmer perspective.
2 - Login.aspx is the main login page. We validate that the user is unique in this section.
3 and 4 - Messages.aspx is the file which displays the messages sent by user.
SendMessage.aspx is the form in which the user types the chat message and sends it.
2 and 3 – If the user does on exists then we add the user to the arraylist and set
session(“UserName”) variable. saveToCache method updates the arraylist to the Cache
Users.
4 and 5 :- When the user clicks login command button we call the CheckDoesUserExist
method. In case if the user already exists in the cache users object it will throw an error.
We have also enclosed the checkDoesUserExist method in try catch and later displayed the
error in lblErrorMsssage label. If we do not have any errors in the checkDoesUserExist
method we transfer the control to Chat.aspx page using the server.transfer command.
Below is the code snippet of messages.aspx page. We have two types of cache object one
which stores users and the other stores messages. The user cache object was discussed in
the previous section. In this section we will look in to the other cache object i.e
cache[“Messages”]. Cache messages object stores the messages which are sent by the user.
So lets understand the below code snippet in numbered fashion.
1 and 2 - In the page load we load the cache users and messages object in two page level
variables arrayUserList and arrayUserMessages. So we check if the cache users or the
messages object is not null then load both the variables accordingly.
3 – LoadUsers and loadMessages sub routine loads the messages and users data in the user
interface control.
Below is the code snippet sendmessage.aspx page. Below is the numbered explanation of
the code snippet.
2 – addMessage subroutine adds the user messages to the array list with user name
appended. addMessage subroutine is called in every cmdSendMessage button click. If the
arrayUserMessages variable is updated that will also update the Cache[“Messages”] object
because both the objects are linked byref. When we say byref means any change in object
will also affect the other object. So any changes in arrayUser Messages variable will affect
Cache[“Messages”] data also.
Note: - Please read byref and byval fundamental from MSDN you will have a
good idea of what we are discussing.
If you run the above application it works fine. If you have read above code walkthrough it
will also make you think that it looks good. But as we said previously the difference
between a coder and a developer is quality code. Coder is a bad word given to any
programmer fo r the bad quality code. Every car runs but it’s important to evaluate which
one runs with elegance and efficiency. In the same fashion every code runs but we need ask
ourselves question will this code consume future changes, is it efficient , can it be taken by
new programmers for maintenance etc. So let’s try to understand what are the issues with
the above coded chat application.
• The first thing to be no ted in the above application if we have two cache objects one
for the user and other for the chat messages. So in case if we want to add room’s
future we need to add one more cache object. This leads to many scattered cache
object through out the application. This can lead to maintenance problems in future.
• The application is not object oriented which means that the application is not
flexible to consume future changes. For instance if we want to add room
functionality in the above application we need to change in lot of places.
So now that we know the issues with the above code. Let’s complete this project with
dignity like a developer. In the next section we will first start with estimation and then
move ahead with design document and execution
In the chat application folder we have given you the estimation document. In this section
we will explore how we have reached to that estimation. Currently, 27 man days is the
estimation for chat application project we will be using Function Points to estimate it.
We have identified two elementary processes in which data is received from the external
application boundaries for this chat application. Because it does not refer to any external
file and does not have sub groups so we have kept the values File Type Reference (FTR)
=1 and Record Element Types (RET) =1. Below is the EI table which is taken from
estimation sheet.
As shown in the EQ table below three elementary process showRoom, showUser and
displayMessage is retrieved from corresponding Internal Logical Files (ILF). These three
entities become EQ because results exit the application boundary (from the chat variables
on the web sites), it is retrieved from one or more ILF, and it is simple and meaningful
from user perspective.
As we know fundamentally ILF resides in the internal application boundary and are
maintained through elementary process. One of the most important criteria to identify ILF
is that they are logically related data from user perspective. In this chat application Rooms,
User and Message forms the ILF. While the Data Element Type (DET) values taken in the
table we have considered one complete DET for Rooms and Message but for User ILF we
have two DET, one is “user ID” and other is “Password”.
External Interface File (EIF), External Output (EO) and General System
Characteristic (GSC) explanation
In this chat application we do not have any externa l application so there is no EIF. We do
not have any complex query outputs which derive data from internal to external application
boundaries hence there is no EO. As it is a simple application we have kept all the GSC
value as 1.
Once all the counting is done we need to convert the Function Points into Man Days.
Below is the process of conversion as follows: -
• Calculating unadjusted Function Points.
• Calculating adjusted Function Points.
• Calculating Man Days.
• Distributing Man Days across SDLC phase.
Below is the figure which shows how man days are calculated for chat application.
Now let’s look at how we distribute the man days across the SDLC phase. One of most
important point to know is any estimation methodology always gives execution man days.
It does not consider time period for requirement, technical design and testing phase.
So the procedures of calculating is that the percentage of execution time is distributed for
every phase and finally added to execution of man days. For this Chat application we had
calculated 18.96 man days as the execution man days.
From 18.96 man days we have taken 20% for requirement stage, 20% for technical stage
and 5% for testing stage.
2 Sending messages
In ASP.NET we are provided with cache object. Any data in the cache object is shared
between all users connected to the same IIS website. But following is the difference
between the application object and cache object.
• Cache object are thread safe while application object are not.
• Cache can be configured to expire after specific number of seconds or depending on
changes happening to other entities like file, directories or external events this was
not possible with old application object in classic ASP.
For this chat application we will use cache object to share data between all the users.
Currently for this project we need to share chat messages, rooms etc which can be done by
the cache object. Below are the methods of the cache class.
In the below diagram we have also shown ho w session, application and cache object
works. Currently session is not related to the project but try to understand from
knowledge perspective. Session object are private to the users while cache and
application objects are shared between users. You can see in the below figure User1 ,
User2 and User3 have common application and cache object while Session1 , Session2
and Session3 are unique for every user.
Class diagram
• “clsUser” and “clsUsers” class:- In the below figure we have pasted the snap-it of
both classes. “clsUser” is a simple class with two properties ‘user name’ and
‘room’. ‘user name’ is the value which the user will enter on the log-in screen of the
chat application. “clsRoom” object is aggregated inside the “clsUser” class. This
room object signifies which room this user currently belongs too.
The “clsUsers” class has five methods which are as follows: -
o getRoom: - This function takes user name and returns back the room in
which the user is currently present.
o addNewUser: - This method takes two parameter user name and the room
object and associates the user with the room.
o removeUser: - It removes the user from the user’s collection.
o checkUser: - It checks if duplicate name exists in the user’s collection.
o getUser: - This takes user name and returns “clsUser” object.
The beauty of the “clsRooms” class is that it calls “clsRoom” for performing the
functionalities and “clsRoom” in turn calls either “clsMessages” or
“clsUsers” depending on the functioning. So one of the important things to be
noted is every class performs his work independly.
Code explanation
The project is divided into two main parts mainly into GUI and class library as shown in
the below figure.
Chat applications are very dynamic. The end user screen should be capable of seeing the
latest messages we some how need to ping the server for new messages so in order to
achieve this we have used the HTML metatag in “Messages.aspx”. As seen in the below
figure the metatag says to refresh the “Messages.aspx” page after every 10 seconds.
As we all know from class diagram “classrooms” is the main class of all the classes
(clsRoom, clsMessage) etc. As discussed before we will be using cache API to share
messages and rooms across the users. Below is the code snap it of the page load event of
Login.aspx pages.
The following are the sequences occurred in the page load event: -
• If the cache object is NULL it creates rooms object and assign it to the cache
object.
• If the rooms object are already present then it type casts from the cache object to
the module variable “objRooms”.
• Finally loads the rooms in combo box you can see final output page in the same
figure.
When the user is finally logged in the rooms below snaps are executed to display messages
and users.
Let’s try to understand the explanation of the code from below snap it: -
• The “objRooms” object is taken from cache object and currently logged in room.
Object is taken from the “objRooms” object taken from the session variable
Session[“RoomIndex”].
• The load user’s method loads the users in the room. The load messages method
loads the messages in the room.
NOTE: - The simplicity of above code is because of the proper class
diagram which shows relationship between users, rooms and messages.
Business Objects: -It contains objects required for the project such as ‘user.cs’ which has
self-contained clsUser and clsUsers class similarly other classes like Jobseeker.cs and
Menu.cs have their respective classes.
Business Validation: -It basically acts as a bridge between Business Objects and Business
Validation Library.
Business Validation Library: -It consists of all the validation required for the project.
Data Access: - It basically has the data access layer of the project. It uses the SQL Helper
class or Microsoft Application Blocks to connect to the SQL Server.
Documents: -It consists of Requirement, Design, Build, Testing and Delivery document.
Solution: -It has .sln file this unites all the project subunits together and to make the project
development more easy.
TheJobSite: - This folder consists of the UI (User Interface) part of the project.
GetServiceGetJobs: - It is clients to our projects which observes and see what jobs are
posted by the company and inform to the job seeker.
BACKUP: - It is basically back up of the database in our project so that you can load the
SQL server database very easily.
In this section we will understand how to load the complete Jobsite project.
• In the CD provided to you we have folder named “FullJobsite” copy this folder
from CD to your local drive for instance (c:) so after copying to local drive you will
have the following path written on the address bar “c:\ FullJobsite”.
• Go to the SQL server by clicking Start>Programs>Microsoft SQL
server>Enterprise Manager, you will be prompted with a screen ‘SQL server
Enterprise Manager’ in this window under the ‘console root’ there is a ‘database’
folder right click onto this folder and create ‘New Database’ with a name ‘Jobsite’
as shown in the following figure below
• After creating a database named ‘Jobsite’ we will now load a BACKUP of a project
provided in the CD and now in your local drive “c:\ FullJobsite\ BACKUP” with
the following steps: -
• As this project is web you need to do following changes before starting it. In the
‘FullJobsite’ folder there is a subfolder named ‘TheJobsite’, right click on
it>properties>click‘WebSharing’>add ‘TheJobsite’ folder as sharing as shown in
the following figure
• You have to provide the path where the ‘BusinessValidationLibrary.dll’ is. It should
be same as Figure (A) arrowed 1 = Figure (B) arrowed 1
Note: - we have kept the default user ID and password for the database.
Note: - once again have a check whether you have properly loaded the
database.
• After editing Web.Config file and making changes in the properties properly, press
the “ctrl and F5” key together, you will see a Login screen as shown in the
following figure and you have loaded the project ‘JobSite’ properly and ready to
run it.
Note – You can watch the Start jobsite video in case you have issues.
Quadra is a multinational company mainly into recruiting business over a period of time.
Quadra has now multiplied its business four times the current one. Till today the working
procedures are manually operated but due to recent heavy demand now the company is
thinking of going automated with the help of information technology. Quadra mainly acts
as intermediate between the jobseekers and the company trying to meet the needs of
employee and the employer so they want a website which can consume their current
workload so following are their requirements in bulleted form: -
Explanation of ILF
In this project we have six logical files which we maintain. Below is the image which
explains in details regarding the same. The description section defines which DET we are
referring to.
Because we do not have any complex output there is EO in this project. We are also not
referring to any external system so we do not have any EIF in this project.
There are two simple reports in the project. One is for the jobseeker which says which jobs
he has applied for and second report is for the company in which we display who has
applied for the jobs.
Explanation for EI
There are five EI’s in the project. If you make a walkthrough of the project you can easily
figure out which are the EI in the project.
Final Estimation
Below is the final estimation using 1.5 FP per day as baseline. Once all the counting is
done we need to convert the Function Points into Man Days.
Below is the process of conversion as follows: -
• Calculating unadjusted Function Points.
• Calculating adjusted Function Points.
• Calculating Man Days.
• Distributing Man Days across SDLC phase.
Below is the figure which shows how man days are calculated for chat application.
Now let’s look at how we distribute the man days across the SDLC phase. One of most
important point to know is any estimation methodology always given in the execution
point. It does not consider time period for requirement, technical design and testing phase.
So the procedures of calculating are that the percentage of execution time is distributed for
every phase and finally added to execution of man days. For this jobsite application we had
calculated 29.49 man days as the execution man days.
From 29.49 man days we have taken 20% for requirement stage, 20% for technical stage
and 5% for testing stage. By using two developers we can complete the project in 21.38
man days.
Below are the use cases for this project. In the first section we will have a pictorial look and
then a detail explanation for the same is given in a tabular format.
Below is the explanation of the ER diagram. Let us understand the ER diagram step by
step.
ER diagram basically gives you a idea how your database structure will look like.
Below is the Menu , MenuMaster and Login user relationship. The first diagram shows the
ER relation ship and the next the actual data. Menu Master table has the MenuName and
the ASPX page where it will redirect to when we click on the menu. The Login table is
simple with UserName , Password and the UserType. UserType will have value 1 when he
is a jobseeker and value 2 when he is a company. MenuUser table is a many to many
relationship table which defines the relationship of user and which menu they can see. So
in this table we have the UserType_FK and the MenuId_FK fields which define the
relationship.
In our project we have two types of user. So the Login table is further extended in two
tables Organization and the JobSeeker table. In both these tables the UserId_fk key defines
the relationship.
If you note one of the important requirement in the project is that validation has to be
flexible. Below is the ER diagram which shows the rules tables of the project. Rule tables
has basically all the rules of the project. Action has the action of the project for instance
Architecture Explanation
The Architecture is pretty simple if you think and pretty complex if you think. Below is a
bird eye view of the architecture. We have the following sections and corresponding is
there explanation:-
• UI: - This is the UI through which the user will interact with our system. Currently
it is the ASPX pages.
• Business layer: - This section has the business objects of the system like User,
Company, Jobseeker, Posting etc. Please note these are just value object and denote
strong type classes.
• Validation layer: - This section has all the validations of the project. Any business
object passes through this validation layer. This validation layer takes rules from the
rules table depending on action and applies to the object. Below is the code snippet
of the validation class. You can see from the figure below it is just a collection of
validations in the project.
Below are two figures one which shows the various section in the project and the other
shows how these section is mapped actually in the project.
In our project there are two types of user Jobseekers and Company Users. So we have three
classes as shown in the figure below clsUser, clsJobSeeker and clsCompanyUser. ClsUser
has common properties like Username, Password etc. clsJobSeeker and clsCompanyUser
then inherit clsUser to define user specific properties. clsBusinessValidation class is the
bridge who takes the business objects and validates the objects using
BusinessValidationLibrary project. Every business object will have one object of
clsBusinessValidation class. So there is a 1-1 relation ship between clsUser,clsJobSeeker
,clsCompanyUser and clsBusinessValidation .
Figure 8.23: - Class diagram from user, jobseeker and company user
Every user has menus depending on rights given to him. So you can see in the below
diagram clsMenu is aggregated in clsUser class. Again we have the clsBusinessValidation
class which will tie up the business objects with the validation library.
In our project we have two types of actions performed by the company and jobseeker type
of users i.e. Apply jobs and postjobs. PostJob action has lot of things common with
Applyjob. So we have created a inheritance relationship between clsPostJob and
clsApplyJob. Again we have the clsBusinessValidation class which will tie up the business
objects with the validation library.
Code Explanation
All business objects are divided in to two part single entity and multiple entities. For
instance in Menu.cs you will have clsMenu and clsMenus. clsMenus is collection of
clsMenu class type. Same way you have clsUser and clsUsers again the same thing clsUser
is the entity and clsUsers is the collection.
Below is the class code snippet of clsMenu and clsMenus. Below is the numbered
explanation of the same.
1 – This defines the private variables of the class. _MenuDescription defines the menu
description and _menuAspxPageName defines the Page name which the menu will redirect
once clicked.
2 – Public property which do the set and get for both the private variables.
3 – clsMenus defines a collection class which will store strongly types collection of
clsMenu.
4- LoadbyUserType method will load all the menus in the collection according to
userType.
In the below figure you can see how loadbyUserType is coded. It has three steps first it
creates the object of clsDbAccess, then calls the DB which in turns fires the stored
procedure and gets the datareader and finally loops and loads the menu collection. All our
collection objects are loaded in the same way.
Below is the detail explanation of the user class. Let us try to understand in numbered
fashion looking at the figure below.
This is the heart of the project the validation engine. Lets try to understand in detail. The
whole base of validation engine is using reflection. Using reflection we can browse through
the attributes and methods of the class and invoke them dynamically.
The core logic of the rules engine lies in clsBusinessValidation class. Below is the
numbered code snippet and the explanation.
1 – Addbusinessobject – This method basically adds the business objects which are o be
validated. clsBusinessValidation basically inherits from collection base. The
Addbusinessobject method adds the business object to this collection base. At any moment
2 – The validate method basically uses reflection and calls the validation library methods.
We will understand the same in detail manner in the next section.
The validate method is crucial as it forms the heart of the rules engine. It basically takes the
state for which it is validating and loads the rules from the ActionRules and rules table.
Below is the numbered explanation of the same.
1 – Load the rule s from the ActionRules and Rules tables.
2 – All the rules are in validation library DLL. In web.config file we have given the path
where the DLL is physically. We load the Assembly using the assembly namespace.
3 – Get the type of the validation library.
4 – Create a instance of the object because we need to invoke methods on the object.
5 – get th setObjecttoValidate method so that we can pass the business objects we need to
validate.
6 – Loop through all the business object we want to validate and set the same.
7 – Dynamically invoke the rules using the methodname specified in the ActioRules and
Rules table.
The validation library is where all our business validation lies. In the below code snippet
you can easily visualize all the methods which are checking the object data.
In order to validate the business validation library engine also needs the object. So we pass
the same to the setObjecttoValidate method which in turns sets the object inside the library.
The data access is a done using the clsdbAccess class. All our database operations are
written in stored procedures. These all stored procedures are invoked from clsDbaccess
class. Below is the figure which shows the mapping.
Explanation of UI
UI of the project is pretty simple. All the business objects are used in same fashion i.e.
create the object and use it. For instance to add a new company we create the
clsCompanyUser object, set the properties and call the update method. Step 1 is where we
set all the properties and Step 2 is where we call the update method. The below code
snippet shows how company user object is used , in the same manner we can use Menu ,
Job objects etc.
Note :- In case you have issues understanding the code. You can watch the
code walkthrough video of the jobsite which is provided in the CD.
• Once the proxies are updated, build the project and run it. If everything goes
properly we should get the below screen.
Microsoft introduced web services so that we can expose our functionality in XML which
can then be consumed by hetrogenous languages. Because the functionality is exposed in
XML it can be consumed by other languages. For instance in our job application we have
exposed functionality to get recent jobs. So now we can consume this service either using
JAVA , C# or any other language who understand XML.
• The first step is to add reference and generate proxy for the webservice. So as
shown in the figure below we right click on the windows consumer client and click
on add web reference.
• In the local web service we can see our quadra job service getJobs. Click on it to
generate proxy.
• Once you click on getJobs you will popped with a screen below which says what
name you would like to name proxy. Your client will refer the same using the proxy
name.
• In case you want to test the webservice. You can do the following. Set the web
service project as start up.
• After you have set the web service as start up run the project. You will get the
below screen. Click on the Login link. The below display shows the functionalities
exposed through the web service. Web service exposes its functionality using
WSDL i.e. Web service e Description language. So the below screen is generated
by reading the WSDL file made by the web service. Also note the ASMX file on
the browser URL. Basically you can know what functionalities is exposed by the
web service using the ASMX file. Click on the login link.
• Once you click on login link you will get the below screen. Enter a valid userid and
password and click invoke. If everything is successful then you should get a bla nk
screen. Using the ASMX ( which internally uses WSDL) we can invoke the web
service with proper data with out actually making the UI.
This project is enhancement of first project. Quadra successfully launches its website but
they want some serious value addition for jobseeker.After having a discussion with top
management Quadra came out with a solution and decided to launch “Quadra Client”.
ILF and EO
There are no ILF in the system because it’s a simple webservice and does not maintain any
logical files as such. There are no complex report in the system so there are no EO’s also.
EIF
There are two external data which we refer in the system on is for login and second for the
displaying the jobs.
EQ
There is one simple display for the recent jobs posted so there is one EQ in the system.
EI
We have two sections in which data passes from one boundary to other that is the login
section and second the job display section.
Total Estimation
Below is the final estimation using 1.5 FP per day as baseline. Once all the counting is
done we need to convert the Function Points into Man Days.
Below is the process of conversion as follows: -
• Calculating unadjusted Function Points.
• Calculating adjusted Function Points.
• Calculating Man Days.
• Distributing Man Days across SDLC phase.
Below is the figure which shows how man days are calculated for chat application.
From 10.53 man days we have taken 20% for requirement stage, 20% for technical stage
and 5% for testing stage. By using two developers we can complete the project in 7 man
days approximately.
In this use case (UC002) one of the worth looking thing is how we have depicted the
repetitive steps of the refresh mechanism. Below is the use case snippet figure of how the
loop is written. Many time in projects you will see this need because steps are same in
alternate scenarios of the use case.
Webservice are used bascially to expose the functionality in XML so that we can use the
same across hetrogenous languages. But you can only expose functionality which are in
disconnected mode. The webservice stands on the previous classes of the jobsite database
Code Explanation
Let’s make a code walkthrough of inner details of the webservice. Below is the expanded
version of the code snippet for both login and getjobs method. Both the methods are
numbered. In the login method in 1 we have set the properties and in the second step i.e. 2
we have set the object to a session variable so that we can get the same object is subsequent
request. One of the important point to note is webservices are my default stateless and to
make it stateful you need to use the HttpContext object.
getJobs is pretty simple object. The first thing we check is whether he has logged in to the
webservice. This is done by checking the session variable set in the login method. In the
second step we get the datareader , convert to dataset and pass back the same to the client.
• There is life outside projects....your life and your family. Love your work but not
your project or the company. Many developers after a certain amount of time
become possessive about the project and the company. Do a professional job but
don’t end up marrying the project or the company. Try to come on time and go on
time. So that you do not get saturated and work on the project for a longer time and
effectively. Don’t become a zombie - nobody said on his death bed that he would
have liked to spend more time in the office.
• Try to freeze your requirements before the start of the project. In practical scenarios
it is very difficult to control the end customer. But if you can at least control the
changes it will help you manage the project comfortably. The best way to control
changes is by taking official sign offs from the end Customer. As the saying goes,
building quality software and skating on ice are both easy to do provided
requirements are frozen.
ERS call centre is an mid cap firm mainly in to mobile business. They do marketing using
their call centre division located in India. They buy huge bulk of phone numbers from DFL
telecom limited located in US.The ERS call centre then makes cold calls to these numbers
to generate sales. For every phone number they pay 50 cents. ERS wants a IT solution
which should provide the following functionality :-
• User should be able to upload every day phone data received fro DFL telecom.
• System should upload the data and check if any duplicate data has come back. This
check will be done on the basis of phone number.
• There will be an report which will be used by management to see how much data is
duplicate and how much is fresh and pay accordingly to DFL telecom.
Note :- This project will need a good knowledge of windows process and
knowledge about reporting system like crystal.
DBSS accounting firm software company wants to develop accounting package for Mid
size companies. DBSS is looking for a IT solution which will have the following
functionalities :-
Interview questions
Once you are done with hands on project its time to find a job. Below are all the questions
from my three Interview question .NET Interview question , SQL Server Interview
questions and Java Interview questions. If you want to buy those book you can get it from
any BPB book shop mentioned in this books first page or else you can mail the same to
bpb@bol.net.in or bpb@vsnl.com.
NET Interoperability
How can we use COM Components in .NET (Twist : What is RCW ?)?
Once i have developed the COM wrapper do i have to still register the COM in
registry?
How can we use .NET components in COM (Twist :- What is CCW (COM callable
wrapper) ?, What caution needs to be taken in order that .NET components is
compatible
with COM ?) ?
How can we make Windows API calls in .NET?
When we use windows API in .NET is it managed or unmanaged code ?
What is COM ?
What is Reference counting in COM ?
Can you describe IUKNOWN interface in short ?
Can you explain what is DCOM ?
How do we create DCOM object in VB6?
How to implement DTC in .NET ?
How many types of Transactions are there in COM + .NET ?
How do you do object pooling in .NET ?
What are types of compatibility in VB6?
Threading
What is Multi- tasking ?
What is Multi- threading ?
What is a Thread ?
Did VB6 support multi- threading ?
Can we have multiple threads in one App domain ?
Which namespace has threading ?
Can you explain in brief how can we implement threading ?
How can we change priority and what the levels of priority are provided by .NET ?
What does Addressof operator do in background ?
How can you reference current thread of the method ?
What's Thread.Sleep() in threading ?
How can we make a thread sleep for infinite period ?
What is Suspend and Resume in Threading ?
What the way to stop a long running thread ?
How do i debug thread ?
OOPS
ASP.NET
ADO.NET
What is the namespace in which .NET has the data functionality classes ?
Can you give a overview of ADO.NET architecture ?
What are the two fundamental objects in ADO.NET ?
What is difference between dataset and datareader ?
What are major difference between classic ADO and ADO.NET ?
What is the use of connection object ?
What is the use of command objects and what are the methods provid ed by the
command object ?
What is the use of dataadapter ?
What are basic methods of Dataadapter ?
What is Dataset object?
What are the various objects in Dataset ?
How can we connect to Microsoft Access , Foxpro , Oracle etc ?
How do we connect to SQL SERVER , which namespace do we use ?
How do we use stored procedure in ADO.NET and how do we provide parameters to
the stored procedures?
How can we force the connection object to close after my datareader is closed ?
I want to force the datareader to return only schema of the datastore rather than data ?
How can we fine tune the command object when we are expecting a single row or a
single value ?
Which is the best place to store connectionstring in .NET projects ?
What are steps involved to fill a dataset ?(Twist :- How can we use dataadapter to fill a
dataset ?)
What are the various methods provided by the dataset object to generate XML?
How can we save all data from dataset ?
How can we check that some changes have been made to dataset since it was loaded
?(Twist :- How can cancel all changes done in dataset ? ,How do we get changed value
dataset ? )
SQL SERVER
UML
What is UML?
How many types of diagrams are there in UML ?(Twist :- Explain in short all types of
diagrams in UML ?)
What are advantages of using UML?(Twist: - What is Modeling and why UML ?)
What’s the sequence of UML diagrams in project?(Twist: - How did you implement
UML in your project?)
Just a small Twist: - Do I need all UML diagrams in a project?
Give a small brief explanation of all Elements in activity diagrams?
Explain Different elements of a collaboration diagram ?
Explain Component diagrams ?
Explain all parts of a deployment diagram?
Describe various components in sequence diagrams?
What are the element in State Chart diagrams ?
Describe different elements in Static Chart diagrams ?
Explain different elements of a Use Case ?(Twist: - What’s difference between Activity
and sequence diagrams?(I leave this to the readers))
Project Management
What is project management?
Is spending in IT project’s constant through out the project?
Who is a stakeholder ?
Can you explain project life cycle ?(Twist :- How many phases are there in software
project ?)
Are risk constant through out the project ?
Can you explain different software development life cycles ?
What is triple constraint triangle in project management ?
What is a project baselines ?
What is effort variance?
How is normally a project management plan document organized ?
How do you estimate a project?
What is CAR (Causal Analysis and Resolution)?
How do you handle change request?
What is internal change request?
Database Concepts
SQL
.NET Integration
ADO.NET
Notification Services
XML Integration
What is XML?
What is the version information in XML?
What is ROOT element in XML?
If XML does not have closing tag will it work?
Is XML case sensitive?
What’s the difference between XML and HTML?
Is XML meant to replace HTML?
Can you explain why your project needed XML?
What is DTD (Document Type definition)?
What is well formed XML?
What is a valid XML?
What is CDATA section in XML?
What is CSS?
What is XSL?
What is Element and attributes in XML?
Can we define a column as XML?
How do we specify the XML data type as typed or untyped?
How can we create the XSD schema?
How do I insert in to a table which has XSD schema attached to it?
What is maximum size for XML datatype?
What is Xquery?
What are XML indexes?
What are secondary XML indexes?
What is FOR XML in SQL Server?
Can I use FOR XML to generate SCHEMA of a table and how?
What is the OPENXML statement in SQL Server?
I have huge XML file which we want to load in database?
How to call stored procedure using HTTP SOAP?
What is XMLA ?
Replication
Reporting Services
Can you explain how can we make a simple report in reporting services?
How do I specify stored procedures in Reporting Services?
What is the architecture for “Reporting Services “?
Database Optimization
Threading
EJB
What is EJB?
what are the different kind of EJB’s?
you are designing architecture for a project how do you decide whether you should use
session, entity or message driven bean?
Can you explain “EJBHome” and “EJBObject” in EJB?
Can client directly create object of session or entity beans?
Can you explain the concept of local interfaces?
What are the limitations of using Local object?
Which application server have you used for EJB ?
Can you explain step by step practically developing and deploying EJB component?
what is Passivation and Activation in EJB?
Can beans who are involved in transaction have “Passivation” process?
How does the server decide which beans to passivate and activate?
In what format is the conversational data written to the disk?
Can you explain in brief Life cycle for Stateless and Stateful beans?
Struts
What is XML?
What is the version information in XML?
What is ROOT element in XML?
If XML does not have closing tag will it work?
Is XML case sensitive?
What is the difference between XML and HTML?
JNI
Project Management
UML
What is UML?
How many types of diagrams are there in UML ?
Twist :- Explain in short all types of diagrams in UML ?
What are advantages of using UML?
Twist: - What is Modeling and why UML ?
What is the sequence of UML diagrams in project?
Twist: - How did you implement UML in your project?
Just a small Twist: - Do I need all UML diagrams in a project?
Give a small brief explanation of all Elements in activity diagrams?
Explain Different elements of a collaboration diagram ?
Explain Component diagrams ?
Explain all parts of a deployment diagram?
Describe the various components in sequence diagrams?