Vous êtes sur la page 1sur 110

Citizen card

1
Citizen card

Organization Profile:

VIPULA Technologies was founded in the year 2000 by


Mr.M.V.RamiReddy, a young business entrepreneur with a great ambition
to embark in the IT industry and succeed at any cost. The objective was to
provide unique, cost-effective and powerful solutions in business
management, manufacturing processes, defense research and allied fields.
The objective has been fulfilled to large extent and today the company is
poised for major developments in the high-end technological domains. The
company is currently planning to launch a major research center, which will
form the backbone of the various development activities by transferring
high-end technologies. The company is also engaged in parallel, in
providing high-quality training and experience to the engineering student
community. The students not only benefit from finely chiseled course
curriculum, but also from the practical experience gained through the
development center. In order to realise these end-results, the company is
supported by domain expects with strong technical background and rich

2
Citizen card

industrial experience. The development activities may broadly summarised


under the following heads:

 Turnkey solutions in business management


 Process Automation solutions to manufacturing companies
 Flexible and Intelligent Manufacturing Systems, vision-based Robots
 High-end Technological Solutions to Defense & Aerospace Industry
 In-house development of microprocessor-based products
 Web Based Applications using J2EE and .Net Technologies
 High-end Software development using leading technologies in
different domains

Investment in high-quality manpower has largely been the reason for the
success of the organization. The technical team is headed by B.Chandra
Sekhar, Viswanath, B.Uday Reddy and Ashok whom have substantial
industrial experience with numerous successful projects to their credit both
in the industry and the defence sector.
The following list represents a typical cross section of the clients who
have eulogised on the quality of services provided by us. We have built
confidence and trust into our clients through our quality services and
dependable on-going support.
Turbo Engineering
Prem Industries
JK Mills
Deepak Oils
Maheshwari Marriage Bureau

3
Citizen card

Jayasree Enterprises
DigitalAUM
Arithmatics
Gempac India
VishVision
Malhotra Shaving Products Limited
Bayer India Limited
Hoechst Pharmaceuticals Limited
Klockner Windsor Limited
Hindustan Dorr Oliver
Electronic Corporation of India (Bangalore)

The company provides a close-knit, sleeves rolled-up atmosphere


throughout, rather than a flat hierarchy. The company allows employees to
customise benefit programs and provide flexible time-off policy.

Our goal:- Change the World, Make a King’s ransom to achieve


profitability and get acquired.

4
Citizen card

5
Citizen card

Contents
• Introduction
• Organization Profile
• Problem Definition
• Software Design
• Software Requirements
 Overview of Java
 Java Database Connectivity
 Java Servlets
 JSP
 HTML & Java Script
 Oracle 8i
 Overview of Testing

• Dataflow Diagram
• Data Dictionary
• ER Diagrams
• Operational Profile
• Implementation
• Use Case Document
• Software Testing Design
• Test Cases
• Performance Evaluation Report
• Conclusion and future scope

6
Citizen card

Introduction:

The Project ‘Citizen Card System’ gives us the information


about the citizen in any country. A Citizen has unique Id to find out the
personal information in each and every department or service wherever a
citizen goes. This information can be found out by the unique Id of the
citizen. If any citizen wants to utilize the services or utilities by the
Government or Private organizations, he has to go to each and every
department with different Id for that particular department. Instead, a citizen
card helps in having all the utilities and services under one unique Id.This
system not only help us to know the information about the services or
utilities but also it gives the information about the character of the citizen in
credit rating.

This System consists of the modules like Personal Information,


Credit Rating, Banking, Insurance, Tax, Provident Fund, Electricity,
Telephone, Gas, Movies, Municipality, RTO, Voting, Passport, Travel
Agency etc.

7
Citizen card

Project Description:

‘Citizen Card System’ provides the information about the


citizen in any country. A Citizen has unique Id to find out the personal
information in each and every department or service wherever a citizen goes.
This information can be found out by the unique Id of the citizen. If any
citizen wants to utilize the services or utilities by the Government or Private
organizations, he has to go to each and every department with different Id
for that particular department.

How they work?


In citizen card system the citizen will perform the all
transactions basing on id.If citizen want to take a policy like Insurance
policy then citizen basing on id he/she logins and register themselves to take
a policy .Not only the Insurance but also he/she perform the transactions like
banking, Electricity, Banking, Insurance, Tax, Provident Fund, Telephone,
Gas, Movies, Municipality, Credit rating etc.
Credit rating tells the behavior of the person whether citizen’s character is
good or bad.

8
Citizen card

MODULES:

Personal Information :
This module contains the personal information like name , id ,
address etc., of citizen. If administrator want to view the personal details of
the citizen administrator can verify the personal information module.

Credit Rating :
This module gives the information about the character of the citizen. It
determines whether the citizen’s behavior basing on all the things is good or
bad.
It provides the information of the citizen .

Insurance :
This module provides the amount insured and regarding its installments.
Basing on citizen id the insurance details can be displayed.If the citizen
wants to make a policy in the insurance then citizen can make it by his
citizen id.

Taxation:
This module provides the information regarding the tax paid and tax to be
paid. If Administrator wants to know about the particular citizen details

9
Citizen card

whether he/she paid the tax or not then the administrator can check it basing
on id.

Gas :
This module provides the information regarding the deliveries of the gas.
The information provides the amount paid by the customer to the particular
gas no and gas type.

RTO :
This module provides information regarding licenses for vehicles.It gives
the information like vehicle name,vehicle reg number,engine
number,Service number,Owner address etc

Voting :
This module provides the online voting facility. Citizen can choose
particular area to the voting.citizen can vote according to his/her choice.

Banking :
This module allows all banking transactions. Citizen can make any bank
transactions basing on citizen id.Bank like SBI, ICICI, Andhra bank etc All
the banking transactions can be done with citizen id.

Telephone :
This module provides information about the telephone bill payments. It
provides the information about the STD calls/ISD calls and their charges of
particular citizen id..

10
Citizen card

Electricity :
This module provides information about electricity bill payments and all.It
provides the information like number of units and previous no of units and
the charge for that bill basing on id of particular citizen.

Passport:
This module provides information about particular citizen.Details like
citizen personal information and dateissued,issued govt ,renewal
date,validupto etc.,

Objectives

To enable the Administrator to perform operations basing on


citizen id like voting, passport,gas,banking Personal Information,
Credit Rating, etc.

SOFTWARE DESIGN DOCUMENT

Purpose
Purpose of this document is to clearly describe all known classes,
processes,
GUI, and data fields for this software.

11
Citizen card

FEASIBILITY STUDY:

Feasibility considerations:
The feasibility study is carried out to find whether the proposed
system can be developed and implemented without any problem. The
following feasibility is considered for the project in order to ensure that the
project is viable and it does not have any major obstructions. In this regard
technical, behavioral, and economic feasibility are analyzed.

Technical feasibility:

Technical feasibility such as whether the necessary technology exist to


do what is suggested and if the equipment have the capacity to hold
data required by the use of new system. Also any technical guarantees
of accuracy, reliability, ease of access, data security could be provided
etc.

Behavioral Feasibility:

People are inherently resistant to change and computers have known to


facilitate changes. Every department welcomes the idea of
computerization. But the resistance will be from the operators who are
involved in the existing system or manual system.

12
Citizen card

Behavioral Feasibility is also studied like whether the changes made to


the system facilitates the user and if he is able to adapt to the change
made by introducing computers. An agreement is made between
management and staff so that computerizing system will be installed
step by step by giving training to existing staff members only.

Economic Feasibility:

Economic feasibility like if the existing resources are sufficient


introducing. Any extra h/w required should be affordable in terms of
cost. Also can the system be built within the specified time interval?
Establish cost and schedule constraints. Defining functions for h/w, s/w
people. Create system definition that forms a foundation for all
subsequent engineering work.

Software Requirements

13
Citizen card

SOFTWARE SPECIFICATION:

 JAVA
 JDBC
 SERVLETS
 JSP
 HTML
 ORACLE

SCRIPT LANGUAGE:

JAVA SCRIPT
WEB BROWSER:
TOMCAT (OR) WEBLOGIC

Hardware Requirements

Pentium III and above with 10 GB HDD and 256 RAM

14
Citizen card

JAVA

The initial release of Java was nothing of revolutionary, but it did not mark
the end of java’s era of rapid innovation. Unlike most other software systems
that usually settle into a pattern of small, increment improvements, java had
already created java1.1 were more significant and substantial than the
increase 1 the minor revision number would have you think. Java1.1 added
many new library elements, redefined the way events are handled by applets,
and reconfigured many features of the 1.0 library .It also deprecated several
features originally defined by java1.0. Thus java1.1 both added and
subtracted attributes from its original specification. Continuing in this
evolution, java2 also and subtracts features.

Features added by 1.1

Version1.1 added some important elements to Java. Most of the addition


occurred in the Java library. However, a few new language features were
also included. Here is a list of the important features added by 1.1:

• Java Beans, which are software components that are written in Java.
• Serialization, which allows you to save and restore the state of an object.
• Remote Method Invocation, which allows a Java, objects to invoke the
methods of another Java object that located on a different machine. This
is an important facility for building distributed applications.

15
Citizen card

• Java Database Connectivity (JDBC), which allows programs to access


SQL, databases from many different vendors.
• The Java Native Interface (JNI), which provides a new way for your
programs to interface with code libraries written in other languages.
• Reflection, which is a process of determining the fields, constructors and
methods of a java object at run time.
• Various security features, such as digital signatures, messages digests,
and access control lists and key generation.
• Built in support for 16-bit character streams that handle Unicode
characters.
• Significant changes to event handling that improve the way in which
events generated by graphical user interface (GUI) components are
handled.
• Inner classes, which allow one class to be defined within another.

Deprecated by Features 1.1

As just mentioned java 1.1 depreciated many earlier library elements. For
example, most of the original Date class was deprecated. However, the
deprecated features did not go away. Instead, they were replaced with
updated alternatives. In general, deprecated 1.0 feature is still available in
java to support legacy code, but they should not be used by new
applications.

Features added by java 2.0

16
Citizen card

Building upon 1.1, java 2.0 adds many important new features. Here is a
partial list.
• Swing is a set of user interface components that is implemented entirely
in java You can use a look and feel that is either specific to a particular
operating system or uniform across operating systems. You can also
design your own look and feel.
• Collections are group of objects. Java 2.0 provides several types of
collection, such as linked lists, dynamic arrays and hash tables for use.
Collections offer a new way to solve several common-programming
problems.
• Digital certificates provide mechanism to establish the identity of a user.
You may think of them as electronic passports. Java programs can parse
and use certificates to enforce security policies.
• Text components can now receive Japanese, Chinese and Korean
characters from keyboard. Using a sequence of keystrokes to represent
one character does this.
• The Common Object request Broker Architecture (CORBA) defines an
Object request Broker (ORB) and an Interface Definition Language
(IDL). Java 2.0 includes an ORB and an IDL to java compiler. The latter
generates code from an IDL specification.
• Performance improvements have been made in several areas. A Just-In-
Time (JIT) compiler is included in JDK.
• Many browsers include a Java Virtual Machine that is used to execute
applets. Unfortunately, browsers JVM’s typically do not include the
latest java features. The java Plug-in solves this problem. It directs a

17
Citizen card

browser’s JVM .The JRE is a subset of the JDK.It does not include the
tools and classes that are used in a development environment.
Various tools such as Javac, Java and Javadoc have been enhanced.
Debugger and Profiler interfaces for the JVM arte available.

Features Deprecated by 2
Although not as extensive as the deprecations experienced between 1.0 and
1.1 some features of java 1.1 are deprecated by java 2.0. For example, the
suspend (), resume () and stop () methods of the Thread class should not be
used in new code

Java’s Magic: The Byte Code:


The key that allows java to solve both the security and the portability
problems just described is that the output of the java compiler is not an
executable code. Rather, it is Byte Code. Byte Code is a highly optimized set
of instructions designed to be executed by virtual machine that the java Run-
time system emulates. This may come as it of surprise as you know c++ is
compiled, not interpreted-mostly because of performance concerns.
However, the fact that a java program is interpreted helps solve the major
problems associated with downloading the program over the Internet.

Here is why java was designed to be interpreted language. Because java


programs are interpreted rather than compiled .It is easier to run them in
wide variety of environments. Only the java runtime system needs to be

18
Citizen card

implemented for each platform. Once the runtime package exists for a given
system any java program can run on it. If java were a compiled langu8age
then different versions of the same program will have to exist for each type
of CPU connected to the Internet. Thus interpretation is the easiest way to
create truly portable programs.Although java was designed to be interpreted,
there is technically nothing about java that prevents on the fly compilation of
Byte Code into native code. However, even if dynamic compilation were
applied to Byte Code, the portability and safety would still apply, because
the run time system would still be in change of the execution environment.

The Java Buzz Words


No discussion of the genesis of java is complete without a look at the
java buzzwords. Although the fundamentals that necessitated the invention
of java are portability and security, there are other factors that played an
important role on molding the final form of the language. The java in the
following list of buzzwords summed up the key considerations.
• Simple
• Portable
• Object-oriented
• Robust
• Multithreaded
• Architectural-neutral
• High performance
• Distributed
• Dynamic

19
Citizen card

OBJECT ORIENTED PROGRAMMING AND JAVA

Object-oriented Programming was developed because of limitations


found in earlier approaches of programming. To appreciate what OOP does,
we need to understand what these limitations are and how they arose from
traditional programming.

PROCEDURAL LANGUAGES

Pascal, C, Basic, FORTRAN, and similar languages are procedural


languages. That is, each statement in the language tells the computer to do
something: Get some input, add these numbers,, divide by 6, display the
output. A program in a procedural language is a list of instructions.
For very small programs no other organizing principle (often called a
paradigm) is needed. The programmer creates the list of instructions, and
the computer carries them out.

Division into Functions


When programs become larger, a single list of instructions becomes
unwieldy. Few programmers can comprehend a program of more than a few
hundred statements unless it is broken down into smaller units. For this
reason the function was adopted as a way to make programs more

20
Citizen card

comprehensible to their human creators. (The term functions is used in C++


and C. In other languages the same concept may be referred to as a
subroutine, a subprogram, or a procedure.) A program is divided into
functions, and (ideally, at least) each function has a clearly defined purpose
and a clearly defined interface to the other functions in the program.

The idea of breaking a program into functions can be further extended by


grouping a number of functions together into a larger entity called a module,
but the principle is similar: grouping a number of components that carry out
specific tasks.
Dividing a program into functions and modules is one of the cornerstones
of structured programming, the somewhat loosely defined discipline that has
influenced programming organization for more than a decade.

Problems with Structured Programming


As programs grow ever larger and more complex, even the structured
programming approach begins to show signs of strain. You may have heard
about, or been involved in, horror stories of program development. The
project is too complex, the schedule slips, more programmers are added,
complexity increases, costs skyrocket, the schedule slips further, and disaster
ensues. Analyzing the reasons for these failures reveals that there are
weaknesses in the procedural paradigm itself. No matter how well the
structured programming approach is implemented, large programs become
excessively complex.
What are the reasons for this failure of procedural languages? One of the
most crucial is the role played by data.

21
Citizen card

Data Undervalued

In a procedural language, the emphasis is on doing things--read the


keyboard, invert the vector, check for errors, and so on. The subdivision of
a program into functions continues this emphasis. Functions do things just
as single program statements do. What they do may be more complex or
abstract, but the emphasis is still on the action.
What happens to the data in this paradigm? Data is, after all, the reason for
a program's existence. The important part of an inventory program isn't a
function that displays the data, or a function that checks for correct input; it's
the inventory data itself. Yet data is given second-class status in the
organization of procedural languages.
For example, in an inventory program, the data that makes up the inventory
is probably read from a disk file into memory, where it is treated as a global
variable. By global we mean that the variables that constitute the data are
declared outside of any function, so they are accessible to all functions.
These functions perform various operations on the data. They read it,
analyze it, update it, rearrange it, display it, write it back to the disk, and so
on.
We should note that most languages, such as Pascal and C, also support
local variables, which are hidden within a single function. But local
variables are not useful for important data that must be accessed by many
different functions.
Now suppose a new programmer is hired to write a function to analyze this
inventory data in a certain way. Unfamiliar with the subtleties of the
program, the programmer creates a function that accidentally corrupts the.
This is easy to do, because every function has complete access to the data.

22
Citizen card

It's like leaving your personal papers in the lobby of your apartment
building: Anyone can change or destroy them. In the same way, global data
can be corrupted by functions that have no business changing it.
Another problem is that, since many functions access the same data, the way
the data is stored becomes critical. The arrangement of the data can't be
changed without modifying all the functions that access it.
If you add new data items, for example, you'll need to modify all the
functions that access the data so that they can also access these new items. It
will be hard to find all such functions, and even harder to modify all of them
correctly. It's similar to what happens when your local supermarket moves
the bread from aisle 4 to aisle 12. Everyone who patronizes the supermarket
must figure out where the bread has gone, and adjust their shopping habits
accordingly.
What is needed is a way to restrict access to the data, to hide it from all but a
few critical functions. This will protect the data, simplify maintenance, and
offer other benefits as well.

Relationship to the Real World

Procedural programs are often difficult to design. The problem is that their
chief components--functions and data structures--don't model the real world
very well. For example, suppose you are writing a program to create the
elements of a graphics user interface: menus, windows, and so on. Quick
now, what functions will you need? What data structures? The answers are
not obvious, to say the least. It would be better if windows and menus
corresponded more closely to actual program elements.

23
Citizen card

New Data Types


There are other problems with traditional languages. One is the difficulty of
creating new data types. Computer languages typically have several built-in
data types: integers, floating-point numbers, characters, and so on. What if
you want to invent your own data type? Perhaps you want to work with
complex numbers, or two dimensional coordinates, or dates—quantities the
built-in data types don’t handle easily. Being able to create your own types
is called extensibility; you can extend the capabilities of the language.
Traditional languages are not usually extensible. Without unnatural
convolutions, you can’t bundle together both X and Y coordinates into a
single variable called Point, and then add and subtract values of this type.
The result is that traditional programs are more complex to write and
maintain.

The object oriented approach


The fundamental idea behind object-oriented languages is to combine into a
single unit both data and the functions that operate on that data. Such a unit
is called an object.
An object’s functions, called member methods in Java, typically provide the
only way to access its data. If you want to read the item and return the value
to you, you call a member function in the object. It will read the item and
return the value to you. You can’t access the data directly. The data is
hidden, so it is safe from accidental modification. Data and its functions are
said to be encapsulated into a single entity. Data encapsulation and data
hiding are key terms in the description of object oriented languages.

24
Citizen card

If you want to modify the data in an object, you know exactly what functions
interact with it: the member functions in the object. No other functions can
access the data. This simplifies writing, debugging, and maintaining the
program.

A Java program typically consists of a number of objects, which


communicate with each other by calling one another’s members functions.
We should mention that what are called member functions in C++ are called
methods in Java. Also, data items are referred to as instance variables.
Calling an object’s member function is referred to as sending a message to
the object.

An analogy

You might want to think of objects as departments—such as sales,


accounting, personnel, and so on—in a company. Departments provide an
important approach to corporate organization. In most companies (except
very small ones), people don’t work on personnel problems one day, the
payroll the next, and then go out in the field as sales people the week after.
Each department has its own personnel, with clearly assigned duties. It also
has its own data: payroll, sales figures, personnel records, inventory, or
whatever, depending on the department.
The people in each department control and operate on those departments
data. Dividing the company into departments makes its easier to
comprehend and control the company’s activities, and helps them maintain
the integrity of the information used by the company. The payroll
department, for instance, is responsible for the payroll data. If you are from

25
Citizen card

the sales department, and you need to know the total of all the salaries paid
in the southern region in July, you don’t just walk into the payroll
department and start rummaging through file cabinets. You send a memo to
the appropriate person in the department, and then you wait for that person
to access the appropriate person in the department, and then you wait for that
person to access the data and send you a reply with the information you
want. This ensures that the data is accessed accurately and that inept
outsiders do not corrupt it. (This view of corporate organization is show in
figure). In the same way, objects provide an approach to program
organization, while helping to maintain the integrity of the programs data.

OOP: An approach to organization

Keep in mind that object-oriented programming is not primarily concerned


with the details of program operation. Instead, it deals with the overall
organization of the program.

Characteristics of object-oriented languages:


Let’s briefly examine a few of the major elements of object-oriented
languages in general and Java in particular.

Objects
When you approach a programming problem in an object oriented language,
you no longer ask how the problem will be divided into functions, but how it
will be divided into objects. Thinking in terms of objects, rather than

26
Citizen card

functions, has a surprisingly helpful effect on how easily programs can be


designed and objects in the real world.
What kinds of things become objects-oriented programs? The answer to this
is limited only by your imagination, but there are some typical categories to
start you thinking:

Physical objects
Automobile in a traffic-flow simulation
Electrical components in a circuit design to a program
Countries in an economics model
Aircraft in an air-traffic control system
• Elements of the computer-user environment
 Windows
 Menus
 Graphics objects (lines, rectangles, circles)
 The mouse and the keyboard
• Programming constructs
 Customized arrays
 Stacks
 Linked lists

• Collection of data
 An inventory
 A personnel file

27
Citizen card

 A dictionary
A table of the latitudes and longitudes of world cities
• User defined data types
 Time
 Angles
 Complex numbers
 Points on the plane

• Components in a computer games


 Ghosts in maze game
 Positions in a board game (chess, checkers)
 Animals in an ecological simulation
 Opponents and friends in adventure games
The match between programming objects and real-world objects us the
happy result of combining data and functions: the resulting objects offer a
revolution in program designing, no such close match between programming
constructs and the items being modeled exists in a procedural language.

Classes
In OOP we say that objects are members of classes. What does this mean?
Let’s look at an analogy. Almost all computer languages have built-in data
types. For instance, a data type int, meaning integer is pre-defined in Java.
You can declare as many variables of type int as you need in your program:
Int day;
Int count;
Int divisor;

28
Citizen card

Int answer;
A class serves as a plan, or template. It specifies what data, and what
functions will be included in objects of that class. Defining the class doesn’t
create any objects, just as the mere existence of a type int doesn’t create any
variables.
A class is thus a collection of similar objects. This fits our non-technical
understanding of the word class, Prince, sting etc., are members of the class
of rock musicians. There is no person called rock musician but specific
people with specific names are members of this class if they possess certain
characteristics.

Abstraction
An essential element of object-oriented programming is abstraction.
Humans manage complexity through abstraction. For example, people do
not think of a car as a set of tens of thousands of individual parts. They
think of it as a well-defined object with its own unique behavior. This
abstraction allows people to use a car to drive to the grocery store without
being overwhelmed by the complexity of the parts that form the car. They
can ignore the details of how the engine, transmission, and braking systems
work. Instead they are free to utilize the object as a whole.
A powerful way to manage abstraction is through the use of hierarchical
classifications. This allows you to layer the semantics of complex systems,
breaking them into more manageable pieces. From the outside, the car is a
single object. Once inside, you see that the car consists of several
subsystems: steering, brakes, sound system, seat belts, heating, cellular
phone, and so on. In turn, each of these subsystems is made up of more

29
Citizen card

specialized units. For instance, the sound system consists of a radio, a CD


player, and/or a tape player. The point is that you manage the complexity of
the car(or any other complex system) through the use of hierarchical
abstractions.
Hierarchical abstractions of complex systems can also be applied to
computer programs. The data from a traditional process-oriented program
can be transformed by abstraction into its component objects. A sequence of
process steps can become a collection of messages between these objects.
Thus, each of each object describes its own unique behavior. You can treat
these objects as concrete entities that respond to messages telling them to do
something. This is the essence of object-oriented programming.

Object-oriented concepts form the heart of Java just as they form the basis
for human understanding. It is important that you understand how these
concepts translate into programs. As you will see, object-oriented
programming is a powerful and natural paradigm for creating programs that
survive the inevitable changes accompanying the life cycle of any major
software project, including conception, growth, and aging. For example,
once you have a well defined objects and clean, reliable interfaces to those
objects, you can gracefully decommission or replace parts of an older system
without fear.

Encapsulation
Encapsulation is the mechanism that binds together code and the
data it manipulates, and keeps both safe from outside interference and
misuse. One way to think about encapsulation is as a protective wrapper
that prevents the code and data from being arbitrarily accessed by other

30
Citizen card

code defined outside the wrapper. Access to the code and data inside the
wrapper is tightly controlled through a well-defined interface. To relate
this to the real world, consider the automatic

transmission on an automobile. It encapsulates hundreds of bits of


information about your engine, such as how much you are accelerating, the
pitch of the surface you are on, and the position of the shift lever. You , as
the user, have only one method of affecting this complex encapsulation: by
moving the gear-shift lever. You can’t affect the transmission by using the
turn signal or windshield wipers, for example. Thus, the gear-shift lever is
a well-defined (indeed, unique) interface to the transmission. Further,
what occurs inside the transmission does not affect objects outside the
transmission. For example, shifting gears does not turn on the headlights!
Because an automatic transmission is encapsulated, dozens of car
manufacturers can implement one in any way they please. However, from
the driver’s point of view, they all work the same. This same idea can be
applied to programming. The power of encapsulated code is that everyone
knows how to access it and thus can use it regardless of the
implementation details—and without fear of unexpected side effects.
In Java the basis of encapsulation is the class. Although the class will be
examined in great detail later in this book, the following brief discussion
will be helpful now. A class defines the structure and behavior (data and
code) that will be shared by a set of objects. Each object of a given class
contains the structure and behavior defined by the class, as if it were
stamped out by a mold in the shape of the class. For this reason, objects are
sometimes referred to as instances of a class. Thus, a class is a logical
construct; an object has physical reality.

31
Citizen card

When you create a class, you will specify the code and data that
constitute that class. Collectively, these elements are called members of the
class. Specifically, the data defined by the class are referred to as member
variables or instance variables. The code that operates on that data is
referred to as member methods or just methods.

Since the purpose of a class is to encapsulate complexity, there are


mechanisms for hiding the complexity of the implementation inside the
class. Each method or variable in a class may be marked private or public.
The public interface of a class represents everything that external users of
the class need to know, or may know. The private methods and data can
only be accessed by code that is a member of the class. Therefore, any other
code that is not a member of the class cannot access a private method or
variable. Since the private members of a class may only be accessed by
other parts of your program through the class’ public methods, you can
ensure that no improper actions take place. Of course, this means that the
public interface should be carefully designed not to expose too much of the
inner workings of a class.

Inheritance
Inheritance is the process by which one object acquires the properties
of another object. This is important because it supports the concept of
hierarchical classification. As mentioned earlier, most knowledge is made
manageable by hierarchical (that is, top-down) classifications. For example,

32
Citizen card

a Golden Retriever is part of the classification dog, which in turn is part of


the mammal class, which is under the larger class animal. Without the use
of hierarchies, each object would need to define all of its characteristics
explicitly. However, by use of inheritance, an object need only define those
qualities that make it unique within its class. It can inherit its general
attributes from its parent. Thus, it is the inheritance mechanism that makes
it possible for one object to be a specific instance of a more general case.

Most people naturally view the world as made up of objects that are
related to each other in a hierarchical way, such as animals, mammals, and
dogs. If you wanted to describe animals in an abstract way, you would say
they have some attributes, such as size, intelligence, and type of skeletal
system. Animals also have certain behavioral aspects; they ear, breathe, and
sleep. This description of attributes and behavior is the class definition for
animals.

If you wanted to describe a more specific class of animals, such as


mammals, they would have more specific attributes, such as type of teeth,
and mammary glands. This
is known as a subclass of animals, where animals are referred to as
mammals’ super class.
Since mammals are simply more precisely specified animals, they
inherit all of the attributes from animals. A deeply inherited subclass
inherits all of the attributes from each of its ancestors in the class hierarchy.
Inheritance interacts with encapsulation as well. If a given class
encapsulates some attributes, then any subclass will have the same attributes
plus any that it adds as part of its specialization. This is a key concept,

33
Citizen card

which lets object-oriented programs grow in complexity linearly rather than


geometrically. A new subclass inherits all of the attributes of all of its
ancestors. It does not have unpredictable interactions with the majority of
the rest of the code in the system.

Polymorphism
Polymorphism (from the Greek, meaning “many forms”) is a feature that
allows one interface to be used for a general class of actions. The specific
action is determined by the exact nature of the situation. Consider a stack
(which is a last-in, first-out list). You might have a program that requires
three types of stack. One stack is used for integer values, one for floating-
point values, and one for characters. The algorithm that implements each
stack is the same, even though the data being stored differs. In a non-object-
oriented language, you would be required to create three difference sets of
stack routines, with each set using different names. However, because of
polymorphism, in Java you can specify a general set of stack routines that all
share the same names.
More generally, the concept of polymorphism is often expressed by
the phrase “one interface, multiple methods.” This means that it is possible
to design a generic interface to a group of related activities. This helps
reduce complexity by allowing the same interface to be used to specify a
general class of action. It is the compiler’s job to select the specific action
(that is, method) as it applies to each situation. You, the programmer, do not
need to make this selection manually. You need only remember and utilize
the general interface.
Extending the dog analogy, a dog’s sense of smell is polymorphic. If
the dog smells a cat, it will bark and run after it. If the dog smells its food, it

34
Citizen card

will salivate and run to its bowl. The same sense of smell is at work in both
situations. The difference is what is being smelled, that is, the type of data
being operated upon by the dog’s nose! This
same general concept can be implemented in Java as it applies to methods
within a Java program.

Polymorphism, Encapsulation, and Inheritance Work Together


When properly applied, polymorphism, encapsulation, and inheritance
combine to produce a programming environment that supports the
development of far more robust and scaleable programs than does the
process-oriented model. A well-designed hierarchy of classes is the basis
for reusing the code in which you have invested time and effort developing
and testing. Encapsulation allows you to migrate your implementations over
time without breaking the code that depends on the public interface of your
classes. Polymorphism allows you to create clean, sensible, readable, and
resilient code.
Of the two real-world examples, the automobile more completely
illustrates the power of object-oriented design. Dogs are fun to think about
from an inheritance standpoint, but cars are more like programs. All drivers
rely on inheritance to drive different types (sub classes) of vehicles.
Whether the vehicle is a school is a school bus, a Mercedes sedan, a Porsche,
or the family minivan, drivers can all more or less find and operate the
steering wheel, the brakes, and the accelerator. After a bit of gear grinding,
most people can even manage the difference between a stick shift and an
automatic, because they fundamentally understand their common super
class, the transmission.

35
Citizen card

People interface with encapsulated features on cars all the time. The
brake and gas pedals hide an incredible array of complexity with an interface
so simple you can operate them with your feet! The implementation of the
engine, the style of brakes, and the size of the tires have no effect on how
you interface with the class definition of the pedals.
The final attribute, polymorphism, is clearly reflected in the ability of
car manufacturers to offer a wide array of options on basically the same
vehicle. For example, you can get an antilock braking system or traditional
brakes, power or rack-and-pinion steering, 4-, or 6-, or 8-cylender engines.
Either way, you will still press the break pedal to stop, turn the steering
wheel to change direction, and press the accelerator when you want to move.

Java Data Base Connectivity (JDBC)

JDBC is a set of specification that defines how a program written in java can
communicate and interact with a database. It provides a vehicle for the
exchange of SQL between java application and databases. Programs
developed with java and the JDBC are platform independent and vendor
independent.
The same java database program can run on PC, a workstation, or java
powered terminal. You can move your data from one database to another,
for example from Microsoft SQL Server to Oracle and the same program
can still read your data. This is in sharp contrast to the database
programming typically done on personal computers today. It is all common
that one writes the database application in proprietary database language,

36
Citizen card

using a database management system that is available only from one or two
platforms.
At the heart of the JDBC is the JDBC driver. JDBC driver is responsible for
ensuring that any requests made by the application are presented to the
database in away that is meaningful to the databases. JDBC was designed to
support the most common form of SQL known as ANSI SQL92 entry level
standard.
The JDBC consists of two layers .The top layer is the JDBC API. This API
communicates with JDBC manager driver API sending, it the various SQL
statements. The manager should communicate with the various third party
drivers that actually connect to the database and return the information from
the query or performed the action specified by the query.

Typical uses of the JDBC


Just as one can use java for both applications and applets, one can use the
JDBC enhanced version of java in both applications and applets. When that
version is used in an applet, all the normal security restrictions applied.
JDBC continues to assume all applets are trusted.
In particular, applets that use JDBC would only be able to open a database
connection from the server from which they are downloaded. They can make
neither explicit nor implicit use of information. Although the JDBC
extensions of the java security model allow on to download a JDBC driver
and register it with JDBC device manager on the server, that driver can be
used only for connections from the same server the applet came from. That
means the web server and the database must be the same machine, which is
not a typical set up. Of course, the web server can have a proxy service that

37
Citizen card

routes database traffic to an other machine. When signed java applets


become possible this restriction could be loosened.

Applications on the other hand have complete freedom. They can give the
application the total access to files and remote servers. We envision that
JDBC applications will be very common.

Components of JDBC

There are three components to the JDBC


• The JDBC driver manager
• The JDBC driver test suite and
• The JDBC-ODBC bridge
The JDBC driver manager is the backbone of the JDBC architecture. It
actually quite small and simple its primary function is to connect java
application s to the connect JDBC driver and then get out of the way.

The JDBC driver test suite provides some confidence that JDBC drivers will
run your program. Only drivers that pass the JDBC driver test suite can be
designated JDBC COMPLIANT.

38
Citizen card

The JDBC-ODBC Bridge allows ODBC drivers to be used as JDBC drivers.


It was implemented, as a way to get JDBC off the ground quickly, a long
term will provide a way to access some of the less popular DBMS’s if JDBC
drivers are not implemented for them.

JDBC DRIVER TYPES

JDBC-ODBC Bridge:
ODBC driver is the only driver that can be used with the multiple databases
and is vendor independent. The ODBC interface remains constant no matter
which database is used. This means that this type of JDBC driver only needs
to speak only one language ODBC.

Native-API -Party-Java Driver:


This makes use of local native libraries to communicate with the database.
The driver does this by making call to the locally installed native call level
interface (CLI). The CLI libraries are responsible for the actual
communication with the database server.

JDBC-Net-All-Java-Driver:
The main difference when using this driver is that the native CLI libraries
are placed on a remote server and the driver uses a network protocol to
facilitate communication between the application and the driver .All c

39
Citizen card

communication between the application and the database server are 100%
java to java. Communication between the database itself and the server
processes is still done with a native database CLI.

Native-Protocol-All-Java-Driver:
This kind of driver converts JDBC calls into the network protocol used by
DBMS directly. This allows a direct call from the client machine to the
DBMS server and is a practical solution for Internet access. Since many of
these protocols are proprietary, the database vendors themselves will be the
primary source and database vendors have these in progress

40
Citizen card

SERVLETS

In the early days of the web, a server could dynamically construct a


page by creating a separate process to handle each client request. The
process would open connection to one or more databases in order to obtain
the necessary information. It communicated with the web server via an
interface known as the Common Gateway Interface (CGI) .CGI allowed the
separate process to read data from HTTP request and write data to the HTTP
response. A variety of different languages were used to build CGI programs
including C, C++ and Perl.

However, CGI suffered serious performance problems. Creating a


separate process for each request was expensive, in terms of the processor
and resources. It was also expensive to open and close database connections
for each request.

Servlets offer several advantages over CGI:


Performance is significantly better. Servlets execute within the address space
of a web browser. Creating a separate process to handle each request isn’t
necessary.

Servlets are platform-independent, because they are written in java. Several


web servers, from vendors such as Sun, Netscape and Microsoft offers the
Servlets API. Programs developed for this API can be moved to any of these
environments without recompilation.

41
Citizen card

The java security manager on the server enforces a set of restrictions to


protect the resources on a server machine. You will see that some servlets
are trusted and others are untrusted. The full functionality of the class
libraries is available to a servlet.

The life cycle of a servlet:


Three methods are central to the cycle of a servlet:
Init ()
Service ()
Destroy ()
They are implemented by every servlet and are invoked at specific times by
the server. Consider next a typical user scenario, to understand when these
methods are called.

First, assume that a user enters a Uniform Resource Locator (URL) to the
web browser. The Browser then generates a HTTP request for this URL and
sends it to the appropriate server.
Second, the web server receives this HTTP request. The server maps this
request to a particular servlet. This servlet is dynamically retrieved and
located into the address space of the server.
Third, the server invokes the init () method of the servlet. This method is
invoked only when the servlet is first loaded into the memory. You will see

42
Citizen card

the initialization parameters can be passed to the servlet so that it may


configure itself.
Fourth, the server invokes the servlets service () method, which is called to
process the HTTP request. You will see that the servlet can read data that
has been provided in the HTTP request, and may also formulate an HTTP
response for the client.

The servlet remains in the servers address space and is available to process
any other HTTP requests received from clients. The service () method is
called for each HTTP request.
Finally the server may decide to unload the servlet from its memory. The
algorithms by which this determination is made are specific to each server.
The server calls destroy () method to relinquish any resources, such as file
handlers that are allocated for a servlet. Important data may be saved to a
persistent store. The memory allocated for the servlet and its objects can
then be garbage collected.

SERVLET ARCHITECTURE OVERVIEW:


The central abstraction in the JSDK is the servlet interface. All servlets
implements this interface, either directly or more commonly by extending a
class that implements it such as HTTP servlet. The servlet interface provides
for methods that manage the servlet and it’s developing a servlet.

43
Citizen card

When a servlet accepts a call from client it receives two object one is servlet
request and the other is a servlet response. The servlet request class
encapsulates the communication from the back to the client.

The servlet request interface allows the servlet access to the information
such as the names of the parameters passed in by the client, the protocol
(scheme) being used by the client, and the names of the remote host that
made the request and the server that received it. It also provides the servlet
with access to the input stream. Servlet classes of servlet request allow the
servlet to retrieve more protocol specific data. Input stream, through which
the servlet gets data from clients that are using application, protocols such as
the HTTP POST and PUT methods. Subclasses of servlet request allow the
servlet to retrieve more protocol specific data.

The Servlet Response interfaces give the servlet methods to the client. It
allows the servlet to set the content length and mime type of the reply and
provides an output stream. Servlet output stream and a writer through which
the servlet can send the reply data. Subclasses of Servlet Response give the
servlet more protocol specific capabilities. For example, HTTP Servlet
Response contains methods that allow the servlet to manipulate the HTTP
specific header information.

44
Citizen card

Services load and run servlets, which then accept zero or more requests from
clients and return data to them. They can also remove servlets. These are the
steps of a servlets life cycle.

When a service () loads a servlet, it runs the servlets init () method. Even
though most servlets are run in multi-threaded services, there are no
concurrency issues during servlet initialization. This is because the service
calls the init () method once, when it loads the servlet, and will not call it
again unless it is reloading the servlet. The service cannot reload a servlet
until after it has removed the servlet by calling the destroy () method.
Initialization is allowed to complete before the client requests are handled or
the servlet is destroyed.

Each client’s request has its call to the service () method run in its own
servlet. The method receives the client’s request and sends the client its
response. Servlets can run multiple service () methods at a time .It is
important therefore that service () methods be written a thread -safe manner.
Servlets until they are removed from the service. When a service removes a
servlet, it removes a servlet, it runs the servlet destroy () method. The
method is run once; the service3 will not run it again until after it reloads the
reinitializes the servlet. When the destroy () method runs, however, other
threads might be running service request .If in cleaning up, it is necessary to
access shared resources that access should be synchronized.

45
Citizen card

HYPER TEXT MARKUP LANGUAGE (HTML)


HTML is a language used to create hypertext documents that have
hyperlinks embedded in them .You can build web pages. It is only a
formatting language and not a programming language. Hyperlinks are
underlined or emphasized words or locations in a screen that lead to other
documents. WWW is a global, interactive, graphical, hypertext information
system.

The behind hypertext is that instead of reading text in rigid liner structure
you can easily jump from point to another point .You can navigate through
the information based on your interest and preferences.

Hyper Media: HTML pages audio and video files linked to them are Hyper
Media.

HTML is platform independent:


If you can access Internet, you can access WWW, irrespective of your
Operating System and the Operating System of Web Server you are
accessing .All you require is to view and download the HTML files, which
are on the WWW, are browser and Internet connections.

HTML is a language for describing structured documents. HTML describes


the structure of documents -lists, heading, and paragraph, etc. Elements of

46
Citizen card

web document are through the usage of HTML tags. It is tags that describe
documents. Anything that is not a tab is part of a document itself.

HTML does not describe page layout:

Word for windows or Lotus AmiPro for example, have different styles for
Headings, fonts, size and identification. HTML does not have all these.

Based on the platform, exact placement or appearance of any element will


change. There may be or may not be fonts installed. So your formatted text
will appear differently on differently on different machines/platforms.

By separating the structure of the document and its appearance, a program


that reads and understands HTML can make formatting decision based on
capabilities of the individual platform. In addition to providing the
networking functions to retrieve documents, web browsers are also HTML
formatters. They parse and format documents and display them on the
screen. Different browsers show data differently.

Advantages:
An HTML document is a small and hence easy to send over the net. It is
small because it does not include format information.

47
Citizen card

HTML documents are cross platform compatible and device independent.


You only need HTML readable browser to view them. Font names, locations
etc are required.

48
Citizen card

JAVA SCRIPT

Introduction To Java Script:


JAVA script enables you to embed commands in an HTML page. When
a compatible web browser, such as Netscape Navigator 2 or higher or
Internet explorer 3 or higher, downloads the page, your JAVA script
commands are loaded by the web browser as part of the HTML document.
These commands can be triggered when the user clicks page items,
manipulates gadgets and fields in an HTML form, or moves through the
page history list.

JAVA script is an interpreted language - the computer must evaluate the


program every time it is run. You embed your JavaScript commands within
an HTML page, and any browser that supports JavaScript can interprets the
commands and act on them. JavaScript is powerful and simple.

Scripting Language:
JavaScript enables Web authors to write small scripts that execute on the
users’ browsers rather than on the server. An application that collects data
from a form and then posts it to the server can validate the data for
completeness and correctness, for example, before sending it to the server.
This can greatly improve the performance of the browsing session because
users don’t have to send data to the server until it has been verified as
correct.

Another important Web browser scripting languages such as JavaScript


comes as a result of the increased functionality being introduced for Web

49
Citizen card

browsers in the form of Java applets, plug-ins, Dynamic HTML elements,


Active X Controls, and VRML objects and worlds. Web authors can use
each of these things to add extra functions and interactivity to a Web page.
Scripting language acts as the glue that binds everything together.
A Web page might use an HTML form to get some user input and then set a
parameter for a Java applet based on that input. It is usually a script that
carries out.

Use of JavaScript:
JavaScript provides a fairly complete set of built-in functions and
commands, enabling you to perform math calculations, manipulate strings,
play sounds, open new windows and new URLs, and access and verify user
input to your Web forms.

Code to perform these actions can be embedded in a page and executed


when the page is loaded. We can also write functions containing code that is
triggered by events you specify. You can write a JavaScript method that is
called when the user clicks submit button of a form, for example, or one that
is activate when the user clicks a hyperlink on the active page.

JavaScript can also set the attributes, or properties, of Web page elements,
Active-x controls, Java applets and other objects present in the browser.

This way, you can change the behavior of plug-ins or other objects without
having to rewrite them. Your JavaScript code could automatically set the
text of an Active-X Label Control, for example, based on what time the page
is viewed.

50
Citizen card

JavaScript commands are embedded in your HTML documents. Embedding


JavaScript in your pages requires only one new HTML element: <SCRIPT>
and </SCRIPT>. The <SCRIPT> element takes the attribute LANGUAGE,
which specifies the scripting language to use when evaluating the script, and
SRC, which can be used to load a script from an external source.

51
Citizen card

The following are some simple rules to help you understand how the
language is structured:
• JavaScript is case sensitive.
• JavaScript is flexible about statements. A single statement can cover
multiple lines, and you can put multiple short statements on a single line -
just make sure to add a semicolon (;) at the end of each statement.
• Braces (the {and} characters) group statements into blocks; A block may
be the body of a function or a section of code that gets executed in a loop
or as part of the conditional test.
JavaScript is designed to resemble Java, which, in turn, looks a lot like C
and C++. The difference is that Java was built as a General-purpose object
language; JavaScript, on the other hand, is intended to provide a quicker and
simpler language for enhancing Web pages and servers.

52
Citizen card

ORACLE

DATABASE MANAGEMENT SYSTEMS (DBMS) :


A DBMS consists of a collection of interrelated date and a set of
programs to access that data and to modify the data. The collection of data is
usually referred as the “database”. The database contains information about
any particular enterprise. The primary goal of a DBMS is to provide an
environment that is both convenient and efficient to use in retrieving and
storing information into the database.

Database systems are designed to manager large bodies of


information. The management of data involves both the definition of the
structure for the storage of information and the provision of mechanisms for
the manipulation of information. In addition the database system must
provide for the safety of information stored in the database despite system
crashes or attempts by users, the system must avoid possible anomalous
results.

Characteristics Of Database Management Systems:


• Have different It represents complex relationships between data.
• Keeps a tight control on data redundancy.
• Enforces user-defined rules to ensure that integrity of table data.
• Enforces threat data can be shared by different applications.
• Enforces data access authorization.
• Have automatic, intelligent backup and recovery procedures for
data.interfaces via which users can manipulate data.

53
Citizen card

The data is stored in the form of tables. The tables consist of one or
more records or rows. Each row has one or more fields or columns. The
unit of data is accessed by a row and column intersection. A column that
has a unique set of values through out the table can be used to access the
data. Such a column is called the “ key” or the “primary Key”. If no such
single column exists, using a set of columns such that when combined they
are unique throughout the table can access the data. These set of columns
are called “Composite Key”.

In short modern (Relational) RDBMS act as a transparent interface


between the physical storage and the logical presentation of data. It
provides a set of flexible and sophisticated tools for handling information.
The tools can be used to
• Define database
• Query a database.
• Add, delete and modify the database.
• Modify the structure of the database.
• Secure the data public access.
• Communication within networks/time sharing environments.
• Export and import the data.

Data Abstraction

54
Citizen card

The major purpose of a database system is to provide users with an


abstract view of data. That is the system hides certain details of how the
data is stored and maintained while the data is sufficiently retrieved.
Levels are

Physical Level: The lowest level of abstraction describes how the data is
actually stored.

Conceptual Level: T he next level of abstraction describes what data is


actually stored in the database, and the relationships that exist among the
data.
Data base administrators, who must decide what information is to be kept
in the database, use the conceptual level of abstraction.

View Level: The highest level of abstraction describes only part of the
entire database. The system may provide many views for the same
database.

Data Model:
Underlying the structure of a database is the concept of the data
model, a collection of conceptual tools for describing data relationships,
data semantics and consistency constraints.
The various data models fall into three groups. They are
Object Based logical model:
These are used in describing data at the conceptual and view levels.
Some of the object based logical models are

55
Citizen card

• Entity-relationship model
• Object-oriented model
• Binary model
• Semantic model
• Info logical model
• Functional data model

Record based logical model:


Record-based logical models are used in describing data at the
conceptual and view levels. These are so named because the database is
structured in fixed format records of several types. In this the three most
widely accepted data models are
• Relational Model: - The relational model represents data and
relationships among data by a collection of tables, each of which has
number of columns with unique names.
• NetWork Model: - Data in the network model is represented by
collection of records and relationship among data represented by links,
which can be used, as pointers. The records in the database are organized
as collection of arbitrary groups.
• Hierarchical Model: - It is same as the network model, but the records are
organized as collection of trees rather than arbitrary groups.

• Physical Data Model: Physical data models are used to describe data at
the lowest level. Two of the widely known ones are
 Unifying model

56
Citizen card

 Frame model

Instances and Schemas:


The collection of information stored in the database at particular
moment in time is called an instance of the database.

The overall design of the database is called as the Database Schema.


Database systems have several schemes. They are

• Physical Schema
• Conceptual Schema
• Sub Schema

Data Independence:
The ability to modify a schema definition in one level without
affecting a schema definition in the next higher level is called data
independence.
The two levels of data independence are

 Physical Data Independence: It is the ability to modify the physical


schema without causing application programs to be rewritten.

 Logical Data Independence: It is the ability to modify the conceptual


schema with out causing application programs to be rewritten.

57
Citizen card

Data Definition Language (DDL):


A database schema is especially by a set of definitions, which are
expressed by a special language called data definition language. The result
is a set of tables, which are stored in a special file as data dictionary.

Data Manipulation Language (DML):


By data manipulate we mean that
• The retrieval of information stored in the database.
• The insertion of information into the database.
• The deletion of information from the database.

The goal should be to provide efficient human interaction with the


system. The DML is a language that enables us to a view data as organized
by the appropriate data model. There are basically two types of data
manipulation languages, they are

• Procedural: - DML requires the user to specify what data is needed and
how to get it. Here the data gets modified in each procedure and
execution is in the form of procedure by procedure.

58
Citizen card

• Non-procedural: - DML requires the user to specify what data is needed


without specifying how to get it. The form is based on certain events, that
is event driven. On-procedural DML is usually easier to learn than
procedural DML.

A query is a statement requesting the retrieval of information. The


portion of DML that involves information retrieval is called “Query
Language”. Hence sometimes DML is also called as query language.
Data Dictionary:
A data dictionary is a file that contains Meta data that is data about data.
This file is consulted before actual data is read or modified in the database
system. The data storage and definition language specifies the storage and
access methods of the database system.

Overall System Structure


A database system consists of functional components.
File Manager: - Manager the allocation of space on the disk storage and
the data structure used to represent the information stored on the disk.

Data Manager: - Provides the interface between the low-level storage in


the database and the application programs and queries submitted to the
system.

59
Citizen card

Query Processor: -Translates the statements in a query language into low


level instructions that the database manager understands. It also attempts
to transform the query into an efficient and optimized equivalent query.

DML pre-compiler: - Converts DML statements embedded in an


application program to normal procedural call in the host language.

DDL compiler: - Converts DDL statements to a set of tables are containing


the data. These tables are then stored in the data dictionary.

Normalization:
Relational databases a form of database specification based upon the
mathematical concept of a relation. The mathematical nature of the
concept is, however, not necessary to its appreciation and

database may be regarded as composed of a number of rectangular


tables, each expressing one relation. Unlike network or hierarchical
database models, the relational system is structured at the time each query
is posed rather than at the time if the database is established. The
structures are achieved by the combination of relations using relational
operators.

Normalization is carried out for three reasons.

60
Citizen card

1. To secure the data so that any pertinent relationship between entities can
be represented.
2. To simplify the maintenance of the data through updates, inserts and
deletions.
3. To reduce the need to restructure or re-organize data when new
application requirements arise.

First Normal Form:


First normal form is achieved when a record is designed to be of fixed
length. Removing the repeating group and creating a separate file or
relation containing the repeating group accomplish this. The original and
new records are interrelated by a common data item.

Second Normal Form:


Second normal form is achieved when a record is in the first normal form
and each item in the record is fully dependent on the primary record key
for identification data item is functionally dependent if its value is
uniquely associated with a specific data items .To achieve second normal
form, every data item in the record that is not dependent on the primary
key of the record should be removed and used to form a separate relation.

61
Citizen card

Third Normal Form:


Third normal form is achieved when transitive dependencies are removed
from a record designed conversion to third normal form removes the
transitive dependencies by splitting the relation into two separate relations.

Boyce Code Normal Form


A relation is said to be in the BCNF if determinate is a candidate key.
Relations in 3NF can also have anomalies. Relations in BCNF have no
anomalies regarding functional dependencies and this seemed to have put
the issue of modification anomalies to rest. However it was soon
discovered that anomalies could arise from situations other than functional
dependencies. The fourth, fifth and domain key normal forms were
proposed to overcome these anomalies.

INTERNET

Internet is a network. The simple definition has many complications,


implementations and consequences. Primarily it differs from the ordinary
networks, in the respect that it connects networks but not computers.
Now, because we want to connect various networks there could be hundreds
of different types of networks and surprisingly Internet accommodates all
these. From a home PC to a super computer can be present on the Internet. It
can use the simple serial ports to the most advanced satellites.
There are no special advantages of Internet apart from those of general
network. Whether it is an Internet or general network it can do only

62
Citizen card

information interchange and we can achieve the same secondary advantage.


But the difference is in the extendibility and reach.

World Wide Web (WWW):


World Wide Web (WWW) is a global hypertext system that uses the
Internet as its transmission medium.
Hypertext:

Hypertext is a method of preparing and publishing text in which users


can choose their own paths through the material. The text is broken in to
small units such as single pages called nodes. Then hyperlinks are
embedded into the text. Typically the user can has a GUI on which he
clicks a button to navigate through the different pages.

Hyperlink:

A hyperlink is an underlined or emphasized work that when clicked


with a mouse displays another document.
These documents can come from other sites on the Internet. Clicking on
these links activates the necessary protocols and pulls up the chosen site.

63
Citizen card

Web:

A collection of documents inter-linked by hyperlinks is called as web.


A web page is a synonymous with web documents. It is not the same as a
page on your screen .It is also defined as a hypertext information system.

Browsing:

The process of navigation among documents is called browsing. The


users have click software such as Netscape Navigator, Internet Explorer to
actually retrieve and browse the information on the WWW. WWW
supports many kinds of documents such as text, pictures, video and audio.
Sometimes it is referred to as Net Surfing.

Web Browser
It is basically a program that run on an Internet connected computer and
provides access to WWW resources.

Browser Types:
There are two types of Browsers
1. Text only browsers such as Linux are used on Shell accounts. This
is faster but does not provide GUI features and so not that user
friendly.
2. Graphical Web Browsers such as Netscape Navigator, Internet
Explorer is more popular. HotJava and Mosaic are also Web

64
Citizen card

Browsers. These Browsers provide with in line images, fonts and


document layouts.

Website:

The website is a computer system that runs on web server and has
been set up for publishing documents. Some websites have only a single
document while others consists of hundreds of pages, for example about
the services or products provided by the company.

Web Server:

A web server is a program that accepts requests for information


framed according to the Hypertext Transfer Protocol. The server
processes these requests and sends the request documents. When you
access a WWW server, the document is transferred to your computer and
then the connection is terminated. This reduces network traffic by not
having to hold on to a line while you read a document.

65
Citizen card

Testing

Testing is the major quality control measure employed for software


development.

Its basic function is to detect errors in the software. During requirement


analysis and

design, the output is document that is usually textual and non-textual. After
the coding

phase, computer programs are available that can be executed for testing
purpose. This

implies that testing has to uncover errors introduced during coding phases.
Thus, the goal

of testing is to cover requirement, design, or coding errors in the program.

The starting point of testing is unit testing. In this a module is tested


separately and are

often performed by the programmer himself simultaneously while coding the


module.

66
Citizen card

The purpose is to exercise the different parts of the module code to


detect

coding errors. After this the modules are gradually integrated into subsystems,
which are

then integrated themselves too eventually forming the entire system.

During integration of module integration testing is performed. The goal of this

is to detect designing errors, while focusing the interconnection between


modules.

After the system was put together, system testing is performed. Here the
system

is tested against the system requirements to see if all requirements were met
and the system

performs as specified by the requirements. Finally accepting testing is


performed to

demonstrate to the client for the operation of the system.

67
Citizen card

For the testing to be successful, proper selection of the test case is essential.
There are two

different approaches for selecting test case. The software or the module to be
tested is

treated as a black box, and the test cases are decided based on the
specifications of the

system or module. For this reason, this form of testing is also called “black
box testing”.

The focus here is on testing the external behavior of the system. In structural
testing the test

cases are decided based on the logic of the module to be tested. A common
approach

here is to achieve some type of coverage of the statements in the code.

The two forms of testing are complementary: one tests the external behavior,
the other tests

the internal structure. Often structural testing is used for lower levels of
testing, while

68
Citizen card

functional testing is used for higher levels.

Testing is an extremely critical and time-consuming activity. It requires


proper planning of

the overall testing process. Frequently the testing process starts with the test
plan. This plan

identifies all testing related activities that must be performed and specifies the
schedule,

allocates the resources, and specifies guidelines for testing. The test plan
specifies

conditions that should be tested;

different units to be tested, and the manner in which the module will be
integrated together.

Then for different test unit, a test case specification document is produced,
which lists all

69
Citizen card

the different test cases, together with the expected outputs, that will be used
for testing.

During the testing of the unit the specified test cases are executed and the
actual results are

compared with the expected outputs. The final output of the testing phase is
the testing

report and the error report, or a set of such reports. Each test report contains a
set

of test cases and the result of executing the code with the test cases. The error

report describes the errors encountered and the action taken to remove the
error.

Error Messages

The term error is used in two different ways. Errors refer to the discrepancy
between

computed and observed values. That is error refers to the difference between
the actual

70
Citizen card

output of the software and the correct output. In this interpretation, error
essentially is a

measure of the difference between the actual and the ideal. Error is also used
to refer to

human action that results in the software containing a defect or a fault. This
detection is

quite general and encompasses all phases.

The consequence of thinking is the belief that the errors largely occur during

programming, as it is the can see, the errors occur through the development.
As we can

see, the errors occur throughout the development process. However, the cost
of

connecting the errors of different phases is not the same and depends upon
when the error

was detected and corrected. The cost of correcting errors in the function of
where they are detected.

71
Citizen card

As one would expect the greater the delay in detecting an error after it
occurs, the more

expensive it is to correct it. Suppose an error occurs during the requirement


phase and it was

corrected after the coding then the cost is higher than correcting it in the
requirements phase

itself. The reason for this is fairly obvious. If there was error in the
requirements phase that

error will affect the design and coding also. To correct the error after coding is
done require

both the design and the code to be changed there by increasing the cost of
correction.

The main moral of this section is that we should attempt to detect the
errors that

occur in a phase during the phase itself should not wait until testing to detect
errors. This is

not often practiced. In reality, sometimes testing is the sole point where errors
are detected.

72
Citizen card

Besides the cost factor, reliance on testing as a primary source for error
detection and

correction should be a continuous process that is done throughout the software

development. In terms of the development phase, what this means is that we


should try to

validate each phase before starting the next.

Testing Techniques

Testing is a process, which reveals errors in the program. It is the major


quality measure

employed during software development. During testing, the program is


executed with a

set of conditions known as test cases and the output is evaluated to determine
whether the

program is performing as expected.

73
Citizen card

In order to make sure that the system does not have errors, the different
levels of

testing strategies that are applied at differing phases of software development


are:

Unit Testing

Unit Testing is done on individual modules as they are completed and become

executable. It is confined only to the designer's requirements.

EACH MODULE CAN BE TESTED USING THE FOLLOWING TWO


STRATEGIES:

Black Box Testing:

In this strategy some test cases are generated as input conditions that fully
execute all

74
Citizen card

Functional requirements for the program. This testing has been uses to find
errors in the

Following categories:

a) Incorrect or missing functions


b) Interface errors
c) Errors in data structure or external database access
d) Performance errors
e) Initialization and termination errors.

In this testing only the output is checked for correctness. The logical flow of
the data is not checked.

White Box Testing

In this the test cases are generated on the logic of each module by drawing
flow graphs of

that module and logical decisions are tested on all the cases.

It has been uses to generate the test cases in the following cases:
a) Guarantee that all independent paths have been executed.
b) Execute all logical decisions on their true and false sides.

75
Citizen card

c) Execute all loops at their boundaries and within their


operational
d) Execute internal data structures to ensure their validity.

Integration Testing

Integration testing ensures that software and subsystems work together as a


whole. It

tests the interface of all the modules to make sure that the modules behave
properly when

integrated together.

System Testing

Involves in-house testing of the entire system before delivery to the user. Its
aim is to

satisfy the user the system meets all requirements of the client's
specifications.

76
Citizen card

Acceptance Testing

It is a pre-delivery testing in which entire system is tested at client's site on


real world

data to find errors.

Validation Testing

The system has been tested and implemented successfully and thus
ensured that

all the requirements as listed in the software requirements specification are


completely

Fulfilled. In case of erroneous input corresponding error messages are


displayed.

COMPILING TEST

It was a good idea to do our stress testing early on, because it gave us time to
fix some of

77
Citizen card

the unexpected deadlocks and stability problems that only occurred when
components

Were exposed to very high transaction volumes.

EXECUTION TEST

This program was successfully loaded and executed. Because of good


programming there

were no execution error.

OUTPUT TEST

The successful output screens are placed in the output screens section above.

Data Flow Diagrams (DFD)

78
Citizen card

DATA FLOW ANALYSIS

This states a great deal about how organization objectives are accomplished in
the course

of handling transactions and completing task. Data is input, processed, stored,


retrieved,

Used, changed and output. Data flow analysis studies the use of data in each
activity.

FEATURES OF DATA STRATEGY:

Data flow analysis examines the use of the data to carry out specific process

Within the scope of a systems investigation.

TOOLS OF DATA FLOW STRATEGY:

Data flow strategy shows the use of data in the system pictorially. The tools

used in the data flow strategy are:

DATA FLOW DIAGRAM (DFD):

79
Citizen card

A graphical tool is used to describe and analyse the movement of the data
through a

system manually or automate including the process of data storage, and delay
in the

system. DFD’s are central tools and

the basis for the development of other components. The transformation of data
from one

process to another process is independent of physical components. These


types of DFD’s

are called LOGICAL DATA FLOW DIAGRAMS. In contrast, physical data


flow diagrams

show the actual implementation and movements of the data through people,
departments

and workstations.

DATA FLOW DIAGRAMS

Data flow diagram is a structure analysis tool that is used for graphical
representation of

80
Citizen card

Data processes through any organization. The data flow approach emphasis on
the logic

underlying the system, by using combination of only 4 symbols. It follows a


top down

approach. A full description of a system actually consists of set of DFD s,


which

comprises of various levels. And initial over view model is exploded lower
level

diagrams that show additional feature of the system. Further each process can
be broken

down into a more detailed DFD. This occurs repeatedly until sufficient details

are described.

DFD SYMBOLS

Square: It defines a source (originator) or destination of system data.

81
Citizen card

Arrow: It indicates data flow-data in motion. It is a pipeline through which


information flows.

Circle or Bubble: It represents a process that transforms incoming data


flow(s) into outgoing data
flow(s).

Open Rectangle: it is a data store-data at rest, or a temporary repository of


data. Here I am giving only

the Data Flow Diagram.

They are explained by


• GANE and SARON method
• DEMACRO YORDAN method

82
Citizen card

GANE AND SARSON NOTATION

DATA FLOW

DATA STRUCTURE

EXTERNAL ENTITY
OR DATA LINK

PROCESS

DATA BASE

83
Citizen card

DEMACRO YORDAN NOTATION

DATA FLOW

DATA STRUCTURE

EXTERNAL ENTITY
OR DATA LINK

PROCESS

DATA BASE

84
Citizen card

85
Citizen card

DATA FLOW DIAGRAMS

Employee
Administrator

86
Citizen card

Registration logging in Adding details display details


and logging out

87
Citizen card

1-LEVEL DFD for citizen MODE

Insurance

Banking

citizen

Server
passport

Gas details

88
Citizen card

1-LEVEL DFD for ADMINISTRATOR MODE

login

Add
ci
ti

DATABASE
Administ
rators

Update
citizen
details

View citizen
details

89
Citizen card

ADVANTAGES OF DFD’s:

Users, persons who are part of the process being studied, early
understand the

notations. So analysts can work with the users and involve them in
the study of

data flow diagram. For accurate business activity users can make
suggestions

for modification and also they examine charts and spot out the
problems

quickly. If the errors are not found in the development process they
will be very

difficult to correct latter and the system may be failure.

Data flow analysis permits analyst to isolate areas of interest in the


organization

90
Citizen card

and study them by examining the data that enters the process and
see how it is

changed when it leaves the process.

Data Flow Diagram

- Administrators

Add citizen Update


details View
citizen
citizen
details
details

91
Citizen card

UML Diagrams :-
`Usecasediagram of Citizen

Personal info

Voting

Passport

Municipality

Electricity

Gas

RTO

92
Citizen card

USECASE DIAGRAMS OFADMINISTRATOR

PERSONAL INFORMATION :

Adding Citizen Personal details

Updating Citizen Personal details

View Citizen Personal details

USE CASE DIAGRAM FOR VOTING :

Adding Citizen Voting details

Updating Citizen Voting details

View Citizen Voting details

93
Citizen card

USE CASE DIAGRAM FOR PASSPORT :

Adding Citizen Passport details

Updating Citizen Passport details

View Citizen Passport details

USE CASE DIAGRAM FOR MUNICIPALITY :

Adding Citizen Municipal details

Updating Citizen Municipal details

View Citizen Municipal details

94
Citizen card

USE CASE DIAGRAM FOR ELECTRICITY :

Adding Citizen Electricity details

Updating Citizen Electricity details

View Citizen Electricity details

USE CASE DIAGRAM FOR GAS :

Adding Citizen Gas details

Updating Citizen Gas details

View Citizen Gas details

USE CASE DIAGRAM FOR RTO :

95
Citizen card

Adding Citizen RTO details

Updating Citizen RTO details

View Citizen RTO details

USE CASE DIAGRAM FOR TELEPHONE :

Adding Citizen Telephone details

Updating Citizen Telephone details

View Citizen Telephone details

USE CASE DIAGRAM FOR PROVIDENT FUND :

96
Citizen card

Adding Citizen Provident Fund details

Updating Citizen Provident Fund details

USE CASE DIAGRAM FOR TAXATION :

Adding Citizen Tax details

Updating Citizen Tax details

View Citizen Tax details

USE CASE DIAGRAM FOR BANKING :

97
Citizen card

Adding Citizen Banking details

Updating Citizen Banking details

View Citizen Banking details

USE CASE DIAGRAM FOR INSURANCE :

Adding Citizen Insurance details

Updating Citizen Insurance details

View Citizen Insurance details

USE CASE DIAGRAM FOR CREDIT RATING :

98
Citizen card

Adding Citizen Creadit rating details

Updating Citizen Credit rating details

View Citizen Credit rating details

99
Citizen card

Sequence Diagram for Citizen :

Persona
Credit rating Electricity Insurance Electricity Banking Tax
l

100
Citizen card

Activity Diagram for Citizen:

Login

Create, Modify Citizen

Access Citizen Options

Client Updates Server

Reports

101
Citizen card

Activity Diagram for ADMIN :

Enter username

Enter
Password

Check to correctness of entered text

Validat
ed?

Citizen Access

Admin Page

Apply Items

102
Citizen card

Diagram for Admin :

Create the Citizens

Modify the Citizen

Remove Citizen

103
Citizen card

Diagram for User Options :

Get User Details

Select the Option

If Not Eligible
If Eligible
for Apply?

If Eligible for
the Options Apply for the Items

Access and Apply Online

104
Citizen card

DATA DICTIONARY

Database tables

User Details

Create table userdata(cdid varchar2(20),


Name varchar2(20),
Pass varchar2(20));

Personal Information

Create table personal1data (name varchar2(20),


Idno varchar2(20),
Fname varchar2(20),
Dateofbirth varchar2(20),
Gender varchar 2(10),
Quli varchar2(10),
Addr varchar2(10),
Language varhcar2(10),
Cdno varchar2(20));

Taxation

Create table tax2data(cdno varchar2(10) not null,


Idno varchar2(10) not null,
Aincome varchar2(10) not null,
Incometax varchar2(10) not null,
Assets varchar2(10) not null,
Ptax number(10) not null,
Rtax number(10) not null,
Amount number(8) not null);

105
Citizen card

Gas Details

Create table gas2data(cdno varchar2(10) not null,


Name varchar2(20) not null,
Idno varchar2(15) not null,
Gasno varchar2(10) not null,
Gastype varchar2(10) not null,
Addr varchar2(10) not null,
Amount varchar2(10) not null);

RTO:

create rto1data(name varchar2(10),


idno varchar2(15),
v_type varchar2(10),
v_regno varchar2(10),
v_engno number(8),
v_serviceno varchar2(10),
addr varchar2(40),
licence varhcar2(15),
re_date varchar2(10));

Banking:

create sbi1data(name varchar2(10),


citizenid varchar2(15),
balance number(8));

create icici1data(name varchar2(10),


citizenid varchar2(15),
balance number(8));

create ab1data(name varchar2(10),

106
Citizen card

citizenid varchar2(15),
balance number(8));

Voting:

create vote2data(cdno varchar2(10) not null,


name varchar2(10) not null,
fname varchar2(20) not null,
idno varchar2(10) not null,
age varchar2(10) not null,
sex varchar2(10) not null,
addr varchar2(40) not null);

create votedata(cdno varchar2(10) not null,


name varchar2(10) not null,
fname varchar2(20) not null,
idno varchar2(10) not null,
age varchar2(10) not null,
sex varchar2(10) not null,
addr varchar2(40) not null)
voterno varchar2(10) not null);
Telephone:

create tele2data(cdno varchar2(10) not null,


name varchar2(10) not null,
fname varchar2(20) not null,
idno varchar2(10) not null,
age varchar2(10) not null,
noofphn varchar2(10) not null,
totbill varchar2(40) not null)
duedate varchar2(10) not null);

Electricity:

107
Citizen card

create elect2data(cdno varchar2(10) not null,


name varchar2(10) not null,
fname varchar2(20) not null,
idno varchar2(10) not null,
age varchar2(10) not null,
noofphn varchar2(10) not null,
amtbill varchar2(40) not null
duedate varchar2(10) not null);

Municipality:

create table muni2data(cdno varchar2(10) not null,


name varchar2(10) not null,
idno varchar2(10) not null,
addr varchar2(10) not null,
contno varchar2(10) not null,
waterbill varchar2(40) not null
htax varchar2(10) not null
bill varchar2(10) not null
duedate varchar2(10) not null);

Insurance:

create table insurance1data( cdno varchar2(10) not null,


name varchar2(10) not null,
idno varchar2(10) not null,
addr varchar2(10) not null,
typeofinsurance varchar2(10),
amount number(10) not null);

Passport:

create pass2data(cdno varchar2(10) not null,

108
Citizen card

name varchar2(10) not null,


idno varchar2(10) not null,
addr varchar2(10) not null,
fname varchar2(10) not null,
contno varchar2(10) not null,
dob varchar2(10) not null,
gender varchar2(10) notnull,
country varchar2(10) not null,
passno number2(10) notnull,
noofstamps varchar2(10) notnull,
fileno varchar2(10)not null,
rendate varchar2(10) notnull);

Provident Fund:

create pf2data(cdno varchar2(10) not null,


name varchar2(10) not null,
idno varchar2(10) not null,
company varchar2(10) not null,
aincome varchar2(15) not null,
amount varchar2(10) not null,
saving varchar2(10) not null);
Credit Rating:

create table credit1data(name varchar2(20),


idno varchar2(10),
fir varchar2(50),
ss varchar2(20),
credit varchar2(5));

109
Citizen card

Drawbacks:
Citizen Card project has some drawbacks like
The details are maintained by the number of administrators.
There is a chance of gathering wrong information in personal information
details until administrator works good without fraud.

Conclusion:
Citizen card project maintains unique id to every citizen to utilize
there own services in private or Govt Organizations. A Citizen has unique Id
to find out the personal information in each and every department or service
wherever a citizen goes. This information can be found out by the unique Id
of the citizen. It maintains and manages the transactions easily in
different departments.

110

Vous aimerez peut-être aussi